Classical Mechanics

Hamilton-Jacobi Equation

All of mechanics squeezed into one equation for the action — and the secret doorway from Newton to Schrödinger

The Hamilton-Jacobi equation reformulates mechanics as a single PDE for the action S: ∂S/∂t + H(q, ∂S/∂q) = 0. Its solution generates every trajectory.

  • The equation∂S/∂t + H(q, ∂S/∂q) = 0
  • S isthe classical action, S = ∫ L dt
  • Gradient givesp = ∂S/∂q (momentum)
  • Geometrytrajectories = rays ⟂ surfaces of constant S
  • Quantum linkψ ~ e^(iS/ℏ) (WKB), HJ recovered as ℏ→0
  • CoinedHamilton (1834), generalized by Jacobi (1837)

Interactive visualization

Press play, or step through manually. Watch the action surface S(q,t) sweep forward while its characteristics — the classical trajectories — peel off perpendicular to every wavefront.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

Definition

The Hamilton-Jacobi equation is a single partial differential equation for one scalar function — the action S(q, t):

∂S/∂t + H(q, ∂S/∂q, t) = 0

The trick is in the second argument of the Hamiltonian. Wherever a canonical momentum p would normally appear, you substitute the gradient of S:

p = ∂S/∂q

That single substitution turns the Hamiltonian — a function of position and momentum — into a function of position and the slope of S. The result is one PDE whose solution, called Hamilton's principal function, contains the entire dynamics of the system. There are no separate equations of motion to integrate: once you know S, you read the trajectories off by differentiation.

S is not an abstract bookkeeping device. It is the classical action:

S(q, t) = ∫ L dt    (along the actual path from a fixed start to (q, t))

where L = T − V is the Lagrangian. The action you minimize in the principle of least action is the very same S that solves the Hamilton-Jacobi equation.

How it works — wavefronts and rays

The deepest way to read the equation is geometric. Fix a value of S and ask: where in space does the action equal that value at time t? The answer is a surface — a wavefront of constant action. As t advances, that surface moves through configuration space like the crest of a wave.

Now consider the momentum. Because p = ∂S/∂q is the gradient of S, momentum always points in the direction of steepest increase of S — that is, perpendicular to the surfaces of constant action. A particle's velocity is parallel to its momentum, so:

  • Surfaces of constant S are the wavefronts.
  • Trajectories are the rays, always orthogonal to those wavefronts.

This is precisely the relationship between wavefronts and light rays in geometric optics. Hamilton spotted the analogy in the 1830s while studying optics, then realized the same mathematics governs mechanics. A mechanical system propagates like a wave whose rays are the orbits — the foundation of what physicists call the optical-mechanical analogy. The same picture underlies Fermat's principle and Huygens' construction.

The time-independent form

If the Hamiltonian does not depend explicitly on time (energy is conserved), you can separate the time variable. Write:

S(q, t) = W(q) − E·t

Here W(q) is Hamilton's characteristic function and E is the conserved energy. Substituting back, the −E·t term supplies ∂S/∂t = −E, and the equation collapses to the time-independent Hamilton-Jacobi equation:

H(q, ∂W/∂q) = E

For a single particle of mass m in a potential V(q), with H = p²/2m + V, this reads:

(1/2m)(∂W/∂q)² + V(q) = E

Rearranged, ∂W/∂q = ±√(2m[E − V]), so the momentum at every point is fixed by energy conservation — and W is just the accumulated ∫ p dq. This equation is identical in form to the eikonal equation of geometric optics, (∇W)² = n², with the local "index of refraction" playing the role of √(2m[E−V]). Mechanics literally is ray optics in a medium whose refractive index is set by the potential.

A worked example with numbers — free particle in 1D

Take the simplest possible case: a free particle of mass m = 2 kg, no potential (V = 0), energy E = 4 J. The time-independent HJ equation is:

