Hamilton's Canonical Equations

In 1834 a twenty-nine-year-old Irish astronomer, already famous for predicting a new optical phenomenon from pure mathematics, published a paper that rebuilt all of mechanics around a single scalar function. William Rowan Hamilton's idea looks almost too simple: trade each velocity q˙i\dot q_i for its conjugate momentum pi=∂L/∂q˙ip_i = \partial L/\partial\dot q_i via a Legendre transformation, and the nn second-order Lagrange equations split into 2n2n first-order ones of hypnotic symmetry — q˙i=∂H/∂pi\dot q_i = \partial H/\partial p_i, p˙i=−∂H/∂qi\dot p_i = -\partial H/\partial q_i. One function, H(q,p,t)H(q,p,t), generates every trajectory of the system. What the reformulation buys is not computational convenience — for a bead on a wire, Lagrange is usually faster — but geometry. The state of a system becomes a single point in a 2n2n-dimensional phase space; the dynamics becomes a flow, as literal as water, whose velocity field is the 90°90°-rotated gradient of HH. Motion runs along the contour lines of the Hamiltonian landscape, which is why energy conservation is visible before any calculation. The lone minus sign in the pair of equations makes that flow exactly incompressible — Liouville's theorem — and seeds the entire symplectic structure of mechanics. This page is the gateway to the deepest classical machinery: phase portraits, Poisson brackets, canonical transformations, Hamilton–Jacobi theory, and — via Dirac's substitution of commutators for brackets — quantum mechanics itself. It is also, very concretely, the equation set running inside every solar-system ephemeris, every molecular-dynamics engine, and every Hamiltonian Monte Carlo sampler in modern statistics.

Key takeaways
  • Hamilton's canonical equations replace the nn second-order Lagrange equations by 2n2n first-order ones: q˙i=∂H/∂pi\dot q_i = \partial H/\partial p_i and p˙i=−∂H/∂qi\dot p_i = -\partial H/\partial q_i.
  • They follow from a Legendre transform of the Lagrangian, H=∑ipiq˙i−LH = \sum_i p_i\dot q_i - L, which trades the velocity q˙\dot q for the conjugate momentum p=∂L/∂q˙p = \partial L/\partial\dot q as the independent variable.
  • The two equations divide labour: q˙=∂H/∂p\dot q = \partial H/\partial p is kinematics (how coordinates move given momenta), p˙=−∂H/∂q\dot p = -\partial H/\partial q is Newton's second law in disguise.
  • Along any solution dH/dt=∂H/∂t\mathrm{d}H/\mathrm{d}t = \partial H/\partial t — so HH is conserved whenever it has no explicit time dependence.
  • The minus sign makes the phase-space velocity field divergence-free: phase volume is conserved (Liouville), and the flow never crosses itself — determinism made geometric.
  • Compactly: η˙=J ∇ηH\dot{\boldsymbol\eta} = J\,\nabla_{\boldsymbol\eta}H with the symplectic matrix JJ; equivalently f˙={f,H}+∂f/∂t\dot f = \{f, H\} + \partial f/\partial t for any observable ff.
  • Key idea: a single scalar function H(q,p,t)H(q,p,t) on phase space generates all the dynamics through the antisymmetric pairing q˙=+∂H/∂p\dot q = +\partial H/\partial p, p˙=−∂H/∂q\dot p = -\partial H/\partial q; the sign asymmetry is the seed of the entire symplectic structure.

Where this lives today

The longest-running computations in science are integrations of Hamilton's equations. Solar-system ephemerides and long-term stability studies (does Mercury's orbit go chaotic? — yes, with a small probability, over gigayears) rely on symplectic integrators: discrete update rules like leapfrog and its higher-order refinements that advance (q,p)(q,p) while exactly preserving the symplectic matrix JJ of equation (5). Because they conserve a "shadow Hamiltonian" close to the true one, their energy error stays bounded over billions of steps instead of drifting — the practical dividend of the minus sign. The same integrators drive molecular-dynamics engines simulating proteins and materials with millions of atoms. The most surprising modern tenant of phase space is statistics. Hamiltonian Monte Carlo — the algorithm inside Stan, PyMC, and NumPyro — samples a probability distribution π(q)\pi(q) by inventing fictitious momenta, defining H(q,p)=−log⁡π(q)+12pTM−1pH(q,p) = -\log\pi(q) + \tfrac12 p^{\mathsf T}M^{-1}p, and integrating the canonical equations with leapfrog steps. The Hamiltonian flow carries the sampler along contours of the landscape to distant, high-probability states that a random walk would take ages to reach; Liouville's theorem is what makes the acceptance rule exact. Every Bayesian model fitted this way is, quietly, a run of the equations Hamilton wrote for the planets.

The physical picture

