Lagrangian Mechanics in Action
We now have the whole machine assembled: pick
generalised
coordinates, write the Lagrangian L = T - V, and turn the
Euler–Lagrange
crank. This page is where it earns its keep. We will solve four classic problems — a pendulum, a
bead on a wire, Atwood's machine, and a mass in polar coordinates — and in every one the same
recipe cuts through geometry that would tie a Newtonian force-diagram in knots. Watch how
constraints and awkward coordinates simply stop being a problem.
- 1. Coordinates. Choose one generalised coordinate per degree of freedom.
- 2. Energies. Write the kinetic energy T and the
potential energy V in those coordinates.
- 3. Lagrangian. Form L = T - V.
- 4. Crank. Apply
\frac{d}{dt}\!\left(\frac{\partial L}{\partial \dot q}\right) - \frac{\partial L}{\partial q} = 0
for each coordinate.
Example 1 — the simple pendulum
A bob of mass m on a rigid rod of length \ell,
swinging in a vertical plane. One degree of freedom, so one coordinate: the angle
\theta from the downward vertical.
Energies. The bob moves on a circle of radius \ell, so
its speed is v = \ell\dot\theta and
T = \tfrac12 m\ell^2\dot\theta^2. Measuring height from the pivot, the
bob sits at height -\ell\cos\theta, so
V = -mg\ell\cos\theta. Therefore
L = \tfrac12 m\ell^2\dot\theta^2 + mg\ell\cos\theta.
Crank. The two pieces are
\dfrac{\partial L}{\partial \dot\theta} = m\ell^2\dot\theta and
\dfrac{\partial L}{\partial \theta} = -mg\ell\sin\theta. The
Euler–Lagrange equation gives
m\ell^2\ddot\theta + mg\ell\sin\theta = 0 \quad\Longrightarrow\quad \ddot\theta = -\frac{g}{\ell}\sin\theta.
The equation of motion — and the rod's tension never appeared. For small swings
\sin\theta \approx \theta, so
\ddot\theta \approx -(g/\ell)\theta: simple harmonic motion with angular
frequency \omega = \sqrt{g/\ell} and period
T = 2\pi\sqrt{\ell/g}. Newton would have made us resolve gravity along
and across the rod first; here the geometry did that for us the moment we wrote
v = \ell\dot\theta.
Example 2 — a bead on a wire
Thread a bead of mass m onto a fixed frictionless wire bent into the
shape y = f(x) in a vertical plane. The wire is a constraint, leaving
one degree of freedom; take x as the coordinate.
Energies. As the bead moves, y = f(x) forces
\dot y = f'(x)\,\dot x, so its speed-squared is
\dot x^2 + \dot y^2 = \big(1 + f'(x)^2\big)\dot x^2. Hence
T = \tfrac12 m\big(1 + f'(x)^2\big)\dot x^2, \qquad V = mg\,f(x),
L = \tfrac12 m\big(1 + f'(x)^2\big)\dot x^2 - mg\,f(x).
The single coordinate x already knows the bead can only live on the
wire — the constraint is built in, and the wire's normal reaction force (which does no work) never
enters. Turning the crank yields the bead's equation of motion directly. Try it with a parabolic
wire f(x) = \tfrac12 a x^2: for small x you
recover harmonic motion, a bead rocking in the bottom of a valley.
Example 3 — Atwood's machine
Two masses m_1 and m_2 hang from a light
inextensible string over a frictionless pulley. The string ties them together — one degree of
freedom. Let x be how far mass 1 has descended; then mass 2 has
risen by x, and both move with speed
\dot x.
Energies. Both masses share the speed \dot x, so
T = \tfrac12(m_1 + m_2)\dot x^2. Taking heights from the pulley, the
potential energy is V = -m_1 g x + m_2 g x = -(m_1 - m_2)g x. Thus
L = \tfrac12 (m_1 + m_2)\dot x^2 + (m_1 - m_2)g x.
Crank. Here
\dfrac{\partial L}{\partial \dot x} = (m_1 + m_2)\dot x and
\dfrac{\partial L}{\partial x} = (m_1 - m_2)g, so the Euler–Lagrange
equation gives
(m_1 + m_2)\ddot x = (m_1 - m_2)g \quad\Longrightarrow\quad \ddot x = \frac{m_1 - m_2}{m_1 + m_2}\,g.
The famous Atwood acceleration — the whole system accelerates gently if the masses are nearly equal.
Notice there was no tension to solve for: Newton needs two force equations plus the
string constraint to eliminate the tension, whereas the Lagrangian handled the constraint the
instant we wrote both speeds as \dot x.
Example 4 — a mass in polar coordinates
This is the example that shows off the method's real power, because polar coordinates are exactly
where Newton's F = ma gets ugly. A particle of mass
m moves in a plane; use polar coordinates
(r, \theta). The velocity has two pieces: a radial part
\dot r (moving in or out) and a tangential part
r\dot\theta (swinging around). Drag the sliders to see them.
Because the two components are perpendicular, Pythagoras gives the speed-squared, and the kinetic
energy is
T = \tfrac12 m\big(\dot r^2 + r^2\dot\theta^2\big).
For a central potential V(r) (depending only on distance, as gravity and
the Coulomb force do), L = \tfrac12 m(\dot r^2 + r^2\dot\theta^2) - V(r).
The \theta equation is a gift: \theta is
cyclic (it does not appear in L, only
\dot\theta does), so its conjugate momentum is conserved —
\frac{\partial L}{\partial \dot\theta} = m r^2\dot\theta = \text{constant}.
That constant is the angular momentum, and its conservation is Kepler's second law
(equal areas in equal times) dropping out for free. The r equation,
meanwhile, produces
m\ddot r = m r\dot\theta^2 - V'(r) — and there is the
m r\dot\theta^2 "centrifugal" term, generated automatically by
\partial L/\partial r, with no hand-waving about fictitious forces.
The commonest mistake when switching to Lagrangian mechanics is to keep one foot in the Newtonian
world — drawing tensions, normal reactions and centrifugal forces and trying to feed them in. Don't.
Constraint forces that do no work (rod tension, the wire's normal reaction, the string in
Atwood's machine) must never appear in L. The whole point is
that a well-chosen coordinate already respects the constraint, so those forces are silently and
correctly accounted for by their absence.
Likewise, do not add a centrifugal or Coriolis term "by hand" in polar or rotating coordinates —
that is double counting. Write T honestly in your chosen coordinates
(for polar, \tfrac12 m(\dot r^2 + r^2\dot\theta^2)) and the Euler–Lagrange
derivatives manufacture every one of those terms for you. Put in only energies; let the
crank produce the forces.
Occasionally, yes. If you actually need the constraint force — the tension in a cable you
are checking won't snap, or the normal force to know when a bead flies off a track — the plain
Lagrangian hides exactly the thing you want, because it was designed to. Then you either return to
Newton for that one force, or reach for the more advanced method of
Lagrange multipliers, which keeps the constraint explicit and hands you its force
as the multiplier. And for genuinely non-holonomic systems (the rolling coin), the basic
recipe does not apply unchanged. For the vast majority of holonomic problems, though — anything with
rods, wires, pulleys and awkward coordinates — Lagrange is simply the faster, cleaner road.