On this page
Newton starts from forces. Hamiltonian mechanics starts from energy: write it in terms of position and momentum, and two short equations give the motion, as curves you can sketch.
What is Hamiltonian mechanics?
William Rowan Hamilton set out the method in On a general method in dynamics (1834) and a second essay in 1835, reducing dynamics to the study of one central function.
In today's form, you describe the state by a coordinate q and its momentum p, and you write the energy as H(q, p). Hamilton's equations are q̇ = ∂H/∂p and ṗ = −∂H/∂q, as given in Tuckerman's Advanced Statistical Mechanics/01%3A_Classical_mechanics/1.02%3A_The_Hamiltonian_formulation_of_classical_mechanics). For s degrees of freedom they give 2s first-order equations where Lagrange's equations give s second-order ones, and they are usually called the canonical equations (Cline, Variational Principles in Classical Mechanics/08%3A_Hamiltonian_Mechanics/8.03%3A_Hamiltons_Equations_of_Motion)).
Phase space is the plane with q on one axis and p on the other; one point is one complete state, and as time runs it traces a curve. Coming from the Lagrangian? Our Euler–Lagrange equation, step by step is the bridge: p = ∂L/∂q̇.
How do Hamilton's equations work on real examples?
Each example uses only Hamilton's two equations/01%3A_Classical_mechanics/1.02%3A_The_Hamiltonian_formulation_of_classical_mechanics) and algebra you can check.
Free particle. H = p²/2m gives q̇ = p/m and ṗ = 0: constant momentum, so phase curves are horizontal lines.
Harmonic oscillator. H = p²/2m + kq²/2. Then q̇ = p/m and ṗ = −kq, which combine into q̈ = −(k/m)q: simple harmonic motion with ω = √(k/m). Setting H = E gives q²/(2E/k) + p²/(2mE) = 1, an ellipse with semi-axes √(2E/k) along q and √(2mE) along p.
With m = 0.5 kg, k = 50 N/m and E = 1 J: ω = 10 rad/s, amplitude 0.2 m, peak momentum 1 kg m/s. The area, π × 0.2 × 1 = 0.628 J s, equals 2πE/ω. More energy makes a bigger ellipse, but every loop still takes 2π/ω, about 0.63 s.
Pendulum. Take a bob of mass m on a light rigid rod of length L, at angle θ from the bottom, with p = mL²θ̇. Then H = p²/(2mL²) − mgL cos θ, and Hamilton's equations give θ̇ = p/(mL²) and ṗ = −mgL sin θ. Small swings (sin θ ≈ θ) give the oscillator's ellipses; larger ones flatten towards the eye-shaped boundary and take longer per swing, as our large-amplitude pendulum and its elliptic integral works out.
The boundary is the separatrix, E = mgL, just enough energy to reach the top: p = ±2mL²√(g/L) cos(θ/2), through the unstable points θ = ±π. Inside it the pendulum swings; outside it goes over the top. With L = 1 m and g = 9.8 m/s², energy conservation from the bottom gives the dividing speed √(4gL), about 6.26 m/s. A bob on a string needs √(5gL) instead, because the string must stay taut at the top.
Why is the Hamiltonian conserved?
Differentiate along a motion: dH/dt = (∂H/∂q)q̇ + (∂H/∂p)ṗ + ∂H/∂t. Substitute Hamilton's equations and the first two terms cancel, leaving dH/dt = ∂H/∂t. So when H has no explicit time dependence, it is constant. For conservative forces that constant is the total energy, as Tuckerman shows/01%3A_Classical_mechanics/1.02%3A_The_Hamiltonian_formulation_of_classical_mechanics).
So you can draw a phase portrait without solving anything: the level curves of H are the trajectories. Why some numerical methods stay near them is the subject of Verlet and leapfrog integration.
What does Liouville's theorem say about phase space?
Liouville's theorem says the phase-space flow conserves phase-space volume (Structure and Interpretation of Classical Mechanics). Follow a small patch of pendulum states and, as that book shows, it is stretched and sheared but keeps its area; the theorem holds even when H depends on time.
The reason: the flow (q̇, ṗ) has divergence ∂²H/∂q∂p − ∂²H/∂p∂q = 0. Add friction to the oscillator, ṗ = −kq − (b/m)p, and the divergence becomes −b/m: the patch shrinks as every state spirals to rest.
How should you practise Hamiltonian mechanics?
Choose q and find p = ∂L/∂q̇ (for a particle, p = mv).
Write H in q and p, never q̇; for the systems here it is T + V.
Get q̇ = ∂H/∂p and ṗ = −∂H/∂q, and check Newton's law comes back.
Find fixed points, where both are zero, and sketch level curves H = E.
Mark the flow direction and any separatrix, then check one number, such as a period.
If momentum or simple harmonic motion feels shaky, the Fermi Concept Library gives each concept its own lesson and its place in the map. For ideas easier to see than to read, the Fermi Simulation Lab has interactive simulations.
Sketch the pendulum's portrait once by hand, separatrix and all, and the rest of the subject has a picture to hang on.



