= Solution
Choose positive $\phi$ so the bob is displaced to the right relative to the cart. Its <Cartesian coordinates> are
$$
X=x+L\sin\phi,\qquad Y=-L\cos\phi.
$$
Differentiation gives $\dot X^2+\dot Y^2=\dot x^2+2L\cos\phi\,\dot x\dot\phi+L^2\dot\phi^2$. Thus the exact <kinetic energy> and <potential energy> are
$$
T=\frac12(m+M)\dot x^2+ML\cos\phi\,\dot x\dot\phi+\frac12ML^2\dot\phi^2,
\qquad V=\frac12kx^2+MgL(1-\cos\phi).
$$
Retain quadratic terms, using $\cos\phi=1+O(\phi^2)$ in the kinetic cross term and $1-\cos\phi=\phi^2/2+O(\phi^4)$ in the potential. The <Lagrangian> is
$$
\boxed{\mathcal L=\frac12(m+M)\dot x^2+ML\dot x\dot\phi+\frac12ML^2\dot\phi^2
-\frac12kx^2-\frac12MgL\phi^2}.
$$
Its <Euler-Lagrange equations> give
$$
\boxed{(m+M)\ddot x+ML\ddot\phi+kx=0,\qquad
ML\ddot x+ML^2\ddot\phi+MgL\phi=0}.
$$
The kinetic cross term is essential: acceleration of the support couples the pendulum and cart. These equations define the <normal modes of a spring-mounted pendulum cart>.
Back to article page