The first thing to do here to solve this equation is to note that, since the powers of
which implies
Then
and after a little simplifying our equation becomes
Now we want to integrate this equation to find
Crossing out the
If it weren't for the shift by
Let's check that this works: we get
Expanding everything out and solving for
Now that we have our solution for
We did it! This is the equation for the curve that's traced out by the planet as it travels around in its orbit. What does it look like? You can see the shape of the curve in this animation, by dragging the slider that controls the value of
Let's focus on the ellipse case, which is the generic situation for an orbiting planet like our own. To see that this equation describes an ellipse, let's go back to
Now square both sides, and switch to
With a little rearranging we can put this into the standard form of an ellipse like so:
where
For
Note that the star, at the origin, is a focus of the ellipse, not the center.
This picture is actually quite exaggerated as far as the orbits of the planets in our solar system are concerned (beyond just the fact that the Earth is much, much smaller compared to the sun than what I've drawn here would suggest). The eccentricity
The orbit of Halley's comet, by contrast, is about
So there we have it! With really not all that much work at all considering the huge significance of the result, we've derived the shape
Finally, you should know that Newton's inverse-square law is not the last word on gravity. It's very effective for predicting the orbit of a planet relatively far from a star, but it's less accurate when gravity gets stronger. For Mercury—the closest planet to the Sun in our solar system—the orbit is not a perfect elliptical loop. It precesses ever so slightly, meaning that the perihelion occurs at a slightly different angle with each revolution around the Sun.
The precession of Mercury is explained by Einstein's theory of gravity—general relativity—which extends and supersedes Newton's inverse-square law. And Einstein's theory will in turn one day be supplanted by a quantum theory of gravity, which is a mystery that physicists have been trying to unravel for a century.
See also:
The Trick That Makes Understanding Physics as Simple as Drawing a Picture: Physics Help Room
The Shortcut that Lets You Write Down the Orbit of a Planet in One Line: Physics Mini Lesson
If you encounter any errors on this page, please let me know at feedback@PhysicsWithElliot.com.