Skip to content
Henry Yip

The three-body problem

In the summer of 2024 I spent eight weeks on the gravitational three-body problem in the School of Physics and Astronomy at the University of Edinburgh, supervised by Prof. Jenni Smillie and funded by a Career Development Scholarship. The project had two aims: to reproduce and visualise important orbits, and to understand two landmark results, the proof that the figure-eight orbit exists and the convergence of Sundman’s series.

The full write-up is in the final report (PDF); its values of the parameter e for the two-centre orbits are wrong (see part 11 of the log), and its orbit search is rerun in part 10. I kept a research log while the project ran. One part became a short student journal paper on Euler’s problem of two fixed centres.

1The problem

Three point masses attract each other by Newtonian gravity:

\[m_i\,\ddot{\mathbf r}_i = \sum_{j\neq i} \frac{G m_i m_j\,(\mathbf r_j-\mathbf r_i)}{\lVert \mathbf r_j-\mathbf r_i\rVert^3}, \qquad i = 1, 2, 3.\]

For two bodies this reduces to one body moving in a central force, and the orbits are conic sections: Kepler’s ellipses, parabolas and hyperbolas. With three bodies there is no such reduction. The conserved quantities (energy, momentum and angular momentum) are not enough to pin down the motion, and many motions are chaotic: two starting points that differ by a tiny amount end up far apart.

Throughout this page the three masses are equal and I use units with \(G = m = 1\).

2A short history

Newton’s Principia (1687) treats the motion of the Moon under the pull of both the Earth and the Sun, the first three-body problem. Euler found solutions in 1767 in which the three bodies stay on a rotating straight line, and Lagrange found solutions in 1772 in which they stay at the corners of a rotating equilateral triangle. In 1887 Bruns showed that there are no further conserved quantities of a simple algebraic kind, and in 1890 Poincaré’s prize memoir for King Oscar II uncovered the extreme sensitivity to initial conditions that we now call chaos. Sundman found a power series in 1912 that solves the problem for all time (section 6).

Moore found the figure-eight orbit numerically in 1993, and Chenciner and Montgomery proved in 2000 that it exists (section 5). Šuvakov and Dmitrašinović found thirteen new families of periodic orbits in 2013, with names such as butterfly, moth and yin-yang, and Li and Liao found more than six hundred more in 2017.

3Symplectic integrators

Without a formula, the orbits have to be computed numerically. The simplest method, Euler’s, moves the positions and velocities forward along their current rates of change. It is easy to write, but the energy drifts steadily, so orbits slowly spiral outwards or inwards.

Gravity is a Hamiltonian system, with energy \(H = T(\mathbf p) + V(\mathbf q)\), and its time evolution preserves areas in phase space (it is a symplectic map). A symplectic integrator is a time step that preserves them too. Splitting each step into kicks, in which only the velocities change, and drifts, in which only the positions change, gives such steps automatically, because each piece is an exact Hamiltonian flow on its own:

\[\begin{aligned} \mathbf v &\leftarrow \mathbf v + c_k\,\Delta t\,\mathbf a(\mathbf x), \\ \mathbf x &\leftarrow \mathbf x + d_k\,\Delta t\,\mathbf v, \qquad k = 1, \ldots, s. \end{aligned}\]

One kick and one drift give symplectic Euler. With \(c = (\tfrac12, \tfrac12)\) and \(d = (1, 0)\) this is the velocity Verlet method. Ruth’s third-order scheme and Forest and Ruth’s fourth-order scheme use three and four stages with carefully chosen coefficients. A symplectic integrator does not conserve the energy exactly. What it conserves, up to an error that shrinks exponentially as the step is reduced, is a slightly modified Hamiltonian, so the energy error stays bounded instead of drifting. The classical fourth-order Runge–Kutta method is just as accurate per step but not symplectic, and its error keeps growing.

Energy error of five integrators on the figure-eight orbit

MethodLargest relative energy errorForce evaluations per unit time

Each method integrates twenty periods of the figure-eight from the same starting point. The two dashed methods are not symplectic, and their errors keep growing; the symplectic ones level off. Forest–Ruth costs four force evaluations per step, the same as Runge–Kutta, and at the default step its error is about eight times smaller.

4Periodic orbits

