Module 1 · 15 min read · Free chapter
Hamiltonian mechanics: Hamilton's equations, phase space, Poisson brackets and canonical transformations
The Hamiltonian H = sum of p q-dot minus L, written in coordinates and momenta, gives first-order equations: q-dot = dH/dp and p-dot = -dH/dq. The time change of any quantity is its Poisson bracket with H plus its explicit time derivative. A transformation is canonical when the new pair has Poisson bracket 1. Liouville's theorem says phase-space volume is conserved.
Start from zero: positions and momenta on equal footing
Lagrange's method describes a system by its coordinates and their rates of change. In 1833 Hamilton rewrote it using coordinates and momenta as independent variables. Instead of n second-order equations, one gets 2n first-order ones with a beautiful symmetry between q and p.
The state of the system becomes a single point in a 2n-dimensional phase space, and its whole future is a curve through that space. This picture is the language of statistical mechanics, of chaos theory and of quantum mechanics, where Hamilton's function H becomes the operator that drives the Schrödinger equation.
This chapter derives Hamilton's equations, solves standard UPSC problems, introduces Poisson brackets and canonical transformations, and ends with Liouville's theorem. It builds on Hamilton's principle and symmetries.
Derivation: from Lagrangian to Hamiltonian
Legendre transformation. Define the momenta and the Hamiltonian
where every on the right is to be expressed in terms of q and p. This is the energy function h of the last chapter, now written as a function of momenta.
Two expressions for dH. As a function of (q, p, t),
From the definition, . The terms cancel because , and Lagrange's equation gives . So
Hamilton's canonical equations. Comparing coefficients,
Along the motion, , so H is conserved when it does not contain t. A cyclic coordinate is missing from H as well as from L, and its momentum is constant.
Recipe. (1) Write L. (2) Find each and solve for .
(3) Form in terms of q and p only. (4) Write the 2n equations. For a particle in a potential, , the total energy.
Worked examples: oscillator and planetary motion (IFoS 2017)
Harmonic oscillator. gives and , which together give . In the (q, p) plane each orbit is the ellipse H = E, with semi-axes and . Its area is . In the old quantum theory, setting this area equal to nh gave the oscillator energies.
Pendulum. . Small energies give near-ellipses. At E = mgl the orbit, called the separatrix, just reaches the inverted position. Above it the pendulum whirls round, and the phase curves no longer close.
Planetary motion. For in plane polar coordinates,
Hamilton's equations give , , and
This is the differential equation of the orbit; with it becomes , whose solution is a conic (see the Kepler problem).
Areal velocity. θ is cyclic, so is constant. The area swept per unit time is , which is therefore constant: Kepler's second law.
Worked example: a Lagrangian with constant vectors (IFoS 2024)
Given , with , , constant vectors.
Momentum. , so .
Hamiltonian. Write . Then , and . Hence
Canonical equations.
Combining, : motion under a constant force, like a projectile. The vectors and change the momenta but not the physics. The term is a total time derivative, and the shift by is a change to a frame moving uniformly. Both leave the equations of motion unchanged, as the last chapter showed.
Worked example: an electron in crossed fields (Geo-Scientist 2023, 2026)
General Hamiltonian. From , the canonical momentum is , and
It is still kinetic plus potential energy, but written with the canonical momentum.
Fields , (2023). Choose and , which give and . For an electron, q = −e:
Canonical equations.
y and z are cyclic, so and are constant: free motion along the magnetic field, and a conserved canonical momentum along y.
The drift. The x-equation becomes , and . Their solution is a circular gyration plus a steady drift with , that is
The drift does not depend on the sign or size of the charge, so electrons and ions drift together, and no current flows from it. This E × B drift shapes plasma flow in the ionosphere and in fusion devices.
Fields , (2026). The same steps with and give . Now x is cyclic, and the drift is .
Poisson brackets and constants of motion (Geo-Scientist 2023, 2025, 2026)
Definition and equation of motion. For any F(q, p, t), the chain rule and Hamilton's equations give
F is a constant of motion if . The fundamental brackets are and . Hamilton's equations themselves read , .
Properties. Brackets are antisymmetric, , linear, obey the product rule, and satisfy the Jacobi identity .
Worked example 1 (2023). For and ,
Since , : u is a constant of motion. It encodes the oscillator's phase.
Worked example 2: Poisson's theorem (2026). Let F and G be constants of motion. Then .
By the Jacobi identity, . Substituting and , this equals , which exactly cancels . So is also a constant of motion.
Worked example 3: angular momentum (2025). With and , only the pairs (z, p_z) contribute:
By cyclic permutation, . So if and are conserved, Poisson's theorem says is too. In quantum mechanics the same relations become .
Canonical transformations (Geo-Scientist 2025)
Idea. In Lagrangian mechanics we may change coordinates freely. In Hamiltonian mechanics we may go further and mix coordinates and momenta: (q, p) → (Q, P). Such a change is canonical if the new variables still obey Hamilton's equations, with some new Hamiltonian K(Q, P, t).
Poisson-bracket test. A transformation is canonical if and only if it preserves the fundamental brackets. For one degree of freedom, this means
Geometrically, the map preserves areas in the phase plane.
Worked example (2025). For and :
The transformation is canonical if and only if . For instance, b = 0 and c = −1 gives Q = p + iaq, P = −q, a canonical map for any a.
Simple examples. Q = p, P = −q swaps the roles of coordinate and momentum: . This shows that in Hamiltonian mechanics "coordinate" and "momentum" are labels, not fixed physical types.
Why bother? A clever canonical transformation can make every new coordinate cyclic, so all the new momenta are constant and the problem is solved. The harmonic oscillator becomes trivial in action-angle variables, where and the angle increases uniformly. This is the route to Hamilton-Jacobi theory, perturbation theory of planetary orbits, and the classical limit of quantum mechanics.
Deep dive: Liouville's theorem
Take not one system but a cloud of copies, each starting from a slightly different point in phase space. As time passes, every point moves along its own trajectory and the cloud changes shape. Liouville's theorem says its volume in phase space never changes.
Proof in one line. The "velocity" of a phase point is . Its divergence is
so the flow in phase space is incompressible, like water. The density of points ρ obeys .
Consequences.
- In a pendulum, a small square of starting states near the separatrix is stretched into a long thin filament, but its area stays fixed. Stretching plus folding is how chaos arises without breaking Liouville's theorem.
- With friction the theorem fails: all trajectories spiral into the rest state and phase volume shrinks to a point.
- In statistical mechanics, Liouville's theorem justifies giving equal weight to equal volumes of phase space, the foundation of the microcanonical ensemble.
- Particle accelerators cannot shrink a beam's phase-space volume (its emittance) with magnets alone. Special cooling methods, which won Simon van der Meer a share of the 1984 Nobel Prize, are needed.
Critiques and debates: Lagrange or Hamilton?
For solving a typical mechanics problem, the Hamiltonian method is rarely quicker: you must first build L anyway. Its value lies in structure.
| Feature | Lagrangian | Hamiltonian |
|---|---|---|
| Variables | n coordinates q and velocities q̇ | 2n independent q and p |
| Equations | n second-order | 2n first-order |
| Natural space | configuration space | phase space |
| Allowed changes of variable | point transformations of q | canonical transformations mixing q and p |
| Natural home | field theory, relativity (Lorentz invariant) | statistical mechanics, chaos, quantum mechanics |
| Quantum link | path integral (Feynman) | operators and commutators (Dirac) |
Paul Dirac noticed in 1925 that the classical Poisson bracket becomes in quantum mechanics. This single rule turns Hamiltonian mechanics into Heisenberg's matrix mechanics.
Concept clarifications: commonly confused ideas
Writing a 20-mark answer
Question: "Obtain Hamilton's canonical equations from the Lagrangian. Construct the Hamiltonian of an electron in uniform fields and , write the canonical equations and identify the conserved quantities." (20 marks)
- Legendre transform (6 marks). Define p and H; compare two forms of dH; the three results including .
- Electron Hamiltonian (5 marks). Choice of φ and with a check of and ; .
- Canonical equations (5 marks). Six equations; cyclic y and z.
- Interpretation (4 marks). Conserved , , H; E × B drift independent of charge; Poisson-bracket check .
Mains practice: questions to try
These are practice questions written by us, not past papers. The UPSC questions on this topic are shown in the previous year questions panel.
| # | Question | Marks | What it tests |
|---|---|---|---|
| 1 | Write the Hamiltonian of a particle in a central potential in spherical polar coordinates and identify the cyclic coordinate. | 10 | Hamiltonian construction |
| 2 | Show that and , and interpret them as rotations. | 10 | Poisson brackets |
| 3 | Show that , is canonical. | 10 | canonical test |
| 4 | Find the action-angle variables of the harmonic oscillator and recover its frequency. | 15 | action-angle |
| 5 | Show by direct calculation that the area of a small rectangle in the phase plane of a free particle is preserved in time. | 10 | Liouville |
Quick revision
- in q, p; , ; .
- Oscillator ellipse area ; pendulum separatrix at E = mgl.
- Kepler: ; constant, areal velocity .
- Charge: ; drift .
- ; ; ; Poisson's theorem via Jacobi identity.
- Canonical if (e.g. ); Liouville: phase volume conserved.