I don't know how to start, but i will give you some context: Let's say that we have a body that we want to vertically propel at a distance of $h_f=10$ km of it's original spot considering that the altitude from which we trow it is $h_0=0$ and the radius of the earth is $R=6371$ km. So, we can obtain the initial gravitational acceleration experimented by the body of $g_0=9.81365 \frac{m}{s^2}$ . If we consider this initial gravitational acceleration is constant while the distance from the body to the center of gravity rises, then we can further calculate the initial velocity at which we have to throw the object to rise 10 km using the the law of conservation of energy obtaining: $$\frac{mv_0^2}{2}=m\cdot g_0 \cdot h_f \implies v_0\simeq{443}\frac{m}{s}$$
Now, the question comes: Let's say that we throw the same object with the same initial velocity, but consider that at the smallest time interval($\Delta t\to 0$) or at the most distance interval($\Delta d \to 0$), momentarily will stuck with the last, the gravitational acceleration changes because the body rises from its original spot and furthers from the earth, then what is the actual height that it reaches?
I made a program in which you establish the intended height to be reached with a constant gravitational acceleration from which to be calculated the initial speed of propulsion and a distance interval at which to take into account modifications in the gravitational acceleration to obtain the actual height reached with the same initial speed. Finally for the example I gave, I observed the smaller the distance at which the change in gravitational acceleration is taken into account, more specifically 0.1 m, the current height will tend to a value in our case to $10.015...$ km and something, $\approx 15$ m. I know that is insignificant for small speeds, but is there an actual formula for this case? I will let you some equations that i work with and if you want the code(c++) just ask me.
$$g \left( h_k \right) = g_0 \cdot \frac{\left( R+h_0 \right)^2}{{\left( R+h_k \right)^2}}= g_0 \cdot \frac{R^2}{\left( R+h_k \right)^2}$$ $$d_k = R + h_k$$ $$g_{average} = \frac{|v_f-v_0|}{t} = \frac{v_0}{t} \text{,} v_f = 0 \frac{m}{s} \text{(1)}$$ $$\left. \begin{array}{l} v_{average} = \frac{h_f - h_0}{t}\\ v_{average} = v_0 - g_{average} \cdot \frac{t}{2} \end{array} \right\} \implies \frac{v_0}{2} = \frac{h_f - h_0}{t} \implies h_f = \frac{v_0 \cdot t}{2} + h_0$$ $$A_{average} = \frac{g_f -g_0}{t} = \frac{g_0 \cdot \frac{d_0^2}{d_f^2} - g_0}{t} = \frac{g_0 \cdot \left( d_0^2-d_f^2 \right)}{d_f^2 \cdot t} \text{(average supraacceleration of gravitational acceleration)}$$ $$g_{average} = g_0 + a_{average} \cdot \frac{t}{2} = \frac{g_0 \cdot \left( d_0^2+d_f^2 \right)}{2 \cdot d_f^2} \text{(2)}$$ $$\text{Consider } h_k = h_0 + k \cdot \Delta d \implies d_k = d_0 + k \cdot \Delta d \text{ and } g_k = g_0 \cdot \frac{d_0^2}{d_k^2} \text{, where } n \cdot \Delta d = h_f \text{ .}$$ $$\frac{m \cdot v_0^2}{2} = m \cdot g_0 \cdot \Delta d + m \cdot g_1 \cdot \Delta d +\text{...}+ m \cdot g_{n-1} \cdot \Delta d \implies \frac{m \cdot v_0^2}{2} = m \cdot g_0 \cdot \Delta d \cdot d_0^2 \cdot \sum_{i=0}^{n-1} \frac{1}{\left( d_0 + i \cdot \Delta d \right)^2}$$
The problem is that I basically work with two unknowns, space and time and what i reach if I equal the first $g_{average} \text{(1)}$ with the second $g_{average} \text{(2)}$ and replace $h_f \text{ with }\frac{v_0 \cdot t}{2} + h_0$ and further make calculus i reach a cubic equation with the single unknown, t.
Only, hope that it's not a stupid question! Also, what happens if instead of taking into account the smallest space interval($\Delta d \to 0$) we take the smallest interval of time($\Delta t \to 0$)?