Classical Mechanics · Upper Division

Hamiltonian Mechanics

The Hamiltonian formulation replaces Newton's second-order equations with a symmetric pair of first-order equations in phase space — the natural language of statistical mechanics, quantum mechanics, and chaos theory.

PrerequisitesLagrangian mechanics (Ch. L) · Partial derivatives · Phase space concept
Learning Goals
  • Perform the Legendre transform from the Lagrangian to the Hamiltonian and write Hamilton's equations.
  • Describe the harmonic oscillator phase portrait as closed ellipses at constant energy.
  • State Liouville's theorem and explain its consequence for statistical mechanics ensembles.
  • Evaluate Poisson brackets to identify conserved quantities and derive equations of motion.
  • Construct action-angle variables for integrable systems and apply semiclassical quantization.

H.1 From Lagrangian to Hamiltonian

Given the Lagrangian L(q, q̇, t), the generalized momentum conjugate to qᵢ is defined as:

pi=∂L∂q˙ip_i = \frac{\partial L}{\partial \dot q_i}(H.1)

The Hamiltonian is obtained by a Legendre transform that eliminates q̇ in favor of p.Hamilton's move1834-1835 · Mechanics becomes geometryWilliam Rowan Hamilton published his reformulation of mechanics while managing a difficult personal life — he had loved someone he could not marry and carried that loss for decades, alongside persistent struggles. None of that is visible in the mathematics. The Hamiltonian formalism is a thing of severe elegance: mechanics as geometry in phase space, with trajectories as curves on a surface shaped by energy. A century later, Heisenberg and Schrödinger found that quantum mechanics slips naturally into that language. Hamilton built the bridge without ever knowing where it led.Source: William Rowan Hamilton, On a General Method in Dynamics.Further reading: William Rowan Hamilton

H(q,p,t)=∑ipiq˙i−L(q,q˙,t)H(q,p,t) = \sum_i p_i\dot q_i - L(q,\dot q,t)(H.2)

For a natural mechanical system (kinetic energy quadratic in velocities, no explicit time dependence), H equals the total mechanical energy: H = T + V.

Definition H.1 — Hamilton's Equations
The equations of motion in Hamiltonian mechanics are:q˙i=∂H/∂pip˙i=−∂H/∂qi\dot{q}_{i} = \partial H/\partial p_{i} \qquad \dot{p}_{i} = -\partial H/\partial q_{i}These replace one second-order ODE per degree of freedom with two first-order ODEs — at the cost of doubling the number of variables but gaining perfect symmetry between q and p.
Example H.1 — Harmonic Oscillator in Phase Space

A mass m on a spring (k):L=12mx˙2−12kx2k): L = \frac{1}{2}m\dot{x}^{2} - \frac{1}{2}kx^{2}. Write Hamilton's equations and describe the phase portrait.

Conjugate momentum:p=∂L/∂x˙=mx˙p = \partial L/\partial \dot{x} = m\dot{x}    (the ordinary linear momentum)
Hamiltonian:H=px˙−L=p2/(2m)+12kx2H = p\dot{x} - L = p^{2}/(2m) + \frac{1}{2}kx^{2}    (kinetic + potential, as expected)
Hamilton's equations:ẋ = ∂H/∂p=p/mp˙=−∂H/∂x=−kx\partial H/\partial p = p/m \qquad \dot{p} = -\partial H/\partial x = -kx
Eliminating p:ṗ = mx¨=−kx→x¨+(k/m)x=0✓m\ddot{x} = -kx \to \ddot{x} + (k/m)x = 0 ✓ (recovers Newton)
Phase portrait:H=EH = E = const defines an ellipse in (x, p) space: x2/(2E/k)+p2/(2mE)=1x^{2}/(2E/k) + p^{2}/(2mE) = 1. Every orbit is a closed ellipse — the system is periodic for all energies.

H.2 Phase Space and Liouville's Theorem

The phase spaceof an n-degree-of-freedom system is the 2n-dimensional space with coordinates (q₁,...,qₙ, p₁,...,pₙ). Each point represents a complete instantaneous state. Hamilton's equations define a flow in this space — every state has a unique future and past.

Theorem H.1 — Liouville's Theorem
The phase space flow generated by Hamilton's equations preserves volume. If you take a region of phase space containing many initial conditions and let the system evolve, the volume occupied is constant — even though the shape may distort arbitrarily:dΓ/dt=0d\Gamma/dt = 0     where Γ=∫dnq dnp\Gamma = \int d^n q\, d^n pThis is the foundation of statistical mechanics: a microcanonical ensemble occupies a constant volume in phase space. It also implies that phase space trajectories never cross.
Figure H.1. Phase portraits for three Hamiltonian systems. Harmonic oscillator: perfect ellipses (all periodic). Pendulum: libration (closed curves below the separatrix), rotation (open curves above), and the separatrix itself (infinite-period orbit). Double well: two stable fixed points at ±1 with a separatrix through the unstable origin.

H.3 Poisson Brackets

For any two functions f(q, p) and g(q, p), the Poisson bracket is:

{f,g}=∑i(∂f∂qi∂g∂pi−∂f∂pi∂g∂qi)\{f,g\} = \sum_i\left(\frac{\partial f}{\partial q_i}\frac{\partial g}{\partial p_i} - \frac{\partial f}{\partial p_i}\frac{\partial g}{\partial q_i}\right)(H.3)