Picture HH as a landscape over phase space — altitude HH plotted over the (q,p)(q,p) plane. Ordinary gradient dynamics (a ball rolling downhill, heat flowing to cold) would send the state down the slope. Hamiltonian dynamics does something stranger and more beautiful: it takes the gradient (∂H/∂q, ∂H/∂p)(\partial H/\partial q,\ \partial H/\partial p) and rotates it by 90°90°, so the phase point moves along the contour lines, neither gaining nor losing altitude. That single geometric move is why energy is conserved, why oscillators trace closed ellipses, and why Hamiltonian systems never "settle down" the way damped systems do — there is no downhill!

Figure
The 90-degree rule — Hamiltonian flow follows the contours of H, not the gradient
q p contours of H (energy levels) ∇H — uphill (q̇, ṗ) = J∇H — along the contour Hamiltonian flow: rotate the gradient 90° — motion never climbs, so H is conserved

The two equations split the work cleanly. The first, q˙=∂H/∂p\dot q = \partial H/\partial p, is the kinematic half: for a standard kinetic energy it just says q˙=p/m\dot q = p/m, velocity is momentum divided by mass. The second, p˙=−∂H/∂q\dot p = -\partial H/\partial q, is the dynamic half: when H=T+VH = T + V it reads p˙=−∂V/∂q=F\dot p = -\partial V/\partial q = F, Newton's second law. Lagrange packs both statements into one second-order equation; Hamilton pulls them apart so that each is first order, and the state (q,p)(q, p) at one instant determines everything. The minus sign between them is not cosmetic bookkeeping — it is the whole point. It makes the phase-space velocity field divergence-free, ∂q˙/∂q+∂p˙/∂p=∂2H/∂q ∂p−∂2H/∂p ∂q=0\partial\dot q/\partial q + \partial\dot p/\partial p = \partial^2 H/\partial q\,\partial p - \partial^2 H/\partial p\,\partial q = 0, so the phase fluid flows like an incompressible liquid: blobs of initial conditions shear and stretch but never change volume. And because the system is first order, exactly one trajectory passes through each phase-space point — trajectories can never intersect. Determinism, energy conservation, and Liouville's theorem are all sitting in that one sign before a single problem has been solved.

Figure
The phase fluid — one flow field, every trajectory, and blobs that shear without changing area
oscillator: closed contours q p every trajectory = a contour of H, run clockwise free particle: the phase fluid shears q p t = 0 later faster at higher p — the blob shears, but its area never changes (Liouville)

From Lagrangian to Hamiltonian

The Hamiltonian is defined by the Legendre transformation of LL with respect to the velocities. The recipe looks innocuous, but the sum ∑pq˙\sum p\dot q is precisely engineered so that all velocity dependence cancels out of the result:

H(q,p,t)=∑ipi q˙i−L(q,q˙,t)(1)H(q,p,t) = \sum_i p_i\,\dot q_i - L(q,\dot q,t) \qquad (1)

where: pi=∂L/∂q˙ip_i = \partial L/\partial\dot q_i — the conjugate (canonical) momentum; every q˙i\dot q_i on the right must be eliminated in favour of (q,p)(q, p) by inverting that definition. The transform swaps which variable is fundamental: LL answers "what happens at this velocity?", HH answers "what happens at this momentum?" — the same information, differently indexed, exactly as in thermodynamics when energy trades places with enthalpy or free energy.

Derivation AThe canonical equations from a differential comparison

We derive Hamilton's canonical equations (2) — q˙i=∂H/∂pi\dot q_i = \partial H/\partial p_i and p˙i=−∂H/∂qi\dot p_i = -\partial H/\partial q_i — from nothing but the Legendre definition (1) and the Euler–Lagrange equation. The strategy is to compute dH\mathrm{d}H twice — once by differentiating the definition (1), once from the assertion that HH is a function of (q,p,t)(q,p,t) alone — and match coefficients of the independent differentials. The route works only if every dq˙i\mathrm{d}\dot q_i term cancels along the way; that cancellation is not luck but the entire design of the Legendre transform, so watch for it in Step 2. Watch also where the physics enters: Steps 1–4 are pure bookkeeping about the transform, and actual dynamics arrives only in Step 5, when Euler–Lagrange converts ∂L/∂qi\partial L/\partial q_i into p˙i\dot p_i.

Step 1. Differentiate the definition and expand dL\mathrm{d}L:

dH=∑i(q˙i dpi+pi dq˙i)−∑i(∂L∂qidqi+∂L∂q˙idq˙i)−∂L∂tdt\mathrm{d}H = \sum_i\big(\dot q_i\,\mathrm{d}p_i + p_i\,\mathrm{d}\dot q_i\big) - \sum_i\Big(\frac{\partial L}{\partial q_i}\mathrm{d}q_i + \frac{\partial L}{\partial\dot q_i}\mathrm{d}\dot q_i\Big) - \frac{\partial L}{\partial t}\mathrm{d}t

Why write everything out: the danger term is dq˙\mathrm{d}\dot q — if it survives, HH is not a phase-space function and the whole construction fails.

