Hamiltonian mechanics lives in phase space: the 2n-dimensional space with coordinates (q1,…,qn,p1,…,pn). Each point in phase space represents a complete state of the System (positions and momenta).
A phase portrait is the collection of trajectories in phase space. For a 1D harmonic oscillator, the trajectories are ellipses in the (x,p) plane.
Theorem 4.2 (Liouville’s Theorem). The flow in phase space is incompressible: the phase space volume is conserved along trajectories. Equivalently, the phase space density ρ(q,p,t) satisfies:
dtdρ=∂t∂ρ+∑j(∂qj∂ρq˙j+∂pj∂ρp˙j)=0
Proof. Consider a volume Ω in phase space. The rate of change of the volume is:
dtd∫Ωρdqdp=∫Ω∂t∂ρdqdp
By the continuity equation in 2n dimensions:
∂t∂ρ+∇⋅(ρv)=0
Where v=(q˙1,…,q˙n,p˙1,…,p˙n) is the phase space velocity. Using Hamilton’s equations:
By equality of mixed partial derivatives. Therefore:
∂t∂ρ+ρ(∇⋅v)+v⋅∇ρ=∂t∂ρ+v⋅∇ρ=dtdρ=0
■
Intuition. Liouville’s theorem is the classical analogue of unitarity in quantum mechanics. It tells us that phase space volume is conserved --- like an incompressible fluid flowing through phase space. This underlies the ergodic hypothesis of statistical mechanics.
Expanding and collecting terms, the second-order mixed partial derivatives cancel in groups of three (by equality of mixed partials), yielding the Jacobi identity. ■
Theorem 4.5. A quantity f is a constant of motion if and only if ∂f/∂t+{f,H}=0. If f does not depend explicitly on time, f is conserved if and only if {f,H}=0.
Definition. Hamilton’s principal function S(q,t) is the action evaluated along the classical path from (q0,t0) to (q,t).
Theorem 4.6 (Hamilton-Jacobi Equation). The function S satisfies:
H(q1,…,qn,∂q1∂S,…,∂qn∂S,t)+∂t∂S=0
This is a first-order nonlinear PDE in n+1 variables.
Proof. The action from t0 to t is S=∫t0tLdt′. The total time derivative is:
dtdS=L
But S=S(q1(t),…,qn(t),t) So by the chain rule:
dtdS=∑j∂qj∂Sq˙j+∂t∂S=L
From the definition of the conjugate momentum, pj=∂L/∂q˙j=∂S/∂qj (this can be shown rigorously by varying the endpoint). Therefore:
L=∑jpjq˙j+∂t∂S=H+∂t∂S
Since dS/dt=L:
H+∂t∂S=L=∑jpjq˙j+∂t∂S
Which gives H+∂S/∂t=0. ■
Intuition. The Hamilton-Jacobi equation is the bridge between classical and quantum mechanics. Schrodinger’s equation can be obtained from it via the substitution S=−iℏlnψ (up to constants), making S the classical limit of the quantum phase.
Separation of Variables. If H does not depend explicitly on tWrite S(q,t)=W(q)−Et. Then the time-independent Hamilton-Jacobi equation is:
H(q1,…,qn,∂q1∂W,…,∂qn∂W)=E
Where W is Hamilton’s characteristic function and E is the constant energy.
4.10 Worked Example: Hamilton-Jacobi for the Harmonic Oscillator
Hamiltonian mechanics is like switching from a video recording of motion to a snapshot of all possible states. While the Lagrangian tracks positions and velocities over time, the Hamiltonian lives in phase space where every point represents a complete snapshot of where something is and how fast it is going. Hamilton’s equations are beautifully symmetric: the rate of change of position depends on how energy changes with momentum, and the rate of change of momentum depends on how energy changes with position. Liouville’s theorem tells us that if you paint a region of phase space, its volume stays the same as it flows around like incompressible paint. This is why statistical mechanics works: the phase space volume that encodes all possible states of a system is preserved under time evolution.
Mistake 1: Assuming the Hamiltonian always equals T+V The Hamiltonian equals the total energy H=T+V only when the potential is velocity-independent and the coordinate transformation is scleronomic. For systems with velocity-dependent potentials (like charged particles in electromagnetic fields) or rheonomic constraints, H=T+V even though H is still conserved when ∂L/∂t=0.
Mistake 2: Confusing canonical momentum with mechanical momentum Canonical momentum pj=∂L/∂q˙j is not always equal to mechanical momentum mq˙j. For a charged particle in a magnetic field, the canonical momentum includes the vector potential: p=mv+qA. Always derive canonical momentum from the Lagrangian, not from mv.
Mistake 3: Misapplying Poisson brackets The Poisson bracket {f,g} is antisymmetric: {f,g}=−{g,f}. A common error is forgetting this sign when computing brackets of position and momentum. The fundamental brackets are {qj,pk}=δjk, {qj,qk}=0, and {pj,pk}=0. Mixing up the order changes the sign.