(1/2m)(dW/dx)² = E
(dW/dx)² = 2mE = 2·2·4 = 16  (kg²·m²/s²)
dW/dx = √16 = 4 kg·m/s

So p = ∂W/∂x = 4 kg·m/s — constant, as expected for a free particle. Integrating, W(x) = 4x, and the full principal function is:

S(x, t) = W(x) − E·t = 4x − 4t

Now extract the trajectory. The Jacobi prescription says set ∂S/∂E = constant = β:

∂S/∂E = (∂W/∂E) − t = (x·√(m/2E)) − t = β
With m=2, E=4:  √(m/2E) = √(2/8) = 0.5
0.5·x − t = β   ⟹   x(t) = 2t + 2β

That is a straight line moving at constant velocity v = 2 m/s. Check it against elementary mechanics: KE = ½mv² = ½·2·2² = 4 J = E. ✓ And p = mv = 2·2 = 4 kg·m/s = ∂W/∂x. ✓ The Hamilton-Jacobi machinery reproduces the obvious answer — but the same recipe (write S, separate, differentiate with respect to constants) works unchanged for the Kepler problem, a charged particle in a field, or a symmetric top, where the elementary route is hopeless.

Here is why physicists revere this equation. Take the time-dependent Schrödinger equation and substitute a wavefunction of the form:

ψ(q, t) = A(q, t) · e^(iS(q,t)/ℏ)

Expand in powers of ℏ. The leading term (order ℏ⁰) is exactly the Hamilton-Jacobi equation:

∂S/∂t + (1/2m)(∂S/∂q)² + V = 0

The next term (order ℏ¹) is a continuity equation that propagates the amplitude A along the rays. This is the WKB approximation. The physical message is striking: the quantum phase is the classical action divided by ℏ. Because S/ℏ is enormous for macroscopic motion, the phase oscillates so fast that all paths cancel by destructive interference — except where S is stationary. Stationary action is exactly the principle of least action, so the surviving paths are the classical trajectories. As ℏ → 0, quantum mechanics collapses onto Hamilton-Jacobi.

How big is S/ℏ? For a 0.5 kg ball thrown for 1 second with action of order S ≈ E·t ≈ 1 J·s, the phase S/ℏ ≈ 1 / (1.05×10⁻³⁴) ≈ 10³⁴ radians. That astronomically large number is why the everyday world looks classical. For an electron in an atom, S ~ ℏ, the phase is order 1, and interference cannot be ignored — you must use the full Schrödinger equation. Schrödinger himself reverse-engineered his equation from exactly this analogy: he asked what wave equation would have the Hamilton-Jacobi equation as its short-wavelength limit.

Variants and related equations

FormEquationUsed for
Time-dependent HJ∂S/∂t + H(q, ∂S/∂q, t) = 0General dynamics, time-varying forces
Time-independent HJH(q, ∂W/∂q) = EConservative systems; separation of variables
Eikonal equation(∇W)² = n²(q)Geometric optics — the optical twin of HJ
Action-angle formJᵢ = ∮ pᵢ dqᵢ, ωᵢ = ∂H/∂JᵢIntegrable systems, orbital frequencies, old quantum theory
WKB / semiclassicalψ ~ A·e^(iS/ℏ)Tunneling rates, quantization conditions, classical limit
Hamilton-Jacobi-Bellman∂V/∂t + min_u[c + (∂V/∂x)·f] = 0Optimal control, reinforcement learning, finance

Separation of variables and integrability

The reason Hamilton-Jacobi is so powerful in practice is separation of variables. For a conservative system you first peel off time with S = W − Et. Then you guess that the characteristic function splits into a sum over coordinates:

W(q₁, q₂, …, qₙ) = W₁(q₁) + W₂(q₂) + … + Wₙ(qₙ)

When this works, each coordinate decouples and brings its own separation constant, which is a conserved quantity. A system that separates completely is called integrable: it has as many conserved quantities as degrees of freedom. The separation constants are the new momenta of a canonical transformation that makes the dynamics trivial — every coordinate either stays constant or advances linearly in time.