Most three-body motions are chaotic, but special starting points give orbits that repeat exactly. A family studied by Šuvakov and Dmitrašinović starts with the three bodies on a line, at \((-1, 0)\), \((1, 0)\) and \((0, 0)\), with velocities \((a, b)\), \((a, b)\) and \((-2a, -2b)\), so that the total momentum and the angular momentum are both zero. Different values of \((a, b)\) give the figure-eight, butterflies, moths and yin-yangs. Šuvakov and Dmitrašinović found them by scanning the \((a, b)\) plane for starting points whose motion comes back close to where it began.

The starting velocity also fixes the total energy. With \(G\) and the masses equal to 1, the outer bodies each have kinetic energy \(\tfrac12(a^2+b^2)\) and the middle one \(2(a^2+b^2)\), and the three pairs, at distances 2, 1 and 1, have potential energy \(-\tfrac12 - 1 - 1\). So

\[E = 3\left(a^2+b^2\right) - \tfrac52,\]

which is zero on the quarter circle \(a^2+b^2 = \tfrac56\), of radius 0.913, drawn dashed on the map below. Outside it, in the corner where the bodies start fastest, the energy is positive. That corner covers \(1-\tfrac{5\pi}{24}\), about 35 %, of the square \(0 \le a, b \le 1\). With positive energy the three bodies cannot stay together. Their moment of inertia about the centre of mass, \(I = \sum_i \lvert\mathbf r_i\rvert^2\), obeys the Lagrange–Jacobi identity \(\ddot I = 4E - 2V\), and the potential energy \(V\) is negative, so \(\ddot I > 4E > 0\). At the start \(I = 2\) and \(\dot I = 0\), so \(I > 2 + 2Et^2\): the bodies spread out without limit. Inside the arc they can stay together, but they need not, and the closer the energy is to zero, the more room they take. On average the potential energy is \(2E\) (the virial theorem), so the bodies are typically about \(3/(2\lvert E\rvert)\) apart: 1.2 for the figure-eight, whose starting speed \(\sqrt{a^2+b^2}\) is 0.64, but 2.6 at a starting speed of 0.8.

The last part of my project was a search of this family for “well-behaved” orbits. I varied \(a\) and \(b\) from 0 to 1, integrated each orbit with the fourth-order method and a fixed step of \(10^{-3}\) for 50 time units, and called an orbit well-behaved if its energy deviation, \((E_{\max}-E_{\min})/\lvert E_0\rvert\), stayed below 1. To save time, the code stopped a run as soon as two bodies were more than 5 apart and counted the orbit as not well-behaved. I also noticed that the well-behaved region around the figure-eight is wider along \(a\) than along \(b\).

In October 2026 I recovered the code and ran the search again. The rerun reproduces every point of Figures 28 and 29 in the report, and I added the checks the search was missing. The map below shows three views of the family:

The (a, b) family, and any orbit in it in three dimensions

Starting velocity: click or drag on the map
closest return, 3 (dim) to 0.001 (bright)a body escaped before t = 100not resolvedknown periodic orbitzero total energy
The orbit: drag to rotate
Starting velocity (a, b)
–
Time
–
Energy
–
Relative energy error
–
Closest return so far
–
Status
–
2024 test
–
Same limit of 5, accurate run
–
2024 run agrees with half the step
–

The maps are precomputed; switch between them above the map. Rings mark the sixteen orbits in Šuvakov and Dmitrašinović's table, the figure-eight among them; hover over a point to see its values in all three views. The chosen orbit is integrated live in your browser with the same method. At 1× it runs at 1.5 time units per second, so the figure-eight takes about four seconds per period. The space view shows the starting plane as a grid. The space–time view draws the motion in that plane with time running upwards, so each body traces one strand of a braid. The shape sphere keeps only the shape of the triangle (section 5).

Results of the 2024 test

Almost every verdict came from the stop at 5 apart rather than from the energy. 96.5 % of the grid fails that way, 0.2 % fails on the energy, and 3.3 % passes. To separate the stops that are real from those caused by the step, I ran the same test again with a step that shrinks during close encounters. The readout “Same limit of 5, accurate run” gives the result for any point.

Outside the dashed arc every orbit fails, as it must. Inside it 95 % fail, and for 57 % of these the accurate run also takes two bodies more than 5 apart. For the other 43 % the accurate run keeps all three bodies within 5 of each other until \(t = 50\), so those stops come from the step. They include all sixteen known orbits, whose bodies never get more than 2.8 apart, yet the 2024 run fails thirteen of them between \(t = 1.5\) and \(t = 12.5\), because a step of \(10^{-3}\) is too coarse at a close encounter and the error throws a body out. Only the figure-eight, Moth I and Moth II pass. Over the whole map, 70 % of the orbits fail for a real reason, 27 % because of the step, and 3 % pass.

