Module 2: Classical mechanics · Lesson 2.2 · about 50 min
Hamiltonian mechanics and phase space
The Legendre transform from L to H, Hamilton's equations, when H is the energy and when it is conserved, phase space and phase portraits, the pendulum's separatrix, Liouville's theorem, the Routhian, action variables and adiabatic invariants.
Module 2 · about 50 minutes. By the end you will be able to build a Hamiltonian from a Lagrangian, write and solve Hamilton’s equations, tell when H is conserved and when it is the energy, sketch and read phase portraits, use Liouville’s theorem, and use adiabatic invariants for slowly changing systems.
This lesson builds on lesson 2.1, Lagrangian mechanics.
1. The Legendre transform
The Lagrangian is a function of and . To use the momentum as a variable instead of , take the Legendre transform:
The last step matters: must be a function of and only. Leaving a in it is the commonest mistake. The transform works when can be solved for (the matrix is invertible).
Worked example: polar coordinates. gives and . Then , , and
Worked example: a charge. From , , so . The rule (minimal coupling) carries over directly into quantum mechanics.
2. Hamilton’s equations
Take the differential of and use the Euler-Lagrange equation :
- (q, p)
- a point in phase space: 2n numbers that fix the state completely, so the future follows from them alone
- q̇ = ∂H/∂p
- the velocity follows from the momentum (for H = p²/2m + V it is just p/m)
- ṗ = −∂H/∂q
- the force: momentum changes as H falls with q
- dH/dt = ∂H/∂t
- H is conserved whenever it has no explicit time dependence
- Physical meaning
- H is the generator of time evolution. Knowing one function of (q, p) tells you how every point of phase space moves in the next instant.
A cyclic coordinate is even more useful here: if is missing from , then is a constant number and can be put straight into , which then has one fewer degree of freedom. In the central-force above, and the radial problem is .
Worked example. . Hamilton’s equations give and , so . In phase space the orbits are ellipses with area .
The same equations follow from a variational principle in phase space, , with and varied independently. That form is the starting point for canonical transformations in lesson 2.3.
3. Is H the energy? Is it conserved?
These are two separate questions, and exams test both.
| Situation | H conserved? | H = T + V? |
|---|---|---|
| fixed constraints, V(q) only | yes | yes |
| coordinates have explicit t (spinning hoop, rotating frame) but L has no explicit t | yes | no |
| explicit t in L (a driven oscillator, V = −qE₀x cos ωt) | no | yes, if coordinates are fixed |
Worked example: a rotating frame. In a frame turning at constant , a free particle in potential has . Then , the inertial momentum, and
It is conserved (no explicit ) but is the inertial energy minus . In celestial mechanics this is the Jacobi integral of the restricted three-body problem, and it fixes where the Lagrange points are.
4. Phase portraits and the pendulum
For one degree of freedom with , each orbit lies on a curve , so the whole motion can be drawn as a phase portrait without solving anything. Fixed points are where : a minimum of is a centre (closed orbits around it, stable), a saddle is a hyperbolic point (unstable).
The pendulum has :
E just above −mgl. Small ellipses round θ = 0: simple harmonic motion with period 2π√(l/g).
Larger E < mgl. Closed but squashed orbits: the pendulum still swings back and forth (libration), and the period grows with amplitude.
E = mgl, the separatrix. The orbit runs into the inverted position θ = ±π, taking infinite time to get there. It separates swinging from spinning.
E > mgl. Open wavy curves: the pendulum goes over the top and keeps turning (rotation), with p never zero.
The exact period for amplitude is , with the complete elliptic integral. For small amplitudes, . At 30° the correction is about 1.7%.
5. Liouville’s theorem
Think of many copies of the same system, started at slightly different points: a cloud of points in phase space. Hamilton’s equations make the cloud flow like a fluid, and that fluid is incompressible:
The density of points along any flow line stays fixed, so phase-space volume is conserved. Consequences:
- There are no attractors in Hamiltonian systems: friction (which does shrink phase volume) cannot be described by an ordinary time-independent .
- A beam of particles cannot be focused in position without spreading in momentum. Beam “emittance” is a phase-space area, and reducing it needs a non-Hamiltonian process such as cooling.
- In statistical mechanics, a density that depends only on is unchanged by the motion. This is why the microcanonical and canonical ensembles are equilibrium states.
Worked example. Particles in free fall, , start in the square , . After time , and . The square becomes a parallelogram sheared by : same base , same height , so the area is unchanged.
6. The Routhian
Sometimes it pays to Legendre-transform only the cyclic coordinates. The Routhian , written in terms of the conserved , acts as a Lagrangian for the remaining coordinates. For a central force, , and the Euler-Lagrange equation for follows at once with the centrifugal term built in. Note the sign: the centrifugal energy enters with a minus sign, as part of an effective potential.
7. Action variables and adiabatic invariants
For a periodic motion in one degree of freedom, the action
is the area enclosed by the orbit in phase space. Its use is that it survives slow change: if a parameter (the length of a pendulum, the stiffness of a spring, a magnetic field) changes over many periods, stays very nearly constant even though the energy does not. It is an adiabatic invariant.
Worked example. For an oscillator . Stiffen the spring slowly until doubles: doubles too. Because , the amplitude falls as , so it drops by . The same rule in old quantum theory, , gave , which is why quantum numbers do not jump when a potential is changed slowly.
Other examples: a gas compressed slowly in a box (the action of each bouncing molecule is fixed, which gives the adiabatic law = constant for a monatomic gas), and a charged particle gyrating in a slowly changing magnetic field, whose magnetic moment stays fixed. That is what makes magnetic mirrors and the Van Allen belts trap particles.
“Slow changes keep the energy fixed.” They keep the action fixed, not the energy. A slowly shortened pendulum gains energy (the hand pulling the string up does work against the tension, which is larger than average while the bob swings fast at the bottom). The energy goes up as does, keeping constant.
Writing as a function of action alone, , gives the frequency at once: . For the oscillator , so , as it should be. The angle variable conjugate to then grows uniformly in time; this action-angle picture is the language of perturbation theory and of the KAM theorem on which orbits survive a small perturbation.
- , written in only; .
- Hamilton’s equations: , ; .
- is conserved when it has no explicit ; it is when the coordinates have no explicit . A rotating frame gives .
- Charge: .
- Phase portraits: minima of are centres, saddles are unstable; the pendulum’s separatrix divides swinging from spinning.
- Liouville: phase-space volume is conserved; no attractors without dissipation.
- Action is an adiabatic invariant; for an oscillator is fixed and ; .
Practise: exam questions on this lesson
They start easy and climb to top-rank level. More on the Hamiltonian mechanics practice page.
Before this: lesson 2.1, Lagrangian mechanics. Next: lesson 2.3, Poisson brackets and canonical transformations. Basics: the JAM lesson on simple harmonic motion.
Going on to CSIR NET? Phase space, fixed points and stability reads Hamilton’s equations as a flow in phase space.
Check yourself
Sources
- H. Goldstein, C. Poole and J. Safko, Classical Mechanics, 3rd ed. (2002), chapters 8 and 10
- L. D. Landau and E. M. Lifshitz, Mechanics, 3rd ed. (1976), chapter 7
- V. I. Arnold, Mathematical Methods of Classical Mechanics, 2nd ed. (1989), chapters 3 and 9
- GATE Physics syllabus (Classical Mechanics), IIT organising institute; CSIR-UGC NET Physical Sciences syllabus, Part A Classical Mechanics
Your ticks stay in this browser. Save them as a file on the course home.
Updated 2026-11-22. Not affiliated with the IITs, IISc or the GATE organising institute. The general aptitude part of GATE is not covered here. Check the official GATE website for the current pattern. All questions are original.