Step 2. Watch the cancellation. Since pi=∂L/∂q˙ip_i = \partial L/\partial\dot q_i by definition, the pi dq˙ip_i\,\mathrm{d}\dot q_i and (∂L/∂q˙i) dq˙i(\partial L/\partial\dot q_i)\,\mathrm{d}\dot q_i terms annihilate exactly:

dH=∑iq˙i dpi−∑i∂L∂qi dqi−∂L∂t dt\mathrm{d}H = \sum_i\dot q_i\,\mathrm{d}p_i - \sum_i\frac{\partial L}{\partial q_i}\,\mathrm{d}q_i - \frac{\partial L}{\partial t}\,\mathrm{d}t

Why this is the heart of the Legendre transform: the combination ∑pq˙−L\sum p\dot q - L is precisely the one whose differential contains dp\mathrm{d}p but no dq˙\mathrm{d}\dot q — so HH genuinely lives on phase space, not on velocity space.

Step 3. Now write dH\mathrm{d}H as a phase-space function must look: dH=∑i(∂H∂qidqi+∂H∂pidpi)+∂H∂tdt\mathrm{d}H = \sum_i\big(\tfrac{\partial H}{\partial q_i}\mathrm{d}q_i + \tfrac{\partial H}{\partial p_i}\mathrm{d}p_i\big) + \tfrac{\partial H}{\partial t}\mathrm{d}t. Why we may do this: Step 2 proved HH depends only on (q,p,t)(q, p, t), so its differential has exactly these three kinds of terms.

Step 4. Match coefficients of the independent differentials dqi\mathrm{d}q_i, dpi\mathrm{d}p_i, dt\mathrm{d}t:

∂H∂pi=q˙i,∂H∂qi=−∂L∂qi,∂H∂t=−∂L∂t\frac{\partial H}{\partial p_i} = \dot q_i, \qquad \frac{\partial H}{\partial q_i} = -\frac{\partial L}{\partial q_i}, \qquad \frac{\partial H}{\partial t} = -\frac{\partial L}{\partial t}

Why matching is legal: qq, pp, tt are independent variables on phase space, so their differentials can be dialed separately; equal 1-forms must have equal coefficients. The first relation is already the first canonical equation — note it is pure bookkeeping, no dynamics has entered yet.

Step 5. Inject the physics. The Euler–Lagrange equation says ∂L/∂qi=ddt(∂L/∂q˙i)=p˙i\partial L/\partial q_i = \frac{\mathrm{d}}{\mathrm{d}t}\big(\partial L/\partial\dot q_i\big) = \dot p_i, which converts the middle relation of Step 4 into the second canonical equation. Together:

q˙i=∂H∂pi,p˙i=−∂H∂qi(i=1,…,n)(2)\dot q_i = \frac{\partial H}{\partial p_i}, \qquad \dot p_i = -\frac{\partial H}{\partial q_i} \qquad (i = 1,\dots,n) \qquad (2)

where: the first equation held identically (kinematics of the transform); the second is exactly where Newton's law lives. Why the minus sign appears on this one and not the other: the Legendre transform flips the sign of every variable it does not trade — qq stays a variable of HH, so its partial derivative inherits −∂L/∂q-\partial L/\partial q. Two immediate corollaries are one line each, and both are load-bearing. First, take the total time derivative of HH along a solution and insert (2):

dHdt=∑i(∂H∂qi∂H∂pi−∂H∂pi∂H∂qi)+∂H∂t=∂H∂t(3)\frac{\mathrm{d}H}{\mathrm{d}t} = \sum_i\Big(\frac{\partial H}{\partial q_i}\frac{\partial H}{\partial p_i} - \frac{\partial H}{\partial p_i}\frac{\partial H}{\partial q_i}\Big) + \frac{\partial H}{\partial t} = \frac{\partial H}{\partial t} \qquad (3)

where: the bracket cancels identically — the 90°90° rotation at work: the flow is orthogonal to the gradient, so HH changes only through explicit time dependence. Autonomous Hamiltonian, conserved Hamiltonian: no exceptions. Second, the same cancellation for an arbitrary observable f(q,p,t)f(q,p,t) does not vanish but organizes itself into the Poisson bracket:

f˙={f,H}+∂f∂t,{f,g}=∑i(∂f∂qi∂g∂pi−∂f∂pi∂g∂qi)(4)\dot f = \{f, H\} + \frac{\partial f}{\partial t}, \qquad \{f,g\} = \sum_i\Big(\frac{\partial f}{\partial q_i}\frac{\partial g}{\partial p_i} - \frac{\partial f}{\partial p_i}\frac{\partial g}{\partial q_i}\Big) \qquad (4)

where: {f,g}\{f,g\} — the Poisson bracket. Equation (4) says HH generates time evolution of everything: constants of motion are exactly the observables that Poisson-commute with HH. Replace { ,}\{\ ,\} by [ ,]/iℏ[\ ,]/i\hbar and this becomes Heisenberg's equation of motion — the shortest road from this page to quantum mechanics.

The geometry in matrix form

Stack the coordinates into η=(q1,…,qn,p1,…,pn)T\boldsymbol\eta = (q_1,\dots,q_n,p_1,\dots,p_n)^{\mathsf T} and both equations become one:

η˙=J ∇ηH,J=(0In−In0)(5)\dot{\boldsymbol{\eta}} = J\,\nabla_{\boldsymbol{\eta}}H, \qquad J = \begin{pmatrix} 0 & I_n \\ -I_n & 0 \end{pmatrix} \qquad (5)

where: JJ — the standard symplectic matrix, with J2=−IJ^2 = -I and JT=−JJ^{\mathsf T} = -J. JJ is the 90°90° rotation of the physical picture, promoted to 2n2n dimensions; every deep structural fact of mechanics (canonical transformations, Liouville, integral invariants) is a statement about transformations that preserve JJ. The divergence-free property is now one line:

∇ ⁣⋅ ⁣η˙=∂q˙i∂qi+∂p˙i∂pi=∂2H∂qi ∂pi−∂2H∂pi ∂qi=0(6)\nabla\!\cdot\!\dot{\boldsymbol\eta} = \frac{\partial\dot q_i}{\partial q_i} + \frac{\partial\dot p_i}{\partial p_i} = \frac{\partial^2 H}{\partial q_i\,\partial p_i} - \frac{\partial^2 H}{\partial p_i\,\partial q_i} = 0 \qquad (6)

where: equality of mixed partials does all the work. This is Liouville's theorem in differential form: the phase fluid is incompressible, whatever HH is. For the workhorse case — kinetic energy quadratic in velocities, T=12∑Mjkq˙jq˙kT = \tfrac12\sum M_{jk}\dot q_j\dot q_k, potential independent of velocity — the momentum–velocity relation pj=∑kMjkq˙kp_j = \sum_k M_{jk}\dot q_k inverts to q˙j=∑k(M−1)jk pk\dot q_j = \sum_k (M^{-1})_{jk}\,p_k, and Euler's theorem for homogeneous quadratics gives ∑jpjq˙j=2T\sum_j p_j\dot q_j = 2T, so H=2T−(T−V)H = 2T - (T - V):

H=12∑j,kpj (M−1)jk pk+V(q)=T+V(7)H = \frac{1}{2}\sum_{j,k} p_j\,(M^{-1})_{jk}\,p_k + V(q) = T + V \qquad (7)

where: MjkM_{jk} — the mass/inertia matrix. In this standard situation the Hamiltonian is the total energy — but treat that as a theorem with hypotheses, not an identity: rotating frames, time-dependent constraints, and velocity-dependent potentials all break it.

Go deeper · Derivation B · 1 minThe same equations from a variational principle
Derivation BThe same equations from a variational principle

We now re-derive the canonical equations (2) by a second, deeper route: Hamilton's principle recast on phase space, extremizing the action S=∫(∑ipiq˙i−H) dtS = \int(\sum_i p_i\dot q_i - H)\,\mathrm{d}t with qq and pp varied independently. That independence is the formal expression of their equal status — and the payoff of this route is that it never mentions the Lagrangian's velocity space, so phase space stands on its own feet. The mechanics of the proof is short: one integration by parts, then read off the coefficients of δqi\delta q_i and δpi\delta p_i separately. The subtlety to watch is the boundary term: only δqi\delta q_i is pinned at the endpoints, while pp needs no boundary condition at all — an asymmetry easy to gloss over here that becomes load-bearing in Hamilton–Jacobi theory.

Step 1. Extremize the phase-space action S=∫t1t2(∑ipiq˙i−H(q,p,t)) dtS = \int_{t_1}^{t_2}\big(\sum_i p_i\dot q_i - H(q,p,t)\big)\,\mathrm{d}t over independent variations δqi(t)\delta q_i(t), δpi(t)\delta p_i(t):

δS=∫t1t2∑i(δpi q˙i+pi δq˙i−∂H∂qiδqi−∂H∂piδpi)dt\delta S = \int_{t_1}^{t_2}\sum_i\Big(\delta p_i\,\dot q_i + p_i\,\delta\dot q_i - \frac{\partial H}{\partial q_i}\delta q_i - \frac{\partial H}{\partial p_i}\delta p_i\Big)\mathrm{d}t

Why the integrand is pq˙−Hp\dot q - H: by (1) this is just LL rewritten in phase-space variables — the same action as always, but with twice as many independent functions to wiggle.

Step 2. Integrate the pi δq˙ip_i\,\delta\dot q_i term by parts: ∫pi δq˙i dt=[pi δqi]t1t2−∫p˙i δqi dt\int p_i\,\delta\dot q_i\,\mathrm{d}t = [p_i\,\delta q_i]_{t_1}^{t_2} - \int\dot p_i\,\delta q_i\,\mathrm{d}t. Why the boundary term dies: only δqi\delta q_i is pinned at the endpoints; note that no boundary condition on pp is needed at all — an asymmetry that matters in Hamilton–Jacobi theory.

Step 3. Collect by independent variation:

