Differential equation solving related to 2nd Newton's law

Without taking into account friction and resistance to the air, but while taking into account the gravitation force and the altitude. The weight $\displaystyle W$ is decreasing in terms of $\displaystyle x$ (altitude):

$\displaystyle P(x)=\dfrac{mgR^2}{(R+x)^2}$

$\displaystyle m$: Mass of the object

$\displaystyle g$: Gravitational force (at sea level)

$\displaystyle R$: Radius of Earth

$\displaystyle x$: Altitude

What is the speed of the object in terms of its altitude (we're looking for $\displaystyle v(x)$)?

I'm trying hard to resolve this equation but just can't find how to relate it to the altitude instead of the time.

Thanks to anyone who takes the time to answer this question. Good night,