= Solution
Take positive $\theta$ toward positive $x$ from the downward vertical, as in the source diagram. The mass has position and velocity
$$
\mathbf r=(a_x+l\sin\theta,\ a_y-l\cos\theta,0),\qquad
\dot{\mathbf r}=(\dot a_x+l\dot\theta\cos\theta,\ \dot a_y+l\dot\theta\sin\theta,0).
$$
Thus $T=m|\dot{\mathbf r}|^2/2$ and $V=mg(a_y-l\cos\theta)$. Expanding the squared speed gives
$$
\boxed{L=\frac m2\left[\dot a_x^2+\dot a_y^2+l^2\dot\theta^2
+2l\dot\theta(\dot a_x\cos\theta+\dot a_y\sin\theta)\right]
-mg(a_y-l\cos\theta).}
$$
The prescribed support coordinates are functions of time, rather than additional dynamical variables. Terms depending only on time do not affect the <Euler-Lagrange equation> for $\theta$, but have been retained here to obtain the inertial-frame kinetic and <potential energies> directly.
Back to article page