I am having a problem understanding how the chain rule was used on $\displaystyle \frac{d(x^2)}{dt}$ to arrive at $\displaystyle 2x \cdot \frac{dx}{dt}$ in the question below (sections highlighted in red)

Question: The edge of an expanding square is changing at the rate of 2 cm/s. Determine the rate of change of its area at the instant when its edge is 6cm long.

Here is the working:

$\displaystyle A = x^2$ (state the problem mathematically)

$\displaystyle \frac{dA}{dt}=\frac{d(x^2)}{dt}$ (differentiate with respect to time)

$\displaystyle \frac{dA}{dt}=2x \cdot \frac{dx}{dt}$ (chain rule - I don't understand how this was arrived at $\displaystyle 2x \cdot \frac{dx}{dt}$ )

Use x = 6cm and $\displaystyle \frac{dx}{dt}$ =2cm/s (and I don't understand why dx/dt =2. In other words, from reading the question above, how would I know that dx/dt=2?)

$\displaystyle \frac{dA}{dt}=2(6 cm) \cdot (2cm/s)$

$\displaystyle \frac{dA}{dt}=24cm^2/2$

Answer: The area of the square is changing at the rate of $\displaystyle 24cm/s^2$ at the instant when its side is 6 cm long