I am trying to find the distance of a rocket by integrating its velocity equation, that is, the Tsiolkovsky rocket equation. The equation with gravity:
$v(t) = v_{0} + u \ln\frac{m_{0}}{m_{f}} - g t $
where $u$ is the effective exhaust velocity (a constant), $m_{0}$ and $m_{f}$ are the initial and final masses of the rocket, $g$ is gravity, $v_{0}$ is the initial velocity and $t$ is time.
So far I found this Integration of (Tsiolkovsky) rocket equation and many more like that, which helps me a lot, but does not consider external forces on the object.
I have been trying to do this on my own, but my math skills are not so great and every equation for '$x$' or 'height ' that I got resulted in some negative height, which is not possible.
My question is, what is the integral of the mentioned equation if we assume that $v_{0}$ does't equal zero, and gravity changes according to the following formula:
$$g = G \frac{m}{r^2}$$
where '$m$' is the mass of the earth, and '$r$' is the distance from the core of the earth. '$r$' is defined as the radius of earth + height of rocket.