The Kepler problem separates in spherical coordinates, giving energy, total angular momentum, and the z-component of angular momentum as the three constants. The action variables Jᵢ = ∮ pᵢ dqᵢ built from these were exactly what Bohr and Sommerfeld quantized (Jᵢ = nᵢh) in the old quantum theory — the direct ancestor of the modern quantum numbers.

Common pitfalls and misconceptions

  • "S is a potential energy." No. S is the action, with units of energy × time (joule-seconds), the same units as angular momentum and as ℏ. Its gradient is momentum and its time derivative is −energy; S itself is neither.
  • "You need to solve Hamilton's equations first." The opposite — a complete solution of the single HJ PDE replaces the entire set of 2n ordinary differential equations. You get the orbit by differentiating S with respect to the constants, not by integrating forces.
  • "The wavefronts move at the particle's speed." They don't. As in optics, the wavefronts (surfaces of constant S) and the rays (trajectories) move at different speeds; the wavefront "phase velocity" can even exceed the particle speed. Only the directions are locked: rays are perpendicular to wavefronts.
  • "It only works for separable systems." The equation is always valid; it is only easy when the system separates. Chaotic, non-integrable systems still obey HJ, but a smooth global S may not exist — it develops caustics and multivaluedness, which is exactly where the semiclassical WKB approximation breaks down and needs Maslov corrections.
  • "ψ ~ e^(iS/ℏ) is exact." It is the leading semiclassical term. The amplitude A and higher ℏ corrections matter near turning points and caustics, where the simple WKB form diverges.
  • "HJ is just a curiosity." Its optimal-control descendant, the Hamilton-Jacobi-Bellman equation, is the backbone of modern control theory and reinforcement learning. The same PDE-with-optimal-characteristics idea runs spacecraft trajectories and trains robots.

