Given:

$$F = \frac{mgR^2}{(x + R)^2}$$

$m = \text{mass}$

$g = \text{Acceleration due to gravity}$

$x = x(t)$ is the object's distance above the surface at time $t$.

I believe this is the *Universal Law of Gravitation* (correct me if I am wrong)

Also by Newton's Second Law, $F = ma = m\left(\dfrac{dv}{dt}\right).$

The question reads:

Suppose a rocket is first vertically upward with an initial velocity $v$. Let $h$ be the maximum height above the surface reached by the object. Show that:

$$v = \sqrt{\frac{2gRh}{R + h}}.$$

At the bottom of the problem it says: Hint: by the chain rule $$m\frac{dv}{dt} = mv\frac{dv}{dx}$$

If it isn't too much trouble, how did the textbook writers get this result using chain rule?

Thank you for your time.