Hamilton's Canonical Equations
Statement
Given a non-singular Lagrangian L(q, q̇, t) with conjugate momentum p = ∂L/∂q̇ and Hamiltonian H(q, p, t) = p q̇ − L obtained by Legendre transform, the dynamics of the system are governed by the pair of symmetric first-order equations q̇ = ∂H/∂p and ṗ = − ∂H/∂q, together with ∂H/∂t = − ∂L/∂t. These are Hamilton's canonical equations, equivalent to the single second-order Euler–Lagrange equation.
Why it matters
Hamilton's equations replace one second-order equation in configuration space by two first-order equations in phase space (q, p). This flattening exposes the geometric structure of mechanics: the state is a point, the motion is a flow, and the flow preserves phase-space volume (Liouville) and the symplectic two-form. It is the launching pad for canonical transformations, Hamilton–Jacobi theory, statistical mechanics, and the correspondence to quantum mechanics through [q̂, p̂] = iℏ.
The equations wear the three threads on their sleeve. The term ṗ = − ∂H/∂q is Newton's force law recast as a gradient of energy; H itself is (under standard conditions) the total energy; and any coordinate absent from H immediately yields a conserved momentum — the cleanest statement of the symmetry–conservation link.
Assumptions
Derivation
Result
Reading. The rate of change of a coordinate is the gradient of the energy with respect to its conjugate momentum, and the rate of change of that momentum is minus the gradient of the energy with respect to the coordinate. The two equations are mirror images up to a single sign — that antisymmetric sign is the whole content of the symplectic structure. A coordinate missing from H gives ṗ = 0 (conservation); a Hamiltonian with no explicit t gives dH/dt = 0 (energy conservation).
Units check. With [H] = J = kg·m²/s² and [p] = kg·m/s: ∂H/∂p has units (kg·m²/s²)/(kg·m/s) = m/s, matching q̇. And ∂H/∂q has units (kg·m²/s²)/m = kg·m/s² = N, matching ṗ (rate of change of momentum). Both equations are dimensionally consistent.
Limiting cases
- Newtonian particle. For H = p²/2m + V(q): q̇ = p/m and ṗ = −V′(q). Combining, m q̈ = −V′(q) = F — Newton's second law recovered exactly.
- Cyclic coordinate. If H does not contain a coordinate qk, then ṗk = −∂H/∂qk = 0, so pk is conserved (e.g. angular momentum for a rotationally symmetric H).
- Autonomous system. If ∂H/∂t = 0, then H is a constant of the motion; when H equals total energy this is energy conservation.
- Free particle. H = p²/2m gives q̇ = p/m = const, ṗ = 0: uniform straight-line motion.
Breaks when
- Singular (degenerate) Lagrangians. When ∂²L/∂q̇² is not invertible — gauge fields, the relativistic point particle in reparametrization-invariant form, systems with velocity constraints — the map q̇ → p cannot be inverted. H is defined only on a constraint surface and one needs Dirac's constrained Hamiltonian formalism instead.
- Dissipative or non-potential forces. Friction, drag, or any force not obtainable from a potential (or velocity-dependent potential) is invisible to H(q, p, t). The plain canonical equations then give the wrong ṗ; one must add explicit generalized forces or use non-Hamiltonian (e.g. bracket-with-dissipation) methods.
- Explicitly time-varying constraints with hidden work. When the transformation to generalized coordinates is time-dependent, H may differ from the total energy, so reading H as energy fails even though the equations themselves still hold.
Failure modes
- Dropping the minus sign on ṗ = −∂H/∂q. The asymmetric sign is the entire physics; writing ṗ = +∂H/∂q reverses the force and destroys energy conservation.
- Leaving q̇ inside H. After the transform, H must be expressed in (q, p). Differentiating a residual q̇ as if independent gives nonsense; every velocity must first be eliminated using q̇ = q̇(q, p).
- Confusing ∂H/∂t with dH/dt. The partial holds q, p fixed; the total follows the trajectory. They coincide numerically only because the phase-space terms cancel — a result, not a definition.
- Assuming H = T + V always. True only for time-independent, holonomic constraints and velocity-independent potentials. Under time-dependent constraints H can be neither the energy nor T + V.
- Treating p as m q̇ universally. Conjugate momentum equals ∂L/∂q̇; in curvilinear coordinates or with magnetic/velocity-dependent potentials it is not simply mass times velocity.
Discussion
The deep move in passing from Lagrange to Hamilton is a change of independent variables via the Legendre transform: from (q, q̇) on the tangent bundle to (q, p) on the cotangent bundle, the phase space. The transform trades a variable for its conjugate slope precisely because that slope, p, is the quantity Euler–Lagrange already singles out. The cancellation of p dq̇ in step 5 is not luck; it is the defining property that makes H depend on p rather than q̇.
The near-symmetry between the two equations, broken only by a sign, is the fingerprint of symplectic geometry. Writing the phase-space point as ξ = (q, p), Hamilton's equations become ξ̇ = J ∇H with J the antisymmetric unit matrix. This is why any smooth H generates a flow that preserves phase-space volume: the same structure that underlies Poisson brackets, canonical transformations, and Liouville's theorem in statistical mechanics.
The force thread and the symmetry thread meet here. ṗ = −∂H/∂q says force is the negative gradient of energy in configuration; when that gradient vanishes because the coordinate is absent, force and momentum change both vanish and a conservation law appears. This is Noether's theorem in its most transparent guise: continuous symmetry of H ↔ conserved conjugate momentum, no calculus of variations of symmetry orbits required.
Quantization inherits this scaffolding directly. The Poisson bracket {q, p} = 1, itself a shadow of the symplectic form, is promoted to the commutator [q̂, p̂] = iℏ, and Hamilton's equation ξ̇ = {ξ, H} becomes the Heisenberg equation dÂ/dt = (i/ℏ)[Ĥ, Â] + ∂Â/∂t. The identical algebraic skeleton in classical and quantum mechanics is why the Hamiltonian, not the Lagrangian, is the natural object for quantization and for time evolution.
Common misconceptions. The two equations are not "Newton split in half" in a trivial way — they are genuinely more symmetric, and that symmetry is content, not cosmetics. And H being conserved (∂H/∂t = 0) is logically separate from H being the energy (a statement about the constraints); a system can conserve H while H is not the mechanical energy, or vice versa.
Worked examples
Example 1 — One-dimensional harmonic oscillator.
Reading. The coordinate is increasing at 0.80 m/s while the restoring force drives the momentum down at 6.0 N. The angular frequency is ω = √(k/m) = √(200/0.50) = 20 rad/s, and the conserved energy is E = p²/2m + ½kq² = 0.16 + 0.09 = 0.25 J.
Example 2 — Planar central-force motion in polar coordinates.
Reading. The cyclic coordinate θ makes angular momentum conserved, and the vanishing of ṗr with pr = 0 means the radius neither moves nor accelerates: this is a circular orbit at r = 2.0 m traversed at 1.0 rad/s. The balance m r θ̇² = α/r² (both equal 2.0 N) is exactly the centripetal condition, recovered here with no free-body diagram — only ∂H/∂q.
Problems
- A free particle has H = p²/2m with m = 3.0 kg and momentum p = 12 kg·m/s. Find q̇ and ṗ, and state which quantity is conserved.
Solution
q̇ = ∂H/∂p = p/m = 12/3.0 = 4.0 m/s. ṗ = −∂H/∂q = 0 because q is absent from H (cyclic), so p = 12 kg·m/s is conserved. The particle drifts at constant 4.0 m/s.
- For a mass on a spring, H = p²/2m + ½k q² with m = 0.25 kg, k = 100 N/m, at the instant q = 0.020 m, p = 0.10 kg·m/s. Find q̇ and ṗ, then show dE/dt = 0 symbolically.
Solution
q̇ = p/m = 0.10/0.25 = 0.40 m/s; ṗ = −k q = −100 × 0.020 = −2.0 N. Energy rate: dE/dt = (∂H/∂q)q̇ + (∂H/∂p)ṗ = (kq)(p/m) + (p/m)(−kq) = 0. Energy is conserved for any state.
- A body falls under gravity with H = p²/2m + m g q (q = height), m = 1.5 kg, g = 9.8 m/s², released from rest (p = 0) at q = 20 m. Find q̇ and ṗ at release, and the acceleration q̈.
Solution
q̇ = p/m = 0 at release. ṗ = −∂H/∂q = −m g = −1.5 × 9.8 = −14.7 N (momentum decreasing, i.e. downward). Acceleration q̈ = d(p/m)/dt = ṗ/m = −14.7/1.5 = −9.8 m/s², the expected free-fall value.
- A free particle moves in a plane, H = (px² + py²)/2m, with m = 2.0 kg, px = 6.0 kg·m/s, py = −4.0 kg·m/s. Identify the cyclic coordinates, give the two velocities, and give the two momentum rates.
Solution
Both x and y are absent from H, so both are cyclic: ṗx = 0, ṗy = 0, so px and py are conserved. Velocities: ẋ = px/m = 3.0 m/s, ẏ = py/m = −2.0 m/s. Straight-line motion at constant velocity.
- Using Hamilton's equations, prove the identity dH/dt = ∂H/∂t along any trajectory. Then apply it to the oscillator of Problem 2 to state the conserved energy value.
Solution
Total derivative: dH/dt = (∂H/∂q)q̇ + (∂H/∂p)ṗ + ∂H/∂t. Substitute Hamilton's equations q̇ = ∂H/∂p, ṗ = −∂H/∂q: the first two terms become (∂H/∂q)(∂H/∂p) + (∂H/∂p)(−∂H/∂q) = 0, leaving dH/dt = ∂H/∂t. For the oscillator, ∂H/∂t = 0, so H is conserved at E = p²/2m + ½kq² = (0.10)²/(2 × 0.25) + ½(100)(0.020)² = 0.020 + 0.020 = 0.040 J.