What is it?
Integrate the mutual gravity of bodies — planets, stars, dark-matter particles. Symplectic integrators (leapfrog) keep orbits stable for billions of steps; tree codes (Barnes–Hut) and FMM cut the cost from to or .
Formulas
The mathematics behind it
gravitating bodies give coupled first-order equations.
High-order RK is used for accurate short-term orbits; symplectic methods for long-term stability.
Symplectic integrators preserve phase-space volume (Liouville), which keeps long simulations physically plausible.
Three or more gravitating bodies are generically chaotic; long-term planetary predictions have finite horizons.
This page has the essentials. A fuller treatment (intuition, formal definition, worked example) is on the way.