This is the equation I'm having trouble with:

$$G \frac{M m}{r^2} = m \frac{d^2 r}{dt^2}$$

That's the non-vector form of the universal law of gravitation on the left and Newton's second law of motion on the right. I assume that upon correctly modeling and solving this, I will have a function of time that gives the distance from a spherical mass in space (e.g. distance from the Earth from an initial condition of $r(0) = 10,000 \mathrm{km}$).

However, WolframAlpha gives a hell of an answer, which leads me to believe that I'm modeling this equation completely wrong. Can anyone shed some light on this problem?

  • 1
    $\begingroup$ The correct equation is: $$ - \frac{G M m}{r^2} = \frac{M}{M+m} m \ddot r $$ $\endgroup$
    – Nick
    May 1, 2013 at 6:37

4 Answers 4


Yes you're modeling it wrong. Gravity is an attractive force, so if the mass is at r = 0, and r is nonnegative, then the gravity force should point towards zero, i.e. negative.

$$ - \frac{GMm}{r^2} = m\ddot r$$

(This assumes $m\ll M$ so we don't need to consider reduced mass. See the other answers for the more general case.)

But now Alpha even refuses to solve it. That's fine, because Mathematica can't solve many things. The usual approach is to notice that

$$ \frac{d^2r}{dt^2} = \frac{dv}{dt} = \frac{dv}{dr}\frac{dr}{dt} = v \frac{dv}{dr} $$

to convert that 2nd-order ODE to a 1st-order ODE:

$$ -GM \frac{dr}{r^2} = v \,dv $$

This gives the solution v(r).

$$ \frac{GM}r + \text{constant} = \frac{v^2}2 \qquad (*) $$

But recall $v = dr/dt$. So we have another 1st-order ODE to solve, which gives r(t). The solution should look like that “hell of answer” because of the square root.


Note: If you rearrange the terms you should see that Equation (*) is just conservation of energy.

  • $\begingroup$ The correct differential equation is: $ - \frac{G M m}{r^2} = \mu \ddot r $ where $ \mu = \frac{M m}{M+m} $ is the reduced mass. $\endgroup$
    – Nick
    May 6, 2013 at 17:15
  • $\begingroup$ Can you solve the final first order ODE too? I still can't find out the final r(t). $\endgroup$
    – Truth-seek
    Jan 3, 2018 at 17:22
  • $\begingroup$ @Truth-seek Rearrange the terms to get $\frac{dr}{ \sqrt{\frac{2GM}r + C}} = dt$. Now integrate both sides. $\endgroup$
    – kennytm
    Jan 3, 2018 at 17:39
  • $\begingroup$ It is exactly that integration I don't know to perform $\endgroup$
    – Truth-seek
    Jan 4, 2018 at 12:10
  • $\begingroup$ @Truth-seek Take out all the common factors until you get $\int \sqrt{\frac r{r+C}} dr$. Then substitute $r+C=s^2$. $\endgroup$
    – kennytm
    Jan 4, 2018 at 22:33

The correct differential equation is: $$ - \frac{G M m}{r^2} = \mu \ddot r $$ where $ \mu = \frac{M m}{M+m} $ is the reduced mass.

This can be simplified by dividing by $\mu$ $$ - \frac{G(M+m)}{r^2} =\ddot r $$

The problem can be further simplified by setting: $ G(M+m) $ equal to a constant, usually 1/2. $$ - \frac{1}{2} = r^2 \ddot r $$

This is a 2nd order quasilinear nonhomogenous ordinary differential equation. This equation is ill-formed, it does not have a unique solution. Adding initial or boundary conditions will lead to a unique particular solution.

Like the more general Kepler orbits, radial orbits can also be classified as elliptic, parabolic, or hyperbolic, corresponding to three forms of the particular solutions.

In the parabolic case, setting $ G(M+m) = 2/9 $, with initial conditions $ r(1)=1, \ \dot r(1)=2/3 \ $ leads to a simple solution:$$ t = r^{3/2} $$

In the elliptic case, setting $ G(M+m) = 1/2 $, with initial conditions $ r(\pi/2)=1, \ \dot r(\pi/2)=0 \ $, the particular solution is: $$ t = \arcsin(\sqrt{r})-\sqrt{r(1-r)} $$

In the hyperbolic case, setting $ G(M+m) = 1/2 $, with initial conditions $ t_0 = \sqrt{2}-\operatorname{arcsinh}(1)$, $ r(t_0)=1 $, $ \dot r(t_0)=\sqrt{2} $, the particular solution is:$$ t = \sqrt{r(1+r)} - \operatorname{arcsinh}(\sqrt{r}) $$


I think you are doing it all wrong. Your Newtonian gravitational force equation looks wrong to me in spherical coordinates.

Here's a different approach using Lagrangian and Hamiltonian approach. The solution is

$$\dfrac{\mathrm dr}{\mathrm dt}=\sqrt{\dfrac{2E}\mu-\dfrac{p_\phi^2}{\mu^2}\dfrac1{r^2}-\dfrac{2V(r)}\mu}$$


$$ V(r) = -\frac1r $$


If you model gravity correctly, that is with negative acceleration, the answer to this is very simple: is just the "CUBIC ROOT OF t SQUARED", up to suitable constants.

This solution describes Motion with Parabolic Velocity ( ie. zero speed at infinity ), the other two speeds are given by the general solution.

  • $\begingroup$ This solution extends to a one-parameter family by time invariance, but the general solution should have two parameters. $\endgroup$
    – Erick Wong
    Oct 2, 2012 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.