Gravitational N-Body Problem
The gravitational N-body problem is the foundational dynamical problem of astrophysics: given point masses at positions , interacting only through their mutual Newtonian attraction, find their motion for all time. Each mass obeys — a set of coupled, nonlinear, second-order ordinary differential equations. Only the case admits a general closed-form solution, the elliptical, parabolic, and hyperbolic Kepler orbits. For Poincaré proved in the 1890s that no further single-valued analytic integrals beyond the classical ten exist, and that the phase space is threaded by homoclinic tangles — founding modern chaos theory. What decides the physics is not the force law but the number of bodies. When is small, every close encounter matters and the graininess of the gravitational field drives the evolution. When is enormous — a galaxy of stars — individual encounters are negligible over the age of the Universe, and the lumpy potential can be replaced by a single smooth mean field . That is the collisionless limit, and it legitimizes the whole smooth-potential machinery of galactic dynamics: the collisionless Boltzmann equation, Jeans' theorem, the Jeans equations. Between the extremes sit globular clusters and galactic nuclei (–), where two-body relaxation drives core collapse, mass segregation, and evaporation on cosmologically interesting timescales. This article is the hinge between celestial mechanics and stellar dynamics.
- The gravitational N-body problem seeks the trajectories of point masses coupled only by Newtonian gravity, governed by second-order ODEs — one line to write, unsolvable in closed form for .
- For it collapses to the exactly integrable Kepler problem; for Poincaré showed no general analytic solution exists and the motion is generically chaotic.
- Exactly ten classical integrals — energy, total momentum, center-of-mass drift, angular momentum — reduce the dimensionality but fall short of the needed to integrate the flow once .
- Two timescales decide everything: the crossing time and the two-body relaxation time , dominated by many distant weak encounters through the Coulomb logarithm .
- Galaxies () have yr, far longer than their age, so they behave as a smooth collisionless fluid; star clusters are genuinely collisional. The practical tool is numerical integration, with cost scaling from down to .
- Key idea: the character of an N-body system is fixed by the ratio of its two-body relaxation time to its age — when (galaxies) the discrete masses act as a smooth collisionless fluid in phase space; when (star clusters) individual encounters reshape the system.
The character of an N-body system is set by the ratio of its two-body relaxation time to its age: when (galaxies) the discrete masses behave as a smooth collisionless fluid; when (star clusters) individual encounters reshape the system.
Where this lives today
The N-body problem is now a computational science, spanning three bodies to trillions. At the small- end, mission designers exploit the chaotic manifolds of the restricted three-body problem — the same tangles Poincaré found — to route probes on almost no fuel, as the Genesis and GRAIL missions did. At intermediate , direct integrators such as Aarseth's NBODY6 follow globular clusters star by star through core collapse, binary hardening, and black-hole ejection — the physics of worked example 1. At the largest scale, cosmological simulations — Millennium, IllustrisTNG, trillion-particle runs on machines like Frontier — evolve dark matter as a collisionless N-body fluid using tree and particle-mesh solvers that cut the cost from to , and their halos are weighed with the same virial theorem that weighed Coma. The through-line is unbroken: because no pen can write for , the field advances by numerical integration and by statistical descriptions wherever permits.
The physical picture
Picture stars as points threading a shared potential well. To an excellent approximation each star's orbit is set by the smooth mass distribution of all the others — a mean field felt as a continuous force — and only occasionally does a near neighbour deliver a discrete kick. The subject is the competition between the smooth field, which conserves each star's orbital integrals, and these granular kicks, which slowly randomize them. The first figure separates the two: a rosette orbit in the smooth well, and a single deflecting encounter whose transverse impulse is .
The two-body problem is integrable because, in the center-of-mass frame, it has one relative coordinate and just enough conserved quantities — energy plus the angular-momentum vector — to lock the orbit into a closed conic. Add a third body and that closure is gone: too few isolating integrals remain, so trajectories wander over the energetically allowed region and nearby initial conditions diverge exponentially. The escape is statistical. Relaxation is a random walk in velocity: each distant star deflects the test star by a tiny angle, the deflections add incoherently, and the variance of the velocity change grows linearly with the number of encounters — it takes of order crossings for the accumulated change to rival the star's own speed. The second figure plots this ratio and shows why the same physics makes a globular cluster collisional and a galaxy collisionless.
The core equations
Because the potential is generated by the very bodies moving in it, the N-body problem is intrinsically nonlinear and self-gravitating — the source of the field is also its response. The equations of motion are Newton's second law for each body under the summed attraction of the rest.
where: — position vector of body ; — mass of body ; — Newton's gravitational constant, ; — number of bodies. These are coupled second-order ODEs; the excision removes the divergent self-force. Bundling the sum into a scalar potential gives the equivalent form with , and replacing that discrete by a smooth sourced through Poisson's equation is precisely the step that defines the collisionless limit. The system is conservative, so the total mechanical energy is a constant of the motion — the most robust classical integral and a stringent check on any numerical integrator.
where: — total mechanical energy (kinetic plus potential); the sum counts each interacting pair once. Energy conservation constrains the flow but cannot integrate it. The symmetries of the Newtonian action supply nine more conserved quantities alongside energy — the ten classical integrals, whose count is exactly why closes and does not.
where: — total linear momentum (3 integrals); — total angular momentum (3 integrals); — center of mass, giving 6 integrals jointly with . With these total ten — enough for but not . The dynamical clock of any stellar system is its crossing time — how long a typical star takes to traverse it once, the unit against which every slower process is measured.
where: — characteristic system size; — typical stellar speed; — total mass. The second form uses , so is essentially the free-fall time. The decisive quantity is the two-body relaxation time — how many crossings a star survives before the cumulative graininess of the potential randomizes its velocity; its ratio to the crossing time grows almost linearly with .
where: — time for accumulated encounters to deflect a star's velocity by order itself; — the Coulomb logarithm . The prefactor absorbs the and geometric factors. For a bound steady state, the time-averaged energies obey the scalar virial theorem — the most useful equilibrium relation in extragalactic astronomy, turning a velocity dispersion and a size into a mass.
where: — total kinetic energy in a steady bound state; — total gravitational potential energy. It follows that : a self-gravitating system in equilibrium is always bound and heats up when it loses energy (negative heat capacity). In the large- limit the discrete swarm becomes a phase-space fluid whose density is conserved along orbits in the smooth potential — the collisionless Boltzmann equation, gateway to galactic dynamics.
where: — phase-space distribution function; — smooth self-consistent potential from . The right-hand side is zero precisely because two-body encounters are negligible when .
The goal is to make concrete the claim that the same ten integrals which fully solve the two-body problem leave the three-body problem open. We separate the center-of-mass and relative motions and watch the integrals peel away the degrees of freedom until an integrable one-dimensional problem remains for — then repeat the count for and show the reduction stalls with too many degrees of freedom still coupled.
Step 1. Introduce the center of mass ; since is conserved it drifts uniformly and we work in its rest frame. Why: this uses 6 of the 10 integrals ( and ) to strip 6 of the 12 phase-space dimensions at a stroke.
Step 2. Form the relative coordinate ; the two equations combine into one effective one-body problem with reduced mass , the boxed equation. Why: the CM and relative motions decouple exactly for an inverse-square pair force, so the hard part is a single particle in a fixed central field.
Step 3. Conservation of confines the motion to a plane, and its magnitude eliminates via . Why: angular momentum flattens the problem to 2D and reduces the radial motion to a single coordinate in an effective potential.
Step 4. Energy conservation then gives , so follows from one quadrature and the orbit is a conic. Why: with and fixed the last degree of freedom is integrable by separation of variables — the problem is solved in closed form.
Step 5. For the same reductions (plus the ascending node) bring the phase space down to Poincaré's reduced problem, but no further single-valued analytic integral exists to close it. Why: too few isolating integrals leave the degrees of freedom coupled, the flow develops chaotic regions, and no closed-form can be written — Poincaré's non-integrability theorem.
Go deeper · Derivation B · 1 minFrom a single flyby to the relaxation time
The goal is to build the relaxation time from the ground up: compute the transverse kick one distant star gives a passing test star, add such kicks as an incoherent random walk over all impact parameters, extract the Coulomb logarithm, and set the accumulated velocity change equal to the star's own speed to read off how many crossings relaxation takes — the calculation that ultimately tells a galaxy from a globular cluster.
Step 1. For a nearly straight passage only the perpendicular force accumulates; integrating, . Why: the parallel force reverses across closest approach and cancels, so the net effect is the transverse impulse, and the integral evaluates to exactly .
Step 2. A single crossing brings the star past field stars near impact parameter ; since the kicks are random in direction they add in quadrature, so . Why: with but , velocity diffuses as a random walk — the variance grows, not the mean.
Step 3. The integral over contains ; with and this gives , and collecting factors per crossing. Why: each decade of impact parameter contributes equally, so distant weak encounters dominate and the result is only logarithmically sensitive to the cutoffs — the Coulomb logarithm.
Step 4. Relaxation is complete when the accumulated reaches ; dividing by the per-crossing value gives crossings, hence . Why: writing for a virialized system makes the -dependence explicit — the more bodies, the smoother the field, the longer relaxation takes. *The key results are: the integral and the scaling .*
Go deeper · Derivation C · 1 minThe virial theorem from the moment of inertia
The goal is to derive for a bound self-gravitating system directly from the equations of motion, by taking two time derivatives of the moment of inertia and time-averaging over a bounded orbit. The key move is that the homogeneity of the Newtonian potential lets the awkward collapse cleanly into the total potential energy .
Step 1. Define the moment of inertia , a positive scalar measuring the system's spatial extent. Why: its second derivative packages the kinetic and potential energies together, and its boundedness in equilibrium is what makes the theorem work.
Step 2. Differentiate twice: . Why: the first term is twice the kinetic energy; the second holds the gravitational virial.
Step 3. Insert the equations of motion and use the homogeneity of the potential (Euler's theorem, degree ): . Why: the pairwise force terms recombine so the double sum is exactly the total potential energy — special to the inverse-square law.
Step 4. Time-average: for a bound system stays bounded, so , leaving . Why: a bounded quantity has no persistent nonzero average second derivative, so the equilibrium condition falls out — and confirms the system is bound.
Limiting cases
The behaviour is governed almost entirely by and the ratio :
| Case | Result | Meaning |
|---|---|---|
| Two bodies | , integrable | Relative orbit is a Kepler conic; the ten classical integrals fully determine the motion. |
| Three bodies | , chaotic | No general closed-form solution; sensitive dependence on initial conditions (Poincaré); only special periodic families are known. |
| Collisional | Globular clusters, galactic nuclei (–): encounters drive core collapse, mass segregation, binary hardening, evaporation. | |
| Collisionless | Galaxies, dark-matter halos (): mean-field limit; use the collisionless Boltzmann equation and Jeans machinery. | |
| Cold / unstable | Velocity dispersion too small to support self-gravity; Jeans instability drives collapse and structure formation. |
Worked examples
1 · Is a globular cluster collisional? (fully worked)
A typical globular cluster has stars, a half-mass radius pc, and a velocity dispersion . Estimate its crossing and relaxation times, and decide whether two-body encounters matter over its -Gyr life.
Step 1. Crossing time. With and , ; converting () gives .
Step 2. Relaxation factor. With , the number of crossings to relax is .
Step 3. Relaxation time. Multiply: .
Step 4. Verdict. Since , the cluster has relaxed many times over, driving mass segregation, core collapse, and evaporation — it is genuinely collisional. By contrast, a galaxy's and yr give , so the very same physics leaves a galaxy collisionless.
2 · Weighing the Coma cluster with the virial theorem (fully worked)
Galaxies in the Coma cluster show a line-of-sight velocity dispersion over a radius . Use to estimate the cluster's dynamical mass, and compare with its luminous mass of a few .
Step 1. Turn the virial theorem into a mass. For a bound system with and gives , hence ; for an order-of-magnitude estimate we use .
Step 2. Insert numbers. With , , and : .
Step 3. Convert. Dividing by gives ; the structure factor () pushes the true virial mass toward .
Step 4. Interpret. The dynamical mass exceeds the luminous mass of a few by more than an order of magnitude. The galaxies move far too fast to be bound by the visible matter — exactly the discrepancy Zwicky found in 1933, the first dynamical evidence for dark matter, resting entirely on the N-body virial theorem.
Physics of the portrait
The N-body problem is where celestial mechanics turned into chaos theory. Its portrait belongs to the mathematician who proved that the three-body problem cannot be solved the way the two-body problem can — and who, in failing to solve it, discovered sensitive dependence on initial conditions.
Origins · 1 minHenri Poincaré and how this was discovered
Poincaré was the last universalist of mathematics, and the N-body problem was his proving ground. In 1887 King Oscar II of Sweden offered a prize for a solution to the -body problem — a proof of the stability of the Solar System. Poincaré's memoir won in 1889, but while the proofs were printing the editor Phragmén found an error. Correcting it, Poincaré discovered something far stranger than the stability he had sought: in the restricted three-body problem the stable and unstable manifolds of a periodic orbit intersect in a homoclinic tangle of such intricacy that "I shall not even try to draw it." Neighbouring trajectories diverge exponentially — deterministic yet unpredictable. He had found deterministic chaos, seventy years before Lorenz rediscovered it in a weather model. Along the way he proved that beyond the ten classical integrals the three-body problem admits no further single-valued analytic integrals, so the closed-form solution that works for cannot exist for . The modern N-body problem — attacked by numerical integration and statistical mechanics precisely because analytic solution is impossible — is the discipline Poincaré's negative result created.
Going further
Texts. Binney & Tremaine, Galactic Dynamics, 2nd ed., Ch. 1, 3, 4, 7 · Carroll & Ostlie, An Introduction to Modern Astrophysics, 2nd ed., Ch. 2, 25 · Aarseth, Gravitational N-Body Simulations (2003) · Heggie & Hut, The Gravitational Million-Body Problem (2003) · Mo, van den Bosch & White, Galaxy Formation and Evolution, Ch. 5 · Dodelson, Modern Cosmology (structure formation). The key checkable results in this article are: (1) the impulse integral giving ; (2) the scaling ; (3) the virial identity ; (4) the worked numbers Myr, Gyr for a globular cluster, and for Coma from .
Prerequisites. Gravitational Two-Body Problem · Distribution Function and Phase Space. Leads to. Collisionless Boltzmann Equation · Two-Body Relaxation Time · Virial Theorem in Stellar Systems · Jeans Equations.
Ask the tutor: Ask me to run the relaxation-time or virial-mass numbers for any real system and I will show you where it lands on the collisional-to-collisionless line.
Why can we solve the two-body problem exactly but not the three-body problem?
Both have the same ten classical integrals — energy, total momentum, center-of-mass motion, and angular momentum — but integrating a flow requires enough isolating integrals to reduce it to quadratures, roughly of them. For the ten suffice: they peel the twelve-dimensional phase space down to a single integrable radial equation, and the orbit is a conic. For the same ten leave too many coupled degrees of freedom, and Poincaré proved that no further single-valued analytic integral exists to close the gap. Worse, the phase space contains chaotic regions where trajectories diverge exponentially, so no closed-form solution can exist — not for lack of cleverness, but as a theorem.
If there is no solution, how do astronomers predict orbits at all?
By numerical integration. The equations of motion (1) are well-posed initial-value problems, so given positions and velocities now, a computer can step them forward as accurately as you like — solar-system ephemerides are computed this way over centuries. What Poincaré ruled out is a formula valid for all time, not step-by-step prediction. The catch is chaos: in chaotic regions small errors grow exponentially, so predictions have a finite horizon (a few tens of millions of years for the inner Solar System). For large , astronomers switch to statistical or fluid descriptions instead of tracking every orbit.
What is the Coulomb logarithm and why does it appear in a gravity problem?
The Coulomb logarithm is the factor you get when you add up the deflections a star suffers from encounters at all impact parameters . Because each encounter's squared kick scales as and the number of encounters at that scales as , the contributions go as , whose integral is a logarithm. It is called "Coulomb" because the same mathematics governs a charged particle scattering in a plasma. Its value is only logarithmically sensitive to the cutoffs, which is why order-of-magnitude estimates are robust.
What does "collisionless" mean if the stars never actually touch?
"Collision" here is a term of art: a two-body gravitational encounter strong enough to noticeably deflect a star's velocity, not a physical impact. Stars are so tiny compared with their separations that literal collisions essentially never happen. A system is collisionless when even these gravitational deflections are negligible over its lifetime — that is, when , so each star moves as if in a perfectly smooth potential. Galaxies are collisionless in exactly this sense; globular clusters are not.
How does the virial theorem let you weigh something you cannot put on a scale?
The relation says the kinetic energy (from the velocity dispersion ) balances the gravitational potential energy (from the mass and size ). Rearranged, — so if you measure how fast the members move (via Doppler shifts) and how big the system is (via angular size and distance), gravity itself hands you the mass, including any invisible matter. This is how Zwicky discovered dark matter in Coma in 1933 and how cluster masses are still estimated today, up to an order-unity structure factor that depends on the density profile and must be calibrated for precision work.
Why do N-body simulations "soften" gravity, and doesn't that change the physics?
Softening replaces with for a small length , capping the force at tiny separations. It is done for two reasons: to prevent numerical blow-ups when particles pass extremely close, and — more subtly — because each simulation particle represents an enormous number of real stars, so it should not scatter its neighbours the way a single point mass would. Softening deliberately suppresses spurious two-body relaxation to keep a collisionless system collisionless. For genuinely collisional systems like star clusters, where you want the encounters, you use un-softened direct integrators (NBODY6) instead. Choosing is thus a physics decision, not just a numerical convenience.