δS=∫t1t2∑i[(q˙i−∂H∂pi)δpi−(p˙i+∂H∂qi)δqi]dt\delta S = \int_{t_1}^{t_2}\sum_i\Big[\Big(\dot q_i - \frac{\partial H}{\partial p_i}\Big)\delta p_i - \Big(\dot p_i + \frac{\partial H}{\partial q_i}\Big)\delta q_i\Big]\mathrm{d}t

Why grouping is decisive: δqi\delta q_i and δpi\delta p_i are arbitrary and independent, so stationarity forces each bracket to vanish separately — there is no way to trade an error in one against the other.

Step 4. Read off both canonical equations at once: q˙i=∂H/∂pi\dot q_i = \partial H/\partial p_i and p˙i=−∂H/∂qi\dot p_i = -\partial H/\partial q_i. Why this derivation is worth having: it never mentions the Lagrangian's velocity space — phase space stands on its own feet, and the door to canonical transformations (changing (q,p)(q,p) wholesale while preserving the form of the equations) is now open.

Which formulation answers which question

you wantusewhy
equations of motion from HHq˙=∂H/∂p\dot q = \partial H/\partial p, p˙=−∂H/∂q\dot p = -\partial H/\partial q, eq. (2)the workhorse
build HH from LLH=∑pq˙−LH = \sum p\dot q - L, eq. (1), then eliminate q˙\dot qLegendre recipe
is energy conserved?dH/dt=∂H/∂t\mathrm{d}H/\mathrm{d}t = \partial H/\partial t, eq. (3)check explicit tt only
evolution of any observablef˙={f,H}+∂f/∂t\dot f = \{f,H\} + \partial f/\partial t, eq. (4)conservation ⇔ {f,H}=0\{f,H\}=0
geometric/structural statementsη˙=J∇H\dot{\boldsymbol\eta} = J\nabla H, eq. (5)symplectic form manifest
standard mechanical systemsH=T+VH = T + V with TT in momenta, eq. (7)valid for quadratic TT, static constraints

Limiting cases

CaseResultMeaning
free particleH=p22mH = \dfrac{p^2}{2m}: q˙=p/m\dot q = p/m, p˙=0\dot p = 0momentum conserved; phase trajectories are horizontal straight lines
cyclic coordinate∂H∂qi=0⇒p˙i=0\dfrac{\partial H}{\partial q_i} = 0 \Rightarrow \dot p_i = 0conjugate momentum conserved by inspection — conservation laws for free
time-independent HHdH/dt=0\mathrm{d}H/\mathrm{d}t = 0motion confined to constant-energy surfaces in phase space
harmonic oscillatorH=p22m+12mω2q2H = \dfrac{p^2}{2m} + \tfrac12 m\omega^2 q^2elliptical phase orbits traversed clockwise at rate ω\omega
relativistic free particleH=p2c2+m2c4H = \sqrt{p^2c^2 + m^2c^4}: q˙=pc2/H\dot q = pc^2/Hcanonical machinery unchanged; q˙<c\dot q < c automatic since pc<Hpc < H

Worked examples

1 · A harmonic oscillator, fully solved in phase space (confidence builder)

A mass m=0.25 kgm = 0.25\ \mathrm{kg} on a spring of stiffness k=16 N/mk = 16\ \mathrm{N/m} starts at q0=0.10 mq_0 = 0.10\ \mathrm{m} with momentum p0=0.40 kg m/sp_0 = 0.40\ \mathrm{kg\,m/s}. Find the Hamiltonian, the equations of motion, the energy, and the phase-space ellipse.

Step 1. Build HH: with L=12mq˙2−12kq2L = \tfrac12 m\dot q^2 - \tfrac12 kq^2, the momentum is p=mq˙p = m\dot q, so q˙=p/m\dot q = p/m and H=p2/2m+12kq2H = p^2/2m + \tfrac12 kq^2. Natural frequency: ω=k/m=64=8.0 rad/s\omega = \sqrt{k/m} = \sqrt{64} = 8.0\ \mathrm{rad/s}.

Step 2. Canonical equations: q˙=∂H/∂p=p/m\dot q = \partial H/\partial p = p/m and p˙=−∂H/∂q=−kq\dot p = -\partial H/\partial q = -kq. Differentiating the first and inserting the second recovers q¨=−ω2q\ddot q = -\omega^2 q. ✓

Step 3. Energy from the initial point: H=(0.40)22(0.25)+12(16)(0.10)2=0.32+0.08=0.40 JH = \dfrac{(0.40)^2}{2(0.25)} + \tfrac12(16)(0.10)^2 = 0.32 + 0.08 = \boxed{0.40\ \mathrm{J}}, conserved forever by (3).

Step 4. The trajectory is the ellipse H(q,p)=0.40 JH(q,p) = 0.40\ \mathrm{J} with semi-axes qmax⁡=2E/k=0.05=0.224 mq_{\max} = \sqrt{2E/k} = \sqrt{0.05} = 0.224\ \mathrm{m} and pmax⁡=2mE=0.20=0.447 kg m/sp_{\max} = \sqrt{2mE} = \sqrt{0.20} = 0.447\ \mathrm{kg\,m/s}, traversed clockwise with period T=2π/ω=0.785 sT = 2\pi/\omega = 0.785\ \mathrm{s}.

