Foundations of Hamiltonian Mechanics
Hamiltonian mechanics rewrites dynamics in terms of generalized coordinates \(q\) and conjugate momenta \(p\). The central object is the Hamiltonian \(H(q,p,t)\), typically equal to total energy. Time evolution is generated by \(H\) through a symmetric pair of first order equations. The method does not compete with Newton or Lagrange. It reframes them into a representation where geometry and symmetry become visible, which is why this approach sits at the doorway to quantum theory and statistical mechanics.
For a broad class of mechanical systems one writes \[ H(q,p,t)=T(p)+V(q,t), \] with \(T\) the kinetic term expressed in momenta and \(V\) the potential written in coordinates. This separation is convenient rather than required. The key feature is that both \(q\) and \(p\) are treated on equal footing, which produces a balanced and often simpler description of motion.

Hamilton’s Equations
The equations of motion are \[ \dot{q}_i=\frac{\partial H}{\partial p_i},\qquad \dot{p}_i=-\frac{\partial H}{\partial q_i}. \] They convert one second order equation into two first order relations. The number of equations doubles, yet the symmetry between position and momentum makes analysis cleaner. In this view, trajectories are streamlines of a vector field on phase space defined by the gradients of \(H\).
Consider the one dimensional harmonic oscillator \[ H(q,p)=\frac{p^2}{2m}+\frac{1}{2}m\omega^2 q^2. \] Hamilton’s equations give \(\dot q=p/m\) and \(\dot p=-m\omega^2 q\). Solutions are sinusoidal and the phase portrait is an ellipse. The entire family of solutions is organized by the single constant \(H=E\), which labels the ellipse on which the motion stays forever.
Phase Space and Energy Surfaces
Phase space is the set of all possible pairs \((q_i,p_i)\). A single point specifies a complete mechanical state. The Hamiltonian defines level sets \(H(q,p)=E\) that act as energy surfaces. Trajectories flow on these surfaces and never jump between them when the system is isolated. This picture converts dynamics into geometry and makes conserved quantities appear as hidden flat directions along which motion slides without resistance.
For a simple pendulum with angle \(\theta\) and conjugate momentum \(p_\theta\), \[ H(\theta,p_\theta)=\frac{p_\theta^2}{2ml^2}+mgl\,(1-\cos\theta). \] Low energies produce closed curves corresponding to oscillations. High energies cross the separatrix and become rotations. The phase portrait displays all behaviors at once and shows where small changes in energy cause qualitative changes in motion.

