Hamiltonian Mechanics & Phase Space
Hamiltonian Mechanics & Phase Space
The Hamiltonian formulation replaces the $n$ second-order Lagrange equations with $2n$ first-order equations — a trade that makes the structure of mechanics far more transparent. The transition from Lagrangian to Hamiltonian mechanics is accomplished by the Legendre transform: $$H(q,p,t)=\sum_i p_i\dot{q}_i-L(q,\dot{q},t),$$ where we express $\dot{q}_i$ in terms of $q_i,p_i$ by inverting $p_i=\partial L/\partial\dot{q}_i$. Hamilton's canonical equations are then $$\dot{q}_i=\frac{\partial H}{\partial p_i},\quad \dot{p}_i=-\frac{\partial H}{\partial q_i}.$$ The $2n$-dimensional space with coordinates $(q_1,\ldots,q_n,p_1,\ldots,p_n)$ is phase space.
Phase space has a fundamentally different character from configuration space. Through every point in phase space passes exactly one trajectory (by uniqueness of solutions to Hamilton's equations), so trajectories never cross. Constant-energy surfaces $H=E$ are $(2n-1)$-dimensional hypersurfaces that trap the motion. Liouville's theorem states that the phase-space volume element $d^nq\,d^np$ is preserved by Hamiltonian flow: the phase-space fluid is incompressible, $d(\text{vol})/dt=0$. This has profound consequences for statistical mechanics (microcanonical ensemble) and for the absence of attractors in conservative systems.
The Hamiltonian formulation is the natural setting for quantisation (the correspondence $p_i\to-i\hbar\partial/\partial q_i$), for statistical mechanics (Liouville's theorem underpins the microcanonical ensemble), and for the study of integrability and chaos (KAM theorem, Arnold diffusion, separatrices in phase space).
Definition — Hamiltonian & Phase Space
The Hamiltonian $H(q,p,t)=\sum_i p_i\dot{q}_i-L$, with $\dot{q}_i$ eliminated via $p_i=\partial L/\partial\dot{q}_i$. Phase space is $\mathbb{R}^{2n}$ with coordinates $(q_i,p_i)$. For time-independent $L$ with $T$ quadratic in $\dot{q}$: $H=T+V$.
Theorem — Hamilton's Canonical Equations & Liouville
The equations of motion are $\dot{q}_i=\partial H/\partial p_i$, $\dot{p}_i=-\partial H/\partial q_i$. Liouville's theorem: the phase-space volume $\Omega=\int d^nq\,d^np$ is constant under Hamiltonian flow: $d\Omega/dt=0$. Equivalently, the divergence of the Hamiltonian vector field vanishes: $\sum_i(\partial\dot{q}_i/\partial q_i+\partial\dot{p}_i/\partial p_i)=0$.
Example 1: Harmonic Oscillator Phase Portrait
$H=p^2/(2m)+\frac{1}{2}m\omega^2 q^2$. Hamilton's equations: $\dot{q}=p/m$, $\dot{p}=-m\omega^2 q$. Trajectories in the $(q,p)$ plane are ellipses $p^2/(2mE)+q^2/(2E/m\omega^2)=1$. The area enclosed by an ellipse of energy $E$ is $\pi\cdot\sqrt{2mE}\cdot\sqrt{2E/m\omega^2}=2\pi E/\omega$, which equals the adiabatic invariant $J=\oint p\,dq=E/\nu$ (action variable).
Example 2: Pendulum Separatrix
$H=p^2/(2ml^2)-mgl\cos\theta$. Level curves: librations (closed orbits, $E
Example 3: Liouville's Theorem — Worked Example
A collection of harmonic oscillators with initial energies uniformly distributed in $[E_0,E_0+\Delta E]$ occupies a thin shell in phase space. As the system evolves, each oscillator moves at its own angular frequency $\omega$, but Liouville's theorem guarantees the shell's volume remains constant. The shell distorts (shears) in shape but not in measure — the foundation of ensemble theory in statistical mechanics.
Example 4: Poincaré Sections & Integrability
For a 2D Hamiltonian system ($n=2$, phase space $\mathbb{R}^4$), if $H$ is the only constant of motion, trajectories fill 3D energy shells ergodically. A Poincaré section (intersecting the trajectory with a 2D plane in phase space) produces a 2D scatter plot. For integrable systems (two constants of motion), the section shows closed curves (KAM tori). As perturbations break integrability, tori shatter into chains of islands and chaotic seas — the onset of Hamiltonian chaos visible in the section.
Practice Problems
- Compute the Hamiltonian for a particle of mass $m$ in 3D subject to a central potential $V(r)$, using spherical coordinates. Identify all cyclic coordinates and their conserved momenta.
- For $H=\frac{p^2}{2m}+V(q)$, prove directly from Hamilton's equations that $dH/dt=\partial H/\partial t$ and hence that $H$ is conserved when $H$ has no explicit time dependence.
- The phase portrait of $H=p^2/2-\cos q$ has separatrices. Find the energy of the separatrix, sketch the qualitatively different orbits, and find the period of small librations near $q=0$.
- Verify Liouville's theorem for the harmonic oscillator by showing that $\partial\dot{q}/\partial q+\partial\dot{p}/\partial p=0$. Then explain why this implies phase-space volume is conserved.
- A 2D isotropic harmonic oscillator has $H=\frac{1}{2m}(p_x^2+p_y^2)+\frac{m\omega^2}{2}(x^2+y^2)$. Find two independent constants of motion beyond $H$ itself, and use them to show all bounded orbits are ellipses.
Show Answer Key
1. In spherical coords: $L = \frac{1}{2}m(\dot{r}^2+r^2\dot{\theta}^2+r^2\sin^2\theta\,\dot{\phi}^2)-V(r)$. $H = \frac{p_r^2}{2m}+\frac{p_\theta^2}{2mr^2}+\frac{p_\phi^2}{2mr^2\sin^2\theta}+V(r)$. Cyclic: $\phi$ (so $p_\phi = mr^2\sin^2\theta\,\dot{\phi}$ conserved — $z$-component of angular momentum). If $V=V(r)$ only, also $t$ is cyclic → $H$ conserved.
2. $\frac{dH}{dt} = \sum(\frac{\partial H}{\partial q_i}\dot{q}_i + \frac{\partial H}{\partial p_i}\dot{p}_i) + \frac{\partial H}{\partial t}$. Hamilton's equations: $\dot{q}_i = \frac{\partial H}{\partial p_i}$, $\dot{p}_i = -\frac{\partial H}{\partial q_i}$. Substituting: $\frac{dH}{dt} = \sum(\frac{\partial H}{\partial q_i}\frac{\partial H}{\partial p_i} - \frac{\partial H}{\partial p_i}\frac{\partial H}{\partial q_i}) + \frac{\partial H}{\partial t} = \frac{\partial H}{\partial t}$. ✓
3. Separatrix energy: $E_{\text{sep}} = V_{\max} = 1$ (at $q=\pi$). For $E<1$: libration (bounded oscillations near $q=0$). For $E>1$: rotation (unbounded). For $E=1$: separatrix (infinite-period orbit approaching the unstable point). Small librations near $q=0$: $H \approx p^2/2 + q^2/2$, period $T = 2\pi$.
4. $\dot{q} = \partial H/\partial p = p/m$, $\dot{p} = -\partial H/\partial q = -V'(q)$. $\frac{\partial\dot{q}}{\partial q} = 0$, $\frac{\partial\dot{p}}{\partial p} = 0$. Sum $= 0$ ✓. This means $\nabla_{(q,p)}\cdot(\dot{q},\dot{p})=0$: the phase-space flow is incompressible, so any region's area (volume in higher dimensions) is preserved under time evolution.
5. $H = \frac{1}{2m}(p_x^2+p_y^2) + \frac{m\omega^2}{2}(x^2+y^2)$. Constants of motion: $H_x = p_x^2/(2m)+m\omega^2 x^2/2$ and $H_y = p_y^2/(2m)+m\omega^2 y^2/2$ (energy in each direction). Also $L_z = xp_y - yp_x$. Any two of $\{H_x, H_y, L_z\}$ are independent beyond $H$. Bounded orbits: $x(t) = A\cos(\omega t+\alpha)$, $y(t) = B\cos(\omega t+\beta)$ — Lissajous figures that are ellipses.