Lagrangian Mechanics
- Introductory Newtonian mechanics and multivariable calculus (program background)
- P.1.1 Waves & the Wave Equation
Lagrangian Mechanics
Newton tells you what happens at each instant: add up the forces, divide by the mass. Lagrange asks a stranger, deeper question: of all conceivable histories between two fixed moments, which one does nature actually choose? The answer — the path of stationary action — eliminates constraint forces, hands out conservation laws, and (as Feynman later showed) is the shadow of a quantum sum over every path at once. A cat stalking a sunbeam knew it all along.
Learning Objectives
After this lesson you will be able to:
- Reformulate mechanical problems in generalized coordinates, counting degrees of freedom and bypassing constraint forces.
- Derive the Euler–Lagrange equation from stationarity of the action via the calculus of variations.
- Construct Lagrangians and obtain equations of motion for the oscillator, the pendulum, and central potentials.
- Identify cyclic coordinates and extract conserved conjugate momenta — Noether's theorem in miniature.
- Explain why the action controls quantum amplitudes through the phase and the stationary-phase argument.
Intuition
Newtonian mechanics is local and forceful: at every instant, tally the forces and integrate. It works, but for constrained systems it makes you compute forces you never cared about — the tension in a pendulum rod, the normal force from a wire — just to eliminate them again.
The Lagrangian view is global and economical. Assign every conceivable path between fixed endpoints a single number, the action . The physical path is the one where is stationary: wiggling the path changes only at second order. Constraint forces never appear (they do no work along allowed motions), any convenient coordinates work, and symmetries hand you conservation laws. Quantum mechanics will explain why nature grades paths this way: every path contributes an amplitude of phase , and only near the stationary path do the phases agree and add up.
Theory
Newton in one paragraph
For a particle of mass , Newton's second law is . A force is conservative if for some potential ; then energy is conserved: $\frac{d}{dt}\big(\tfrac12 m\dot{\mathbf r}^2\big) = m\ddot{\mathbf r}\cdot\dot{\mathbf r} = -\nabla V\cdot\dot{\mathbf r} = -\frac{dV}{dt}\frac{d}{dt}(T + V) = 0$. This framework is complete in principle — the trouble is practical.
Where Newton gets awkward
A pendulum bob in Cartesian coordinates obeys , where the rod tension is an unknown constraint force: you must solve for it and then eliminate it, even though the motion is fully described by one angle . A bead on a bent wire is worse — the normal force changes direction along the wire. Newton forces you to (i) carry unknown constraint forces and (ii) work in coordinates that ignore the geometry. Both problems have one cure.
Generalized coordinates
A holonomic constraint is a relation among coordinates. A system of particles with independent holonomic constraints has degrees of freedom, and can be described by independent generalized coordinates — any variables that smoothly parametrize the allowed configurations: the pendulum's (), arc length along the wire, two angles for a double pendulum. Velocities are their time derivatives; the pair fixes the instantaneous state.
The action and the Euler–Lagrange equation
A functional assigns a number to a whole function. The action of a path between fixed endpoints , is
with the Lagrangian. Hamilton's principle: the physical path makes stationary, . To extract the consequence, deform the path: where is arbitrary and smooth with (endpoints pinned). Then is an ordinary function, and stationarity means for every . Differentiating under the integral with the chain rule,
Integrate the second term by parts:
so that
Now the fundamental lemma of the calculus of variations: if for every smooth vanishing at the endpoints, and is continuous, then . (If , continuity gives an interval where ; a smooth positive bump supported there makes the integral positive — contradiction.) Hence
one Euler–Lagrange equation per coordinate (for several , vary each independently).
Caution. In , the symbols and are independent slots of the function : differentiate treating as a variable in its own right, then evaluate along the trajectory. Only the outer is a total derivative along the motion. Conflating the two is the single most common Lagrangian error.
recovers Newton
For a particle in a conservative potential, take . Then and , so Euler–Lagrange gives — exactly . Hamilton's principle with is Newtonian mechanics, repackaged.
Caution. is not a law of nature. It holds for velocity-independent potentials; a charged particle in a magnetic field needs the generalized potential , and dissipative forces like friction have no Lagrangian at all. What survives universally is Hamilton's principle itself — with the appropriate .
Three worked systems
Harmonic oscillator. . Euler–Lagrange: , i.e. with ; solution .
Simple pendulum (length , mass ). One generalized coordinate : , , so and :
This is the exact equation — no rod tension ever appeared. For small angles and the pendulum is an oscillator with .
Particle in a central potential (plane polar coordinates ). With ,
The equation says is conserved — the angular momentum (this is Kepler's second law: equal areas in equal times). This conserved is the seed of the quantum theory of angular momentum in P.6.1.
Cyclic coordinates and conservation
Define the conjugate (canonical) momentum . If does not depend on some — a cyclic coordinate — Euler–Lagrange collapses to : the conjugate momentum of a cyclic coordinate is conserved. Free particle: cyclic, conserved. Central potential: cyclic, conserved. This is Noether's theorem in its simplest form — each continuous symmetry of (here, invariance under shifting ) produces a conservation law. In quantum mechanics the same logic returns as "observables commuting with the Hamiltonian are conserved" (1.1.3).
Why the action matters for quantum mechanics
Feynman's path-integral formulation of quantum mechanics (plain statement — the machinery comes much later): a quantum particle going from to takes every path, and each path contributes a complex amplitude of unit magnitude and phase ; the total amplitude is . When , the phase spins wildly as the path is deformed, and contributions from neighboring paths cancel — except near a path where is stationary, where nearby paths share the same phase and interfere constructively. Classical mechanics is the stationary-phase limit of quantum mechanics: Hamilton's principle is not an axiom but an interference pattern. Note has units of action (J·s) — it is precisely the scale that decides whether counts as "large". The waves being superposed here are amplitudes over paths, the same superposition logic as P.1.1.
Worked Examples
Example 1 — Atwood's machine
Masses kg and kg hang from an inextensible string over a massless, frictionless pulley. One degree of freedom: let be the downward displacement of (so rises by ). Then and , so
Hence m/s². The string tension — which Newton's approach must introduce and eliminate — never appeared. (If wanted afterwards: N.)
Example 2 — Bead on a uniformly rotating wire
A bead slides without friction on a straight horizontal wire forced to rotate at constant angular speed about a vertical axis. Using the distance from the axis, the bead's position is , so and : . Euler–Lagrange: , i.e. — the "centrifugal" term emerged automatically from the kinematics. With , : . For rad/s, m: m — the bead is flung outward. Its kinetic energy grows (the motor turning the wire does work): energy is not conserved here, a subtlety the Hamiltonian framework will diagnose cleanly in P.1.3.
Hands-on (Python)
import numpy as np
# --- The true path is stationary: discretized action for the oscillator ---
# m = k = 1, endpoints x(0) = 0, x(Tf) = 1 with Tf = 1 (< pi => a minimum).
# True solution of xdd = -x through these endpoints: x(t) = sin(t)/sin(1).
m = k = 1.0; Tf = 1.0; N = 2001
t = np.linspace(0.0, Tf, N); dt = t[1] - t[0]
def action(x):
v = np.diff(x)/dt # velocities on interval midpoints
xm = 0.5*(x[1:] + x[:-1]) # positions on interval midpoints
return np.sum(0.5*m*v**2 - 0.5*k*xm**2)*dt
x_true = np.sin(t)/np.sin(1.0)
S0 = action(x_true)
print(f"S_true = {S0:.4f}") # 0.3210 (analytic: sin(2)/(4 sin^2 1))
# one random smooth perturbation, exactly zero at both endpoints:
rng = np.random.default_rng(0)
modes = np.arange(1, 6)
eta = (rng.normal(size=5)[:, None]*np.sin(np.outer(modes, np.pi*t/Tf))).sum(0)
for eps in (0.01, 0.05, 0.10, 0.20):
dS = action(x_true + eps*eta) - S0
print(f"eps = {eps:4.2f} S - S_true = {dS:+.6f} dS/eps^2 = {dS/eps**2:.3f}")
# Expected: every dS > 0 and dS/eps^2 = 27.268 for ALL eps -- the first-order
# variation vanishes identically: the true path is stationary (here a minimum).import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
# --- Full pendulum vs small-angle solution ---
g, ell = 9.81, 1.0
w0 = np.sqrt(g/ell) # small-angle frequency, period 2.006 s
rhs = lambda t, y: [y[1], -(g/ell)*np.sin(y[0])]
t = np.linspace(0, 10, 2000)
fig, axes = plt.subplots(2, 1, figsize=(8, 6))
for th0, ax in zip((0.10, 2.50), axes):
sol = solve_ivp(rhs, (0, 10), [th0, 0.0], t_eval=t, rtol=1e-9)
ax.plot(t, sol.y[0], label="exact")
ax.plot(t, th0*np.cos(w0*t), "--", label="small-angle")
ax.set(title=f"theta0 = {th0} rad", ylabel="theta (rad)"); ax.legend()
axes[1].set_xlabel("t (s)"); plt.tight_layout(); plt.show()
# Expected: theta0 = 0.10 -> the two curves are indistinguishable.
# theta0 = 2.50 -> exact period ~ 3.29 s (elliptic integral), so the exact
# curve drifts steadily out of phase with the 2.006 s small-angle cosine.Exercises
E1 (easy). Write the Lagrangian of a projectile in a vertical plane, , derive both equations of motion, and identify the conserved momentum.
Solution
Euler–Lagrange: and , i.e. , — projectile motion. is cyclic, so is conserved (horizontal translation symmetry).
E2 (easy). A mass hangs from a vertical spring; let be the downward displacement from the spring's natural length, so . Find the motion.
Solution
Euler–Lagrange: . Substituting : — simple harmonic motion at about the shifted equilibrium . Gravity relocates the center of oscillation but leaves the frequency alone.
E3 (medium). Show that for any smooth yields the same Euler–Lagrange equations as .
Solution
. The added term depends only on the fixed endpoints, so it is the same constant for every admissible path: , and the stationary paths — hence the equations of motion — coincide. The Lagrangian of a given system is therefore not unique (a "gauge" freedom).
E4 (medium). Use the Euler–Lagrange equation to prove the shortest path between two points in a plane is a straight line, starting from the arc-length functional .
Solution
Here plays "time" and has no explicit : is cyclic, so is constant. That forces , i.e. — a straight line. The variational machinery is indifferent to what the independent variable means physically.
E5 (hard). A block of mass slides on the frictionless face (angle ) of a wedge of mass that itself slides on a frictionless floor. Find the accelerations of both.
Solution
Coordinates: wedge position ; block displacement down the incline. The block's position is , so
is cyclic: (total horizontal momentum), so . The equation: . Substituting :
Checks: gives , ✓. For kg, kg, : m/s², m/s². Two Newtonian constraint forces (normal forces on two surfaces) were never computed.
Checkpoint
- What is a generalized coordinate, and which two Newtonian headaches does it cure?
- Sketch the derivation of the Euler–Lagrange equation. Where exactly is used?
- When is valid, and what is a standard counterexample?
- What is a cyclic coordinate, and what conservation law follows? Give two examples.
- In the path-integral picture, why do classical paths dominate when ?
Answers
- Any variable smoothly parametrizing allowed configurations (one per degree of freedom). It eliminates constraint forces and lets you work in coordinates adapted to the geometry.
- Perturb , expand to first order, integrate the term by parts, and invoke the fundamental lemma. The endpoint conditions kill the boundary term from the integration by parts.
- For velocity-independent (conservative) potentials. Counterexample: magnetic forces, which need ; friction has no Lagrangian.
- A coordinate absent from ; its conjugate momentum is conserved. Free particle ( → linear momentum); central potential ( → angular momentum ).
- Each path contributes ; away from stationary points of the phase varies rapidly between neighboring paths and contributions cancel, while paths near the stationary (classical) one share a phase and add constructively.
Further Reading
- [Gold] Goldstein, Poole & Safko, Ch. 1–2 — constraints, generalized coordinates, and variational principles; the definitive treatment.
- [Sha] Shankar, §2.1 — the principle of least action, written with quantization in mind.
- [Sak] Sakurai & Napolitano, §2.6 — propagators and Feynman path integrals: made precise.
← Prev: Waves & the Wave Equation · Up: Pre-Term · Next: Hamiltonian Mechanics →