Step 5. Bonus check with an eye on action-angle variables: the enclosed phase area is π qmax⁡pmax⁡=π×0.224×0.447=0.314 J s\pi\,q_{\max}p_{\max} = \pi \times 0.224 \times 0.447 = 0.314\ \mathrm{J\,s}, which equals 2πE/ω=2π(0.40)/8.0=0.314 J s2\pi E/\omega = 2\pi(0.40)/8.0 = 0.314\ \mathrm{J\,s}. ✓ Phase-space area divided by 2π2\pi is the action variable — the quantity old quantum theory would later force to be an integer times ℏ\hbar.

2 · A satellite orbit by cyclic coordinates (exam level)

A satellite of mass m=500 kgm = 500\ \mathrm{kg} moves in Earth's field, V(r)=−GMm/rV(r) = -GMm/r with GM=3.986×1014 m3/s2GM = 3.986\times10^{14}\ \mathrm{m^3/s^2}. Using polar coordinates in the orbital plane, find HH, identify the conserved quantities, and use the canonical equations to find the speed and period of a circular orbit at r=7000 kmr = 7000\ \mathrm{km}.

Step 1. From L=12m(r˙2+r2ϕ˙2)+GMm/rL = \tfrac12 m(\dot r^2 + r^2\dot\phi^2) + GMm/r, the momenta are pr=mr˙p_r = m\dot r and pϕ=mr2ϕ˙p_\phi = mr^2\dot\phi. Eliminating velocities:

H=pr22m+pϕ22mr2−GMmrH = \frac{p_r^2}{2m} + \frac{p_\phi^2}{2mr^2} - \frac{GMm}{r}

Step 2. Spot the structure before computing. HH has no explicit tt: energy is conserved. HH has no ϕ\phi: the coordinate is cyclic, so p˙ϕ=−∂H/∂ϕ=0\dot p_\phi = -\partial H/\partial\phi = 0 and the angular momentum pϕp_\phi is a constant — Kepler's second law read off in one line, no vector products needed.

Step 3. Write the radial canonical equations: r˙=pr/m\dot r = p_r/m and p˙r=−∂H/∂r=pϕ2mr3−GMmr2\dot p_r = -\partial H/\partial r = \dfrac{p_\phi^2}{mr^3} - \dfrac{GMm}{r^2}. A circular orbit means pr=0p_r = 0 forever, so we need p˙r=0\dot p_r = 0: the centrifugal term must balance gravity.

Step 4. Solve the balance: pϕ2=GMm2rp_\phi^2 = GMm^2 r, i.e. v=pϕ/mr=GM/r=3.986×1014/7.0×106=7.55 km/sv = p_\phi/mr = \sqrt{GM/r} = \sqrt{3.986\times10^{14}/7.0\times10^6} = \boxed{7.55\ \mathrm{km/s}}.

Step 5. Period: T=2πr/v=2π(7.0×106)/7546=5.83×103 s≈97 minT = 2\pi r/v = 2\pi(7.0\times10^6)/7546 = 5.83\times10^3\ \mathrm{s} \approx \boxed{97\ \mathrm{min}} — the familiar low-Earth-orbit hour-and-a-half. The conserved momentum itself: pϕ=mrv=500×7.0×106×7546=2.64×1013 kg m2/sp_\phi = mrv = 500 \times 7.0\times10^6 \times 7546 = 2.64\times10^{13}\ \mathrm{kg\,m^2/s}.

Step 6. The moral: the canonical formalism converted a two-dimensional orbit problem into one effective radial equation plus a conservation law harvested by inspection. That "cyclic coordinate ⇒ frozen momentum" reflex is the everyday superpower of Hamiltonian mechanics — and the seed of the action-angle method that follows it.

Origins · 1 minWilliam Rowan Hamilton and how this was discovered
WR
William Rowan Hamilton
1805–1865 · Trinity College Dublin and Dunsink Observatory

Hamilton was appointed Astronomer Royal of Ireland at 22, while still an undergraduate, on the strength of a paper treating optics as a variational theory. His "theory of systems of rays" predicted conical refraction in biaxial crystals — light exiting as a hollow cone — which was confirmed within months and made him famous across Europe. The two great dynamics papers of 1834–35 transplanted the same variational machinery from light rays to particle trajectories, introducing the characteristic function, the canonical equations, and the phrase "principle of varying action". A decade later, walking along the Royal Canal in Dublin, he saw in a flash how to multiply quadruples — and carved the quaternion relations i2=j2=k2=ijk=−1i^2 = j^2 = k^2 = ijk = -1 into the stone of Broom Bridge. He regarded quaternions as his masterpiece; posterity chose the equations on this page, which turned out to be the exact classical skeleton on which quantum mechanics was later hung.