Poisson brackets encode the algebraic structure of classical mechanics. Key properties:

{qi,pj}=δij{qi,qj}=0{pi,pj}=0\{q_i,p_j\} = \delta_{ij} \qquad \{q_i,q_j\}=0 \qquad \{p_i,p_j\}=0(H.4)

The time evolution of any observable A is:

dAdt={A,H}+∂A∂t\frac{dA}{dt} = \{A,H\} + \frac{\partial A}{\partial t}(H.5)

A quantity A is conserved if and only if {A, H} = 0 (and A has no explicit time dependence). The Poisson bracket structure is preserved by canonical transformations — the symplectomorphisms that are the symmetries of Hamiltonian mechanics. In quantum mechanics, Poisson brackets become commutators:{f, g} → [f̂, ĝ]/(iℏ).

Example H.2 — Angular Momentum Conservation via Poisson Brackets

For a central force H=p2/(2m)+V(r)H = p^{2}/(2m) + V(r), show that Lz=xpy−ypxL_z = xp_y - yp_x is conserved.

Compute {Lz, H}:{Lz,p2/2m}+{Lz,V(r)}\{L_z, p^2/2m\} + \{L_z, V(r)\}
First term:{xpy,px2/2m}+{−ypx,py2/2m}\{xp_y, p_x^2/2m\} + \{-yp_x, p_y^2/2m\} (the other terms vanish): evaluates to py(px/m)−px(py/m)=0p_y(p_x/m) - p_x(p_y/m) = 0.
Second term:{xpy−ypx,V(r)}=y ∂V/∂x−x ∂V/∂y\{xp_y - yp_x, V(r)\} = y\,\partial V/\partial x - x\,\partial V/\partial y. Since ∂V/∂x=(x/r)V′(r)\partial V/\partial x = (x/r)V'(r) etc., cross terms cancel exactly.
Result:{Lz,H}=0\{L_z, H\} = 0 → LzL_z conserved for any central V(r). ✓   Angular momentum is conserved because HhasnoϕH has no \phi dependence — Noether again.

H.4 Canonical Transformations and Action-Angle Variables

A canonical transformation(Q, P) = (Q(q,p), P(q,p)) preserves the form of Hamilton's equations. The condition is that the transformation preserves the Poisson bracket structure: {Qᵢ, Pⱼ} = δᵢⱼ.

For an integrable system (as many conserved quantities as degrees of freedom), one can always find action-angle variables (J, θ) where:

Ji=12π∮pi dqiθ˙i=ωi=∂H∂Ji=constantJ_i = \frac{1}{2\pi}\oint p_i\,dq_i \qquad \dot\theta_i = \omega_i = \frac{\partial H}{\partial J_i} = \mathrm{constant}(H.6)

In action-angle variables, the Hamiltonian depends only on J, not θ — every θ is cyclic, every Jᵢ is conserved, and the motion is uniform rotation on a torus in phase space. This formulation is the starting point for perturbation theory (KAM theorem) and the semi-classical quantization rule: Jᵢ = nᵢ ℏ.

Definition H.2 — Common Traps
  • Hamiltonian is not always total energy: it equals energy only under standard natural-system assumptions.
  • Phase space doubles variables: q and p are independent coordinates, not position and velocity written twice.
  • Canonical transformations preserve structure: not every coordinate change preserves Poisson brackets.
  • Liouville preserves volume, not shape: a phase-space blob can stretch and fold while keeping the same volume.
  • Action-angle variables require integrability: chaotic systems generally do not admit global action-angle coordinates.
Exercises — H.1–H.4 Hamiltonian Mechanics
1.
A harmonic oscillator has spring constant k=400N/mk = 400 N/m and mass m=10kgm = 10 kg. Find ω0\omega_{0}.
rad/s
Straightforward
2.
State the Jacobian determinant of the time-evolution map for a Hamiltonian system, by Liouville's theorem.
Straightforward
3.Write the Hamiltonian for a simple pendulum and derive Hamilton's equations. Identify the fixed points in phase space.
Straightforward
4.Compute the action variable J for a harmonic oscillator. Show that E=ωJE = \omega J, and derive the quantization E=nℏωE = n\hbar\omega.
Intermediate
5.Verify Liouville's theorem explicitly for the harmonic oscillator by computing the Jacobian of the time-evolution map.
Intermediate
6.Compute the Poisson bracket {Lx,Ly}\{L_x, L_y\} for angular momentum components. Show the result equals LzL_z. How does this relate to quantum mechanics?
Challenging
Key Takeaways
  • Hamiltonian H=∑piq˙i−L=T+VH = \sum p_{i}\dot{q}_{i} - L = T + V for natural systems.
  • Hamilton's equations: q˙=∂H/∂p,p˙=−∂H/∂q—\dot{q} = \partial H/\partial p, \dot{p} = -\partial H/\partial q — symmetric, first-order.
  • Phase space flow preserves volume (Liouville's theorem) — phase space trajectories never cross.
  • Poisson bracket of A with H vanishes ↔ A is conserved. Structure mirrors quantum commutators.
  • Canonical transformations preserve Poisson brackets — symplectic structure.
  • Action-angle variables: integrable systems → uniform rotation on a torus. J=nℏJ = n\hbar gives semiclassical quantization.