The real stops also explain why the passes end well inside the arc, with none starting faster than 0.78. The limit of 5 is generous where the bodies are typically 1 apart, but not where they are typically 3 apart. In the accurate run, the share of orbits that stay within 5 falls from 80 % at starting speeds of 0.60 to 0.65 to 46 % at 0.70 to 0.75, 12 % at 0.75 to 0.80, and under 1 % beyond 0.80. With a limit of 10 the same fall comes between 0.75 and 0.85, and with 20 between 0.80 and 0.90. The edge of the passing region is therefore set mainly by the limit, and only close to the arc, where the size grows without bound, by the physics.

Inside the arc the test picks out orbits without close encounters, as the report suspected. In the orbits that pass, the smallest distance between two bodies over the 50 time units is typically 0.2. In the orbits that the 2024 run fails but the accurate run keeps within 5, it is typically \(10^{-4}\) and never more than 0.1. Orbits without close encounters are mostly stable, and most of the passes lie in one region around the figure-eight, the island that Figure 28 shows.

Of the orbits that pass, 98 % also stay within 5 in the accurate run and 69 % agree with the half-step run all the way to \(t = 50\), but 13 % disagree before \(t = 20\). A symplectic step keeps the energy close to constant even after the trajectory has drifted away from the true one, so the energy deviation alone cannot show this.

My 2024 observation about the figure-eight holds. Along the lines through it, the passing region spans \(a\) = 0.22 to 0.495 but only \(b\) = 0.525 to 0.545. The closest-return view shows the same long, thin island, with returns closer than 0.1 for \(a\) = 0.22 to 0.425 and \(b\) = 0.525 to 0.55.

The 2024 test therefore did two things at once. Where the bodies really fly apart, which is most of the map, it rightly fails the orbit. Among the rest, it measured where a fixed step of \(10^{-3}\) gets through 50 time units without a close encounter. This is not the same as well-behaved, because it rejects most of the known periodic orbits, but it did find the stable island around the figure-eight and its shape.

The closest-return map

Outside the dashed arc, 99.8 % of the orbits lose a body within 100 time units. The rest lie on the edges \(a = 0\) and \(b = 0\), where two bodies collide head-on and no integration can be trusted, or are marked as not resolved. Inside the arc, a third of the orbits lose a body. Fifteen of the sixteen known orbits fall on grid points that stay bound and come back to within 0.06 of their starting state. The goggles orbit lies in such a thin strip that its nearest grid point escapes. The figure-eight sits in a broad bright patch: it is stable, so starting points near it stay near it. Most of the others are unstable, and in the live view a small error grows until the orbit breaks apart. The goggles orbit loses a body after about 125 time units, and butterfly I after about 140.

The space–time view is how Moore found the figure-eight in 1993. Followed through time, three bodies in a plane trace a braid, and he looked, for each braid, for the orbit with the least action.

The slider pushes bodies 1 and 2 out of the plane in opposite directions. This gives the system angular momentum about an axis that lies in the plane, so the plane itself slowly turns over, as the space view shows. The push changes the side lengths of the triangle only at second order, so it changes the shape much less. For the figure-eight, a push of 0.01 keeps the path on the shape sphere within 0.05 of the unpushed one for about 140 time units; an in-plane push of the same size moves it that far within two. The figure-eight survives pushes of up to 0.1 for at least 300 time units. After a push of 0.2, one body escapes after about 120.

5The shape sphere and the figure-eight

Much of the motion of three bodies does not change the shape of the triangle they form: moving it around, rotating it, or scaling it up and down. Removing these leaves just the shape, and the possible shapes form a sphere, the shape sphere. Writing the positions as complex numbers \(x_1, x_2, x_3\) with their centre of mass at the origin, the Jacobi coordinates

\[z_1=\tfrac{1}{\sqrt2}\left(x_3-x_2\right), \qquad z_2=\sqrt{\tfrac23}\left(x_1-\tfrac12\left(x_2+x_3\right)\right)\]

map to a point on the unit sphere,

