Rewriting Newton's laws in terms of energy and generalized coordinates: the principle of stationary action, the Euler–Lagrange and Hamilton equations, and how symmetries force conservation laws.
IntuitionFrom forces to a single scalar: the idea of least action
Newton's second law F=ma needs one vector equation per particle, in whatever coordinates make the forces easy to write down — awkward for a pendulum, where the string tension is a constraint force we would rather not compute at all. Lagrangian mechanics replaces force bookkeeping with a single scalar, the Lagrangian L=T−V (kinetic minus potential energy), written in whatever coordinates describe the system's genuine freedom to move — its generalized coordinates. Nature, remarkably, behaves as if it makes stationary the accumulated value of L over time: the action.
A point on the unit circle at angle theta measured from the bottom (downward vertical), representing the bob of a pendulum of length ℓ hanging at angle θ from straight down.
A pendulum of length ℓ swinging to angle θ from the vertical. One number, θ, is enough to describe the pendulum's position — that is its generalized coordinate.
UndergraduateGeneralized coordinates and the Lagrangian
Definition: Generalized coordinates and the Lagrangian
For a system whose configuration is described by coordinates q=(q1,…,qn) (which need not be Cartesian — an angle, an arc length, anything that fixes the configuration), the Lagrangian is L(q,q˙,t)=T(q,q˙)−V(q), kinetic energy minus potential energy, both expressed in terms of q and the generalized velocities q˙.
The action of a path q(t) from time t1 to t2 is S[q]=∫t1t2L(q(t),q˙(t),t)dt. Hamilton's principle (the principle of stationary action) says: the path the system actually follows makes S stationary among all paths with the same endpoints.
A path q(t) makes the action S[q]=∫t1t2L(q,q˙,t)dt stationary, with fixed endpoints, if and only if, for every coordinate qk, dtd∂q˙k∂L−∂qk∂L=0.
Why is it true?
Perturb the path by q(t)+ϵη(t) with η(t1)=η(t2)=0 and require dϵdS[q+ϵη]ϵ=0=0 for every such η. Expanding to first order in ϵ and integrating the η˙ term by parts (the boundary term vanishes because η(t1)=η(t2)=0) leaves ∫(∂qk∂L−dtd∂q˙k∂L)ηkdt=0 for every η, which forces the bracket to vanish identically.
Proof
Step 1 (set up the variation). Let q(t) be the true path and perturb it by q(t)+ϵη(t) for a small parameter ϵ, where η(t) is an arbitrary smooth function satisfying η(t1)=η(t2)=0 so the perturbed path shares the same endpoints as q(t). Hamilton's principle requires S[q+ϵη] to be stationary at ϵ=0 for every admissible η, i.e. dϵdS[q+ϵη]ϵ=0=0.
Step 2 (differentiate under the integral). Differentiating S[q+ϵη]=∫t1t2L(q+ϵη,q˙+ϵη˙,t)dt with respect to ϵ and setting ϵ=0 gives, by the chain rule applied term by term, dϵdS[q+ϵη]ϵ=0=∫t1t2k∑(∂qk∂Lηk+∂q˙k∂Lη˙k)dt
**Step 3 (integrate the η˙k term by parts).** For each k, integration by parts turns ∫t1t2∂q˙k∂Lη˙kdt into a boundary term minus a bulk term: ∫t1t2∂q˙k∂Lη˙kdt=[∂q˙k∂Lηk]t1t2−∫t1t2dtd(∂q˙k∂L)ηkdt
Step 4 (the boundary term vanishes). Because [∂q˙k∂Lηk]t1t2=0 by the fixed-endpoint condition η(t1)=η(t2)=0, only the bulk integral survives, and substituting back into Step 2 gives ∫t1t2k∑(∂qk∂L−dtd∂q˙k∂L)ηk(t)dt=0
Step 5 (fundamental lemma of the calculus of variations). This integral vanishes for every smooth ηk vanishing at the endpoints. If the bracket ∂qk∂L−dtd∂q˙k∂L were nonzero and continuous at some interior point t0, it would keep a fixed sign on some small interval around t0; choosing ηk to be a smooth bump function supported on that interval (positive where the bracket is positive, and zero elsewhere) would make the integral strictly nonzero, a contradiction. Hence the bracket must vanish identically, giving dtd∂q˙k∂L−∂qk∂L=0 for every k — the Euler–Lagrange equation.
Example: The pendulum, the Lagrangian way
A bob of mass m hangs from a rigid, massless rod of length ℓ in a uniform gravitational field g, free to swing in a vertical plane; θ is the angle from the downward vertical.
Solution
Position: x=ℓsinθ, y=−ℓcosθ, so x˙2+y˙2=ℓ2θ˙2. Kinetic energy T=21mℓ2θ˙2; potential energy (measuring from the pivot) V=−mgℓcosθ. So L=21mℓ2θ˙2+mgℓcosθ. Euler–Lagrange: dtd(mℓ2θ˙)−(−mgℓsinθ)=0, i.e. θ¨+ℓgsinθ=0 — the pendulum equation, obtained without ever computing the string tension.
If a system's Lagrangian does not change under some continuous transformation of the coordinates — a symmetry — something is conserved along every actual trajectory. Rotating a system with no preferred direction does not change its Lagrangian, and that symmetry is exactly why angular momentum is conserved for such a system; likewise a Lagrangian with no explicit time-dependence has time-translation symmetry, which is exactly why energy is conserved.
If the Lagrangian L is invariant under a continuous one-parameter family of transformations qk↦qk(s), qk(0)=qk, then the quantity I=∑k∂q˙k∂Ldsdqk(s)s=0 is conserved along every solution of the Euler–Lagrange equations.
Why is it true?
Differentiating L(q(s),q˙(s),t)=L(q,q˙,t) (invariance) with respect to s at s=0 and using the Euler–Lagrange equations to rewrite ∂L/∂qk as dtd(∂L/∂q˙k) turns the result into dtd∑k∂q˙k∂L∂s∂qk=0: exactly the statement that I has zero time derivative, i.e. is conserved.
Proof
Step 1 (differentiate the invariance identity). Invariance of L under the transformation means L(q(s),q˙(s),t)=L(q,q˙,t) holds identically in s. Differentiating both sides with respect to s and evaluating at s=0 (using qk(0)=qk) gives, by the chain rule, k∑(∂qk∂L∂s∂qk+∂q˙k∂L∂s∂q˙k)s=0=0
Step 2 (use the Euler–Lagrange equation on the actual trajectory). Because q(t) solves the Euler–Lagrange equations, ∂qk∂L=dtd∂q˙k∂L. Substituting this into the first term of Step 1 replaces ∂L/∂qk by a total time derivative.
**Step 3 (commute the s- and t-derivatives).** Since s and t are independent variables, mixed partial derivatives of qk(s,t) commute: ∂s∂q˙k=dtd∂s∂qk. This lets the second term of Step 1 be rewritten with a total time derivative as well.
Step 4 (recognize a total derivative). With both terms now built from dtd(⋅), the product rule runs in reverse: dtd∂q˙k∂L⋅∂s∂qk+∂q˙k∂L⋅dtd∂s∂qk=dtd(∂q˙k∂L∂s∂qk). Substituting into the identity of Step 1 collapses it to a single total time derivative equal to zero: dtdI=dtdk∑∂q˙k∂L∂s∂qks=0=0
Step 5 (conclude conservation). A quantity whose time derivative vanishes identically along every solution of the equations of motion is constant along that solution. Hence I=∑k∂q˙k∂L∂s∂qks=0 is conserved, which is Noether's theorem.
Example: Time invariance gives energy
If L does not depend explicitly on t (time-translation symmetry), Noether's theorem, with s playing the role of a time shift, gives the conserved quantity H=∑kq˙k∂q˙k∂L−L — for the systems considered here, exactly the total mechanical energy T+V.
Solution
Step 1 (pick the symmetry). Time-translation is the one-parameter family qk(s)=qk(t+s), i.e. shifting every point of the trajectory forward by s; since L has no explicit t-dependence, L(q(t+s),q˙(t+s))=L(q(t),q˙(t)) along the true motion, so this transformation leaves L invariant in the sense Noether's theorem requires.
Step 2 (compute the generator). Differentiating qk(t+s) with respect to s at s=0 just gives back the velocity: ∂s∂qks=0=q˙k.
Step 3 (plug into Noether's conserved quantity). Noether's theorem gives the conserved quantity I=∑k∂q˙k∂L∂s∂qks=0; substituting Step 2, I=∑k∂q˙k∂Lq˙k.
Step 4 (identify it as the Hamiltonian). Using the generalized momentum pk=∂L/∂q˙k, this conserved I is exactly H=∑kpkq˙k−L, i.e. H=∑kq˙k∂q˙k∂L−L. For the mechanical systems here, L=T−V with T quadratic in q˙, so ∑kq˙k∂L/∂q˙k=2T and H=2T−(T−V)=T+V: total mechanical energy is conserved precisely because the Lagrangian does not depend explicitly on time.
AdvancedPhase space: Hamilton's equations
Definition: Generalized momentum and the Hamiltonian
The generalized momentum conjugate to qk is pk=∂L/∂q˙k. Replacing the velocities q˙ by the momenta p (a Legendre transform) gives the HamiltonianH(q,p,t)=∑kpkq˙k−L, interpreted, for the systems considered here, as the total energy expressed in terms of position and momentum instead of position and velocity.
q˙k=∂pk∂H,p˙k=−∂qk∂H
These are Hamilton's equations: 2n first-order equations replacing the n second-order Euler–Lagrange equations. A solution traces a curve through phase space, the 2n-dimensional space of pairs (q,p); every point of phase space fixes the entire future (and past) of the system.
A saddle-shaped surface representing a potential energy landscape, curving upward along one horizontal axis (a stable direction) and downward along the perpendicular axis (an unstable direction), meeting at a flat saddle point in the middle that is an equilibrium but not an energy minimum.
A potential energy surface shaped like z=x2−y2: stable (bowl-like) along one direction, unstable along the other. The flat point at the centre is an equilibrium of the system, but not a minimum of the energy — small pushes in the unstable direction grow.
Let a region of phase space evolve under Hamilton's equations, each point (q(t),p(t)) following its own trajectory. Then the volume of the region, with respect to the standard measure dqdp on phase space, is the same at every time t.
Why is it true?
The phase-space velocity field (q˙,p˙)=(∂H/∂p,−∂H/∂q) is divergence-free: ∑k(∂qk∂q˙k+∂pk∂p˙k)=∑k(∂qk∂pk∂2H−∂pk∂qk∂2H)=0, because mixed partial derivatives commute. A divergence-free flow preserves volume, by the same reasoning as the divergence theorem for an incompressible fluid.
Proof
Step 1 (the phase-space flow). Hamilton's equations (q˙,p˙)=(∂p∂H,−∂q∂H) define a velocity field on phase space; every point (q,p) moves along this field, so a region Ω(t1) is carried by the flow to a region Ω(t2). The Reynolds transport theorem gives the rate of change of the enclosed volume V(t)=∫Ω(t)dqdp as the flux of the divergence: dtdV(t)=∫Ω(t)∇⋅(q˙,p˙)dqdp
Step 2 (compute the divergence). Directly from Hamilton's equations, k∑(∂qk∂∂pk∂H+∂pk∂(−∂qk∂H))=k∑(∂qk∂pk∂2H−∂pk∂qk∂2H)=0
because mixed second partial derivatives of the smooth function H commute (equality of mixed partials, Schwarz's theorem): ∂2H/∂qk∂pk=∂2H/∂pk∂qk, so the two terms cancel exactly.
Step 3 (zero divergence forces zero rate of change). Substituting the Step 2 result into the transport formula of Step 1 gives dtdV(t)=0
at every instant t, for every choice of initial region Ω(t1).
Step 4 (integrate to get equal volumes). A function of t whose derivative is identically zero is constant, so V(t)=V(t1) for all t: the phase-space volume of the evolving region never changes, exactly as claimed.
Liouville's theorem is what allows statistical mechanics to treat an ensemble of systems as an incompressible fluid flowing through phase space — the density of trajectories at a point never changes just from the flow squeezing or stretching space, only from probability actually moving in or out. It is also the starting point for the modern, coordinate-free formulation of Hamiltonian mechanics on symplectic manifolds, where Hamilton's equations become a single geometric statement and Liouville's theorem becomes the preservation of a canonical volume form.
AdvancedWhere this leads
The Hamiltonian formulation is the doorway from classical to quantum mechanics: replacing Poisson brackets (the algebraic structure underlying Hamilton's equations) with commutators of operators is one standard route to quantization. It is also the natural language for chaos and stability in dynamical systems, and its coordinate-free version is the subject of symplectic geometry.
For a pendulum of length ℓ swinging under gravity, the Lagrangian is
Which symmetry of the Lagrangian does Noether's theorem link to conservation of energy?
Hamilton's equations replace the n second-order Euler–Lagrange equations with
Liouville's theorem says that under Hamiltonian flow, a region of phase space