Solution (source code)

= Solution

In the inertial <centre of mass> frame, the <Lagrangian mechanics> description starts from <kinetic energy> minus <potential energy>:
$$
L=\frac12m_1|\dot{\mathbf r}_1|^2
+\frac12m_2|\dot{\mathbf r}_2|^2-V(|\mathbf r_1-\mathbf r_2|).
$$
Define the <two-particle relative coordinate> $\mathbf r=\mathbf r_1-\mathbf r_2$. The <centre of mass> condition gives
$$
m_1\mathbf r_1+m_2\mathbf r_2=0,
\qquad
\mathbf r_1=\frac{m_2}{m_1+m_2}\mathbf r,
\quad
\mathbf r_2=-\frac{m_1}{m_1+m_2}\mathbf r.
$$
Substitution therefore gives
$$
\boxed{L=\frac12\mu|\dot{\mathbf r}|^2-V(r),
\qquad\mu=\frac{m_1m_2}{m_1+m_2},\quad r=|\mathbf r|.}
$$
The <Euler-Lagrange equation> is simply $\mu\ddot{\mathbf r}=-\nabla V(r)$. Thus <center-of-mass reduction> turns a <two-body problem> into a one-particle <central force> problem with <reduced mass> $\mu$, reducing six position components to three relative components. In an arbitrary <inertial frame> one adds the independent <centre of mass> term $\tfrac12(m_1+m_2)|\dot{\mathbf R}|^2$; that free motion does not affect the relative solution. Since $V$ depends only on separation, <conservation of angular momentum> further confines a nonradial relative trajectory to a plane.