From Lagrangian to Hamiltonian
The Hamiltonian is obtained from the Lagrangian \(L(q,\dot q,t)\) by a Legendre transform. Define \(p_i=\partial L/\partial \dot q_i\), then \[ H(q,p,t)=\sum_i p_i\dot q_i-L(q,\dot q,t). \] After replacing \(\dot q\) in favor of \(p\), the result depends on \((q,p,t)\) only. This exchange makes momentum the central dynamical variable and prepares the stage for the operator language of quantum theory where position and momentum act on states.
Canonical Transformations
A canonical transformation maps \((q,p)\) to new variables \((Q,P)\) while preserving Hamilton’s equations. The physics is unchanged although the coordinates look different. Such transformations are generated by functions \(F\) and often simplify problems. In periodic systems one seeks action–angle variables \((J,\phi)\) that convert complicated motion into uniform rotation, which turns integration into straightforward quadrature.
As an illustration, the planar central force problem admits a transformation to separate radial and angular degrees of freedom. The conserved angular momentum becomes a constant \(J_\phi\). The reduced radial motion then behaves like a one dimensional system in an effective potential that includes the centrifugal term. Canonical structure exposes this separation cleanly.
Poisson Brackets and Time Evolution
For any two phase space functions \(f(q,p,t)\) and \(g(q,p,t)\), the Poisson bracket is \[ \{f,g\}=\sum_i\left(\frac{\partial f}{\partial q_i}\frac{\partial g}{\partial p_i}-\frac{\partial f}{\partial p_i}\frac{\partial g}{\partial q_i}\right). \] Time evolution is compactly written as \[ \dot f=\{f,H\}+\frac{\partial f}{\partial t}. \] Fundamental brackets read \(\{q_i,p_j\}=\delta_{ij}\), while \(\{q_i,q_j\}=0\) and \(\{p_i,p_j\}=0\). This algebra mirrors the commutator structure that appears when the theory is quantized.
Liouville’s Theorem
Hamiltonian flow preserves phase space volume. If one follows a cloud of nearby states as they move under the equations of motion, the cloud may stretch and fold but its total volume remains unchanged. This result is Liouville’s theorem and it forms the backbone of equilibrium statistical mechanics. Probability densities evolve without artificial compression, which keeps normalization and entropy accounting consistent.
Integrability and Action–Angle Variables
A system with as many independent conserved quantities in involution as degrees of freedom is called integrable. In such cases one can construct action–angle coordinates \((J_i,\phi_i)\) where \(H=H(J)\) and the equations reduce to \(\dot J_i=0\), \(\dot\phi_i=\omega_i(J)\). Motion becomes uniform on invariant tori. The harmonic oscillator and Kepler problem are classical examples. When integrability breaks, nearby invariant tori can shred into chaotic seas, which introduces rich structures such as islands and cantori in phase portraits.
Worked Examples
Free particle: \(H=p^2/2m\). One finds \(\dot q=p/m\) and \(\dot p=0\). Position grows linearly and momentum stays fixed.
Harmonic oscillator: \(H=p^2/2m+\tfrac{1}{2}m\omega^2 q^2\). Energy sets the ellipse in phase space. The period does not depend on amplitude.
Pendulum: \(H(\theta,p_\theta)=p_\theta^2/(2ml^2)+mgl(1-\cos\theta)\). The separatrix at energy \(2mgl\) divides oscillations from rotations.
Central force: \(H=\tfrac{p_r^2}{2m}+\tfrac{L^2}{2mr^2}+V(r)\). Conservation of \(L\) follows from rotational symmetry and reduces the problem to one dimension in an effective potential.
Symmetry and Conservation
Continuous symmetries generate conserved quantities. In the Hamiltonian language, if a function \(G(q,p)\) generates a canonical transformation that leaves \(H\) unchanged, then \(G\) is conserved and \(\{G,H\}=0\). Spatial translation symmetry produces linear momentum. Rotational symmetry yields angular momentum. Time translation symmetry yields energy conservation. These facts echo Noether’s theorem and explain why invariants guide motion so reliably.
Bridge to Quantum Theory
Quantization replaces Poisson brackets with commutators and the Hamiltonian with an operator that drives time evolution, \[ i\hbar\,\frac{\partial}{\partial t}\,\lvert\psi\rangle=\hat H\,\lvert\psi\rangle. \] Classical constants of motion become operators that commute with \(\hat H\). Spectra of \(\hat H\) give energy levels and selection rules for transitions. The classical structure is not discarded. It becomes the semiclassical limit that explains interference, tunneling, and adiabatic invariants.
Numerical Methods and Structure Preservation
Generic integrators can drift in energy over long times. Symplectic integrators respect the Hamiltonian structure and keep qualitative behavior correct for very long simulations. They preserve phase space area step by step and therefore maintain faithful orbits in celestial mechanics or molecular dynamics where tiny secular drifts would otherwise spoil results.
Scope and Limits
The Hamiltonian method excels for conservative systems. Nonconservative forces can be incorporated with extended phase spaces, Rayleigh dissipation terms, or contact Hamiltonian variants, yet the pure geometric elegance is clearest when energy is conserved. Constrained systems, such as rigid bodies or gauge fields, require care with primary and secondary constraints. Dirac’s procedure extends the formalism and remains standard for modern field theories.