History
1788
— Lagrange's Mécanique analytique perfects the second-order formulation: mechanics as nn equations in nn generalized coordinates, famously without a single diagram.
1834
— Hamilton's "On a General Method in Dynamics" recasts dynamics through the characteristic function borrowed from his optics.
1835
— The second essay delivers the canonical equations in their modern form, with coordinates and momenta as equal citizens.
1866
— Jacobi's posthumous Vorlesungen über Dynamik systematizes and extends the method, making it the standard advanced formalism across Europe.
1925
— Dirac recognizes that Heisenberg's mysterious quantum products mirror the Poisson bracket, and canonical quantization { ,}→[ ,]/iℏ\{\,,\} \to [\,,]/i\hbar is born — Hamilton's structure becomes the template for quantum mechanics.

Going further

Texts. Goldstein, Poole & Safko, Classical Mechanics, 3rd ed., Ch. 8 · Landau & Lifshitz, Mechanics, §40 · Morin, Introduction to Classical Mechanics, Ch. 15 · Taylor, Classical Mechanics, Ch. 13 · Arnold, Mathematical Methods of Classical Mechanics, Ch. 3. Key self-consistency checks: the differential-comparison derivation yields q˙=∂H/∂p\dot q=\partial H/\partial p and p˙=−∂H/∂q\dot p=-\partial H/\partial q; dH/dt=∂H/∂t\mathrm{d}H/\mathrm{d}t=\partial H/\partial t follows from the chain rule combined with the canonical equations; the divergence of (q˙,p˙)(\dot q,\dot p) vanishes by equality of mixed partials. The harmonic-oscillator phase ellipse has semi-axes 2E/mω2\sqrt{2E/m\omega^2} in qq and 2mE\sqrt{2mE} in pp. Worked-example values (ω=8.0\omega = 8.0 rad/s, E=0.40E = 0.40 J, enclosed area 0.3140.314 J·s; v=7.55v = 7.55 km/s, T≈97T \approx 97 min for the 70007000 km orbit with GM=3.986×1014 m3/s2GM = 3.986\times10^{14}\ \mathrm{m^3/s^2}) all follow directly from the boxed formulas.

Builds on: The Hamiltonian Function · Legendre Transformation · Generalized Momenta · Phase Space. Leads to: Hamiltonian Flow and the Phase Fluid · Phase Portraits and Trajectories · Liouville's Theorem · Equivalence of Lagrangian and Hamiltonian Formulations.

If Lagrangian mechanics already solves every problem, what does Hamilton actually buy me?

For a bead on a wire, honestly, almost nothing — Lagrange is usually faster, and the article says so up front. What you buy is geometry, not speed. The state becomes one point in 2n2n-dimensional phase space, the dynamics an incompressible flow η˙=J∇H\dot{\boldsymbol\eta} = J\nabla H, and structural facts fall out for free: exactly one trajectory per point, conservation laws harvested by inspection (cyclic coordinate ⇒p˙i=0\Rightarrow \dot p_i = 0, as in the satellite example), Liouville's theorem, Poisson brackets, and the doors to canonical transformations and Hamilton–Jacobi theory. The practical dividends are real too: symplectic integrators with bounded energy error over gigayears, and Hamiltonian Monte Carlo running inside every Stan model. And via { ,}→[ ,]/iℏ\{\,,\}\to[\,,]/i\hbar, it is the classical formalism quantum mechanics is built on.

Why are qq and pp varied independently in the phase-space action when pp is defined from q˙\dot q?

Because in the Hamiltonian setting that definition is demoted from an input to an output. Extremize S=∫(∑ipiq˙i−H) dtS = \int(\sum_i p_i\dot q_i - H)\,\mathrm{d}t wiggling δqi\delta q_i and δpi\delta p_i separately, and the coefficient of δpi\delta p_i forces q˙i=∂H/∂pi\dot q_i = \partial H/\partial p_i — which for a standard H=p2/2m+VH = p^2/2m + V says precisely p=mq˙p = m\dot q. The momentum–velocity relation you were afraid of losing reappears as half of the equations of motion instead of being fed in by hand. Nothing is double-counted: you enlarged the space of curves, and stationarity itself glues pp back to q˙\dot q on the solution. That is the precise sense in which coordinates and momenta are "equal citizens" — and note the asymmetry that only δq\delta q needs pinning at the endpoints.

How can HH be conserved without being the energy — or equal T+VT+V without being conserved?

Because those are two independent theorems with different hypotheses. Conservation comes from equation (3): dH/dt=∂H/∂t\mathrm{d}H/\mathrm{d}t = \partial H/\partial t, so HH is conserved exactly when it carries no explicit time dependence — nothing else matters. The identification H=T+VH = T + V comes from equation (7) and needs its own hypotheses: kinetic energy homogeneous quadratic in the velocities and static, velocity-independent constraints, so that Euler's theorem gives ∑pq˙=2T\sum p\dot q = 2T. A bead on a steadily rotating hoop breaks the second theorem but not the first: HH is conserved yet is not T+VT+V. A particle in an externally driven, time-varying potential breaks the first but not the second: H=T+VH = T + V at every instant, yet ∂H/∂t≠0\partial H/\partial t \neq 0 and energy is pumped in. Check each hypothesis separately.

