THE HAMILTONIAN
Position and momentum, two halves of the same thing.
1833, Dublin
William Rowan Hamilton was obsessed, for most of the 1820s, with a question that sounded half-metaphysical: why does light, in going from A to B, take the path it takes? He had built, by 1828, a complete geometric theory of optics in which every ray could be read off from the gradient of a single scalar function. The function told you, at every point, the shortest time to reach it. The rays were the lines along which that function changed fastest.
Then in 1833 he did a thing that nobody had quite anticipated. He took the same mathematical machinery and pointed it at mechanics. Light rays and planet orbits, he showed, were the same type of object — extremals of a variational principle, perpendicular to level sets of a scalar, generated by a function he simply called H.
The reformulation that came out of that analogy is used, today, literally by every physicist who simulates a molecule, a spacecraft trajectory, or the interior of a neutron star. Quantum mechanics took it over wholesale: the Schrödinger equation is i ℏ ∂ψ/∂t = Ĥψ, where Ĥ is the operator version of Hamilton's H. Nothing in twentieth-century physics makes sense without this chapter.
The chapter, fortunately, is short. It is basically one swap — position and velocity go in, position and momentum come out — and everything else follows.
One swap: Legendre transform
The Lagrangian formulation we met in the last topic describes a system by a single function L(q, q̇, t) — kinetic minus potential energy — with the equations of motion derived by extremising the action ∫L dt. The natural variables are position q and velocity q̇.
Hamilton's move is to replace q̇ with a new variable — the conjugate momentum — defined as the derivative of the Lagrangian with respect to velocity:
For a plain Newtonian particle with L = ½m·q̇² − V(q), that definition gives p = m·q̇ — the familiar momentum. For a particle in a magnetic field it gives something richer (p = m·q̇ + qA). For a bead on a rotating wire, something richer still. The definition is general; the special case you already know is just the simplest case.
Now perform the swap. Define the Hamiltonian as
with q̇ eliminated in favour of p via the definition above. This is a Legendre transform — the same algebraic trick that turns internal energy into free energy in thermodynamics. It swaps an independent variable for its conjugate without losing any information.
Hamilton's equations
Plug the definition of H into the Euler-Lagrange equations and two lines of algebra later you have a pair of equations that is the whole dynamical content of classical mechanics:
These are Hamilton's equations. Read them. They are symmetric in q and p, with a single sign keeping the system from collapsing. They are first-order — one derivative each — where the Lagrangian and Newtonian formulations are second-order. A 2N-dimensional state space (N positions, N momenta) evolves as a first-order flow.
That geometry is the point. At each instant the system's state is a single point (q, p). Hamilton's equations hand you a vector field on that state space. The trajectory is just the integral curve of the field. No ambiguity, no integration constants hiding in a corner — you specify where the point starts, and the field tells it where to go next.
For a single particle in a potential V(q), the Hamiltonian is
and Hamilton's equations give q̇ = p/m (which says p = m·q̇, momentum) and ṗ = −∂V/∂q (which says ṗ = F, Newton's second law). Newton falls out as the simplest case, same as before — but now position and momentum live on equal footing.
H is the energy
For any system whose Lagrangian does not explicitly depend on time — which is to say, any isolated system, any system obeying time-translation symmetry — the Hamiltonian equals the total energy:
Kinetic plus potential, on the nose. The plus sign matters: the Lagrangian is T − V, the Hamiltonian is T + V. Subtract to get equations of motion; add to get the conserved quantity.
This is not a coincidence. It is Noether's theorem in its cleanest garb. If H does not explicitly depend on t, then along any trajectory dH/dt = 0 — the energy is constant. Chain-rule this by hand and you'll see the cancellation: Hamilton's two equations are precisely antisymmetric in the one way that makes H itself invariant.
For the simple pendulum, H = p²/(2mL²) − mgL·cos θ, where p = mL²·θ̇ is the angular momentum conjugate to θ. Fix a value of H and you have an equation relating θ and p. Each value of H traces out a curve in the (θ, p) plane. The picture that comes out is exactly the phase portrait we met back in FIG.01:
Small oscillations trace ellipses around the origin. Larger amplitudes trace fatter, deformed ellipses. Go past the top of the swing and closed loops open into flowing curves of rotation. The boundary between the two regimes — the separatrix — is the set of trajectories at exactly H = mgL, just barely over the top. Every mechanical system's qualitative behaviour is in its phase portrait, and the phase portrait is just the level sets of H.
Poisson brackets
Any smooth function f(q, p, t) on phase space has a time derivative along a Hamiltonian trajectory. Chain rule it, plug in Hamilton's equations, and you get a formula that deserves its own name. Define the Poisson bracket of two functions f and g as
Then the time evolution of any observable is
Read that carefully. The Hamiltonian, bracketed against any quantity you care about, tells you how that quantity changes in time. It is the generator of time evolution — the thing that moves everything.
Poisson introduced this bracket in 1809, before Hamilton's reformulation existed, originally as a calculational tool in celestial mechanics. Hamilton picked it up and made it structural. The brackets satisfy three properties that any algebraist would flag as important: antisymmetry , linearity in each slot, and a thing called the Jacobi identity .
These three properties are the definition of a Lie algebra. Poisson was computing in one a century before the structure had a name.
Classical physicists had the algebra of quantum mechanics in their hands for a century without realising it. Every calculation with Poisson brackets done in the 1800s was, up to an ℏ-sized correction, a quantum calculation.
Symplectic structure and Liouville's theorem
Hamilton's equations do something geometrically special. Take any small region in phase space — a cloud of possible initial conditions, each a point (q, p) — and let every point in the cloud evolve under Hamilton's equations. The shape of the cloud will distort wildly over time. Its volume, however, stays exactly the same forever.
This is Liouville's theorem, proved by Joseph Liouville in 1838. It follows from Hamilton's equations in one paragraph: the phase-space velocity field (q̇, ṗ) = (∂H/∂p, −∂H/∂q) is divergence-free — ∂q̇/∂q + ∂ṗ/∂p = ∂²H/∂q∂p − ∂²H/∂p∂q = 0 — so the flow it generates preserves volume. The cross-partials commute and that simple fact is the whole proof.
The preserved object is actually richer than volume. What Hamiltonian flow conserves is a symplectic 2-form — an oriented area element that generalises volume and carries the antisymmetry of the Poisson bracket. "Symplectic" (from Greek symplektikos, "woven together") is the geometric name for phase space done right: positions and momenta intertwined by a single piece of structure.
Symplectic integrators
The theorem is not just pretty. It has a consequence that shows up the next time you open a numerical simulation.
Suppose you want to simulate the solar system on a computer. The simplest way is the forward-Euler method: at each step, take the current state, compute the forces, and push q and p forward by dt times their derivatives. It is the thing any programmer invents in a first-year class.
Forward Euler is not symplectic. It does not preserve phase-space volume. Over many integration steps, the volume grows — and for a bound orbit, that corresponds to the planet spiralling outward, gaining energy it physically should not have.
There is an alternative, barely more complex, called leapfrog (or Störmer-Verlet). It updates p on half-steps and q on full steps, in a pattern that happens to preserve the symplectic 2-form exactly. Leapfrog is first-order simple to code, second-order accurate in dt, and conserves H up to bounded oscillations for any step size, forever. Watch:
Same starting conditions. Same potential. Same step size. The left panel uses forward Euler; its orbit drifts outward orbit after orbit. The right panel uses leapfrog; its orbit traces the same ellipse for as long as you are willing to watch. The readout in each corner shows ΔH, the drift from the initial energy — bounded on the right, creeping upward on the left.
This is not a contrived example. The Jet Propulsion Laboratory's DE ephemerides — the files that tell every spacecraft where every planet will be in 2035 — are computed with symplectic integrators because no non-symplectic scheme stays accurate over the decades of wall-clock integration they require. Your weather model can get away with forward Euler on a one-week forecast. A hundred-million-year solar-system simulation cannot.
What's next
We have a whole new arena. Every classical system — one particle or a trillion — sits as a single point in a space where positions and momenta are drawn in independent directions. Hamilton's equations carve out a flow on that space. Symmetries carve out conserved slices. Poisson brackets turn into commutators, and the classical world turns into the quantum one.
That space has a name, and it deserves its own page.