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.

PrerequisitesLagrangianmechanics(Ch.L)PartialderivativesPhasespaceconceptLagrangian mechanics (Ch. L) \cdot Partial derivatives \cdot 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=Lq˙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:

H(q,p,t)=ipiq˙iL(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.1Hamilton's Equations
The equations of motion in Hamiltonian mechanics are:q˙i=\partialH/\partialpip˙i=\partialH/\partialqiq̇_{i} = \partialH/\partialp_{i} \qquad ṗ_{i} = -\partialH/\partialq_{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.1Harmonic Oscillator in Phase Space

Amassmonaspring(k):L=12mx˙212kx2.WriteHamiltonsequationsanddescribethephaA mass m on a spring (k): L = \frac{1}{2}mẋ^{2} - \frac{1}{2}kx^{2}. Write Hamilton's equations and describe the phase portrait.

Conjugate momentum:p=\partialL/x˙=mx˙(theordinarylinearmomentump = \partialL/\partialẋ = mẋ \qquad (the ordinary linear momentum
Hamiltonian:H=px˙L=p2/(2m)+12kx2(kinetic+potential,asexpectedH = pẋ - L = p^{2}/(2m) + \frac{1}{2}kx^{2} \qquad (kinetic + potential, as expected
Hamilton's equations:ẋ = \partialH/\partialp=p/mp˙=\partialH/\partialx=kx\partialH/\partialp = p/m \qquad ṗ = -\partialH/\partialx = -kx
Eliminating p:ṗ = mx¨=kxx¨+(k/m)x=0(recoversNewtonmẍ = -kx \to ẍ + (k/m)x = 0 ✓ (recovers Newton
Phase portrait:H=E=constdefinesanellipsein(x,p)space:x2/(2E/k)+p2/(2mE)=1.EveryorbitisH = E = const defines an ellipse in (x, p) space: x^{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.1Liouville'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=0whereΓ=dnqdnpdΓ/dt = 0 \qquad where Γ = \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), andtheseparatrixitself(infiniteperiodorbit).Doublewell:twostablefixedpointsat±d the separatrix itself (infinite-period orbit). Double well: two stable fixed points at \pm

H.3 Poisson Brackets

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

{f,g}=i(fqigpifpigqi)\{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}+At\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.2Angular Momentum Conservation via Poisson Brackets

ForacentralforceH=p2/(2m)+V(r),showthatLz=xpyypxisconservedFor a central force H = p^{2}/(2m) + V(r), show that Lz = xpy - ypx is conserved.

Compute {Lz, H}:{Lz,p2/2mLz, p^{2}/2m} + {Lz, V(r)}
First term:{xpy,px2/2mxpy, px^{2}/2m} + {xpy,py2/2mxpy, py^{2}/2m} + {ypx-ypx, ...}: evaluates to py(-px/m) + (-py)(px/m)... careful algebra gives 0.
Second term:{xpyypx,V(rxpy - ypx, V(r} = py\partialV/\partialxpx\partialV/\partialy.Since\partialV/\partialx=(x/r)V(r)etc.,crosstermscancelexactlypy \partialV/\partialx - px \partialV/\partialy. Since \partialV/\partialx = (x/r)V'(r) etc., cross terms cancel exactly
Result:{Lz, H} = 0LzconservedforanycentralV(r).AngularmomentumisconservedbecauseHhasno0 \to Lz conserved for any central V(r). ✓ \qquad Angular momentum is conserved because H has nodependence — 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πpidqiθ˙i=ωi=HJi=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.2Common 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.
Aharmonicoscillatorhasspringconstantk=400N/mandmassm=10kg.Findω0A harmonic oscillator has spring constant k = 400 N/m and mass m = 10 kg. Find \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.ComputetheactionvariableJforaharmonicoscillator.ShowthatE=\omegaJ,andderivetheCompute the action variable J for a harmonic oscillator. Show that E = \omegaJ, and derive the quantizationE=nωquantization 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} for angular momentum components. Show the result equals Lz. How does this relate to quantum mechanics?
Challenging
Key Takeaways
  • HamiltonianH=piq˙iL=T+VfornaturalsystemsHamiltonian H = \sum p_{i}q̇_{i} - L = T + V for natural systems.
  • Hamiltonsequations:q˙=\partialH/\partialp,p˙=\partialH/\partialqsymmetric,firstorderHamilton's equations: q̇ = \partialH/\partialp, ṗ = -\partialH/\partialq — symmetric, first-order.
  • Phase space flow preserves volume (Liouville's theorem) — phase space trajectories never cross.
  • PoissonbracketA,H=0Aisconserved.StructuremirrorsquantumcommutatorsPoisson bracket {A,H} = 0 ↔ A is conserved. Structure mirrors quantum commutators.
  • Canonicaltransformationspreserveq,p=1symplecticstructureCanonical transformations preserve {q,p} = 1 — symplectic structure.
  • Actionanglevariables:integrablesystemsuniformrotationonatorus.J=ngivessemAction-angle variables: integrable systems \to uniform rotation on a torus. J = n\hbar gives semiclassical quantization.