\[\left(u_1,\; u_2 + i u_3\right) = \frac{\left(\lvert z_1\rvert^2-\lvert z_2\rvert^2,\; 2\bar z_1 z_2\right)}{\lvert z_1\rvert^2+\lvert z_2\rvert^2}.\]

Collinear triangles make up the equator \(u_3 = 0\), with the three binary collisions on it, and the two equilateral triangles, one for each orientation, are the poles. On the sphere the figure-eight crosses the equator at the Euler configurations, where one body sits exactly midway between the other two, and passes over isosceles shapes in between.

Chenciner and Montgomery’s proof that the figure-eight exists works on this sphere:

  1. Minimise the action \(A = \int_0^{T} \left(\tfrac12 K + U\right) dt\), where \(K = \sum_i \lvert\dot{\mathbf r}_i\rvert^2\) is twice the kinetic energy and \(U\) the sum of the inverse distances, over paths from an Euler configuration to an isosceles configuration. The minimiser is one twelfth of the orbit.
  2. Show that the minimiser has no collisions: find a lower bound for the action of any path that contains a collision, and a collision-free test path whose action is smaller.
  3. Use the symmetries of the equal-mass problem to join twelve copies of this arc smoothly into one closed curve.
  4. Check that the result solves the equations of motion and traces a figure eight in the plane.

The figure-eight post in the research log goes through the steps in more detail.

6Sundman’s series

In 1912 Karl Sundman proved that as long as the total angular momentum is not zero, so that all three bodies cannot collide at once, the motion can be written as a power series that converges for all time. He removed the singularities of two-body collisions with a new time variable, then mapped the region where the solution is analytic onto the unit disc.

In principle this is a general solution, but it is of no practical use. For a simple case, Lagrange’s equilateral solution, my estimate in the research log is that following the motion to one decimal place, even for a short time, needs about \(10^{8\,000\,000}\) terms. The research log goes through the construction in part 1 and the estimate in part 2.

7Euler’s problem of two fixed centres

If two of the bodies are held in place and only the third moves, the problem becomes Euler’s problem of two fixed centres. Unlike the full problem it is integrable: in prolate spheroidal coordinates the motion separates, and besides the energy there is a second conserved quantity. Its orbits fall into three types: satellite orbits around one centre, planetary orbits around both, and lemniscate orbits that pass between them.

Reproducing these orbits with the symplectic integrator, and checking them against the two conserved quantities, became a short student journal paper, an early and exploratory piece of work. The research log covers the coordinates and the orbit types in part I, part II and part III.

8The visualisation, with Allison Lau

Allison Lau (University of Toronto) built an interactive website on top of the project. It plays sixteen periodic orbits, computed with the project’s symplectic integrators at orders one to four, so you can see how the lower-order methods distort an orbit, alongside their paths on the shape sphere.

The visualisation and its source code are online.

9References

  1. J. Barrow-Green, Poincaré and the Three Body Problem (American Mathematical Society, 1997).
  2. A. Chenciner and R. Montgomery, “A remarkable periodic solution of the three-body problem in the case of equal masses,” Ann. Math. 152, 881 (2000).
  3. E. Forest and R. D. Ruth, “Fourth-order symplectic integration,” Physica D 43, 105 (1990).
  4. E. Hairer, C. Lubich and G. Wanner, Geometric Numerical Integration, 2nd ed. (Springer, 2006).
  5. X. Li and S. Liao, “More than six hundred new families of Newtonian periodic planar collisionless three-body orbits,” Sci. China Phys. Mech. Astron. 60, 129511 (2017).
  6. C. Moore, “Braids in classical dynamics,” Phys. Rev. Lett. 70, 3675 (1993).
  7. D. Ó'Mathúna, Integrable Systems in Celestial Mechanics (Birkhäuser, 2008).
  8. R. D. Ruth, “A canonical integration technique,” IEEE Trans. Nucl. Sci. 30, 2669 (1983).
  9. K. F. Sundman, “Mémoire sur le problème des trois corps,” Acta Math. 36, 105 (1912).
  10. M. Šuvakov and V. Dmitrašinović, “Three classes of Newtonian three-body planar periodic orbits,” Phys. Rev. Lett. 110, 114301 (2013).
  11. H. Yip and J. M. Smillie, “An analysis of the restricted Euler problem using symplectic integrators,” Edinburgh Student Journal of Science 1(3) (2025).