Why the whole ∑pq˙−L\sum p\dot q - L construction? Can't I just substitute q˙=p/m\dot q = p/m into LL?

Try it: for the oscillator you get L~(q,p)=p2/2m−12kq2\tilde L(q,p) = p^2/2m - \tfrac12 kq^2, and no recipe applied to L~\tilde L gives the right dynamics — the sign of the kinetic term is wrong for that. The issue is what the function's slopes mean. The differential of LL is dL=∑(∂L/∂qi)dqi+∑pi dq˙i\mathrm{d}L = \sum(\partial L/\partial q_i)\mathrm{d}q_i + \sum p_i\,\mathrm{d}\dot q_i: its natural response variables are dq˙\mathrm{d}\dot q, and blind substitution scrambles them. Subtracting from ∑pq˙\sum p\dot q is engineered so the pi dq˙ip_i\,\mathrm{d}\dot q_i and (∂L/∂q˙i) dq˙i(\partial L/\partial\dot q_i)\,\mathrm{d}\dot q_i terms annihilate — Step 2 of the derivation — leaving dH\mathrm{d}H with only dq\mathrm{d}q, dp\mathrm{d}p, dt\mathrm{d}t. That is the Legendre transform: the same trade thermodynamics makes between energy and free energy, swapping the fundamental variable without losing information.

A pendulum passes through the same position twice every period — doesn't that violate the no-crossing rule?

The no-crossing theorem lives in phase space, not in configuration space. The state is the pair (q,p)(q,p), and the bob sweeping through the bottom moving right is a different phase point from the bob at the same qq moving left — (q,+p)(q, +p) versus (q,−p)(q, -p). On the phase portrait these sit on opposite sides of the ellipse, no collision anywhere. What the first-order structure forbids is two distinct trajectories through one (q,p)(q,p) point: since η˙=J∇H\dot{\boldsymbol\eta} = J\nabla H assigns a unique velocity to each point, the point fixes the entire future and past. A single closed orbit revisiting its own points periodically is fine — that is just periodicity. The apparent crossings you imagine are shadows: projections of the ellipse onto the qq-axis.

Why doesn't a Hamiltonian system ever settle down to equilibrium like a damped one does?

Because there is no downhill. The phase velocity is the 90°90°-rotated gradient, (q˙,p˙)=J∇H(\dot q, \dot p) = J\nabla H, so motion runs along the contour lines of HH, never descending the landscape — that is the content of dH/dt=0\mathrm{d}H/\mathrm{d}t = 0 for autonomous systems. Liouville's theorem then makes settling geometrically impossible: an attractor would compress a blob of initial conditions toward a point, but equation (6) says the flow's divergence vanishes identically, so phase volume is exactly conserved. Friction escapes the argument only by leaving the formalism: a drag force −bq˙-b\dot q is not generated by any H(q,p)H(q,p), and adding it makes trajectories spiral inward and volumes contract. The absence of attractors is the geometric fingerprint of Hamiltonian dynamics.

If a phase blob shears into a thin filament, what does Liouville's theorem actually conserve — and does it forbid chaos?

Volume only — nothing protects the shape. The free-particle panel in the figure shows the mild version: points with larger pp move faster, so a square blob shears into a parallelogram of identical area. Chaotic Hamiltonian systems do something far more violent: they stretch the blob exponentially along some directions while compressing it along others, the product staying exactly fixed, until the filament folds into fantastically fine tendrils threading the energy surface. So Liouville and chaos coexist happily — incompressibility constrains the bookkeeping, not the complexity. The theorem's payoffs lie elsewhere: it is why the acceptance rule in Hamiltonian Monte Carlo is exact, and why statistical mechanics can put a well-defined, time-invariant probability measure on phase space at all.

Is quantum mechanics secretly contained in the Poisson bracket, since brackets become commutators over iℏi\hbar?

Contained, no — templated, yes. Equation (4), f˙={f,H}+∂f/∂t\dot f = \{f,H\} + \partial f/\partial t, becomes Heisenberg's equation of motion under Dirac's 1925 substitution, and the fundamental bracket {q,p}=1\{q,p\} = 1 becomes [q^,p^]=iℏ[\hat q,\hat p] = i\hbar. The classical formalism even flags where ℏ\hbar will land: the oscillator's phase-space area 2πE/ω2\pi E/\omega in worked example 1 is the action variable that old quantum theory forced to be an integer multiple of ℏ\hbar. But quantization adds genuinely new content — states, operators, superposition, and the value of ℏ\hbar itself — that no amount of classical manipulation produces; the correspondence is structural, not derivational. It is still the deepest reason this page matters: Hamilton's HH and its bracket algebra are the exact classical skeleton on which quantum mechanics was hung.

Before this

Where this leads