The two-body problem can be re-formulated as two one-body problems, a trivial one and one that involves solving for the motion of one particle in an external potential. Since many one-body problems can be solved exactly, the corresponding two-body problem can also be solved. By contrast, the three-body problem (and, more generally, the n-body problem for n ≥ 3) cannot be solved in terms of first integrals, except in special cases.
Let x1 and x2 be the vector positions of the two bodies, and m1 and m2 be their masses. The goal is to determine the trajectories x1(t) and x2(t) for all times t, given the initial positions x1(t = 0) and x2(t = 0) and the initial velocities v1(t = 0) and v2(t = 0).
When applied to the two masses, Newton's second law states that
where F12 is the force on mass 1 due to its interactions with mass 2, and F21 is the force on mass 2 due to its interactions with mass 1. The two dots on top of the x position vectors denote their second derivative with respect to time, or their acceleration vectors.
Adding and subtracting these two equations decouples them into two one-body problems, which can be solved independently. Adding equations (1) and (2) results in an equation describing the center of mass (barycenter) motion. By contrast, subtracting equation (2) from equation (1) results in an equation that describes how the vector r = x1 − x2 between the masses changes with time. The solutions of these independent one-body problems can be combined to obtain the solutions for the trajectories x1(t) and x2(t).