Where it shows up

  • Celestial mechanics and orbits. Separating the HJ equation gives action-angle variables and the slow precession frequencies of planetary orbits — the natural language of perturbation theory.
  • Semiclassical quantum mechanics. Tunneling rates, Bohr-Sommerfeld quantization, and the WKB connection formulas all flow from ψ ~ e^(iS/ℏ).
  • General relativity. Geodesics of test particles are found by separating the HJ equation in metrics like Schwarzschild and Kerr — how light bending and orbital precession around black holes are computed.
  • Geometric optics. The eikonal equation that designs lenses and traces rays is the HJ equation in disguise (see Fermat's principle).
  • Optimal control and AI. The Hamilton-Jacobi-Bellman equation underlies trajectory optimization, autonomous-vehicle planning, and value functions in reinforcement learning.
  • Plasma and accelerator physics. Canonical perturbation theory built on HJ describes particle drifts and adiabatic invariants in magnetic confinement.

Derivation analysis — why one PDE beats 2n ODEs

The Hamilton-Jacobi equation arises from a canonical transformation. We look for a transformation from old variables (q, p) to new variables (Q, P) so cleverly chosen that the new Hamiltonian K is identically zero. If K = 0, then by Hamilton's equations Q̇ = ∂K/∂P = 0 and Ṗ = −∂K/∂Q = 0 — every new coordinate and momentum is constant in time. The generating function of that transformation, of "type 2" denoted S(q, P, t), satisfies p = ∂S/∂q and K = H + ∂S/∂t. Demanding K = 0 gives precisely:

H(q, ∂S/∂q, t) + ∂S/∂t = 0

The payoff is a change in the kind of work required. Hamilton's equations are 2n coupled nonlinear ODEs you must integrate step by step. A complete solution of the HJ PDE — one carrying n independent constants α₁…αₙ — lets you find the orbit purely by algebra: set βᵢ = ∂S/∂αᵢ (n new constants) and solve those equations for q(t). No time integration of the trajectory is needed. For an integrable system this is a spectacular shortcut. For a non-integrable system the complete solution doesn't exist globally, and that failure is itself diagnostic: it signals chaos, the breakdown of smooth invariant tori, and the limits of the semiclassical picture.

The cost is conceptual difficulty (you must guess a separation ansatz) traded for computational elegance. When the trade pays off — Kepler, the symmetric top, a charge in crossed fields, geodesics in Kerr spacetime — Hamilton-Jacobi is the most efficient formulation of mechanics ever written, and the only one that turns smoothly into quantum mechanics as you let ℏ stop being negligible.

Frequently asked questions

What is the Hamilton-Jacobi equation?

It is a single first-order, non-linear partial differential equation for Hamilton's principal function S(q, t): ∂S/∂t + H(q, ∂S/∂q, t) = 0. Here H is the Hamiltonian and the canonical momenta are replaced by p = ∂S/∂q. Solving this one PDE is equivalent to solving the entire set of Hamilton's equations of motion — the function S generates all the trajectories of the system.

What is the action S in the Hamilton-Jacobi equation?

S is Hamilton's principal function, equal to the classical action — the time integral of the Lagrangian, S = ∫ L dt, evaluated along the actual trajectory from a fixed starting point to the point (q, t). Its gradient gives momentum (p = ∂S/∂q) and its time derivative gives minus the energy (∂S/∂t = −H = −E for conservative systems). S therefore encodes both where a particle is going and how fast.

How does Hamilton-Jacobi connect to wave optics?

The surfaces of constant S behave exactly like optical wavefronts, and the particle trajectories are the rays — always perpendicular to those wavefronts. For a conservative system the time-independent equation (∂W/∂q)²/2m + V = E is mathematically the eikonal equation of geometric optics, with W playing the role of the optical path length. Hamilton noticed this analogy in the 1830s; mechanics is to wave mechanics what ray optics is to wave optics.

How does Hamilton-Jacobi lead to the Schrödinger equation?

Write the wavefunction as ψ = A·e^(iS/ℏ) and substitute into the Schrödinger equation. Collecting powers of ℏ, the leading (ℏ⁰) term is exactly the Hamilton-Jacobi equation ∂S/∂t + (∂S/∂q)²/2m + V = 0, and the next (ℏ¹) term is a continuity equation for the probability amplitude A. As ℏ → 0 the quantum phase S/ℏ oscillates infinitely fast except along stationary-phase paths — the classical trajectories. This is the WKB approximation and the formal classical limit of quantum mechanics.

How do you actually solve a Hamilton-Jacobi equation?

The standard route is separation of variables. For a time-independent Hamiltonian write S = W(q) − E·t (separating time), then look for W as a sum of single-coordinate functions W = Σ Wᵢ(qᵢ). Each separation constant becomes a conserved quantity (the new constant momenta of a canonical transformation). When the system separates fully it is called integrable, and the constants are the action variables Jᵢ = ∮ pᵢ dqᵢ used in action-angle theory and old quantum theory.

What is the difference between Hamilton-Jacobi and Hamilton's equations?

Hamilton's equations are 2n coupled first-order ordinary differential equations for q(t) and p(t). The Hamilton-Jacobi equation is a single partial differential equation for one function S(q, t) of n+1 variables. They are equivalent, but HJ trades many ODEs for one PDE — advantageous when the system separates, because a complete solution of HJ instantly gives all conserved quantities and the full trajectory by differentiation rather than integration.

What is the Hamilton-Jacobi-Bellman equation?

It is the optimal-control analogue. Replacing the action with a cost-to-go value function V, the HJB equation ∂V/∂t + min_u [running cost + (∂V/∂x)·f(x,u)] = 0 governs optimal control and reinforcement learning. The mechanics version is the special case where 'minimizing the cost' is 'extremizing the action'. The same idea — a PDE whose characteristics are optimal paths — runs from celestial mechanics to robotics and finance.