Generating Function to a Trivial Hamiltonian

Every formulation of mechanics before this one solves a problem by following it: Newton integrates forces step by step, Lagrange integrates the Euler-Lagrange equations, Hamilton integrates a first-order flow in phase space. Hamilton-Jacobi theory opens with a move so audacious it barely sounds legal — do not follow the motion at all. Instead, hunt for a change of phase-space coordinates so perfectly adapted to the dynamics that, in the new chart, nothing moves. The orbit that spirals and loops in (q,p)(q,p) becomes a single frozen point in (Q,P)(Q,P); every new coordinate and every new momentum is a constant of the motion, all 2n2n of them at once. The instrument that makes this possible is a canonical transformation with a time-dependent type-2 generating function F2(q,P,t)F_2(q,P,t), chosen so that the transformed Hamiltonian K=H+∂F2/∂tK = H + \partial F_2/\partial t vanishes identically. The demand K≡0K\equiv 0, written out, is a single first-order partial differential equation for the generator — the Hamilton-Jacobi equation — and the generator that solves it turns out to be Hamilton's principal function, the classical action itself. This article is the strategic gateway to the whole Hamilton-Jacobi chapter: why one would want a trivial Hamiltonian, why the type-2 generator is the natural tool, what the trade costs (one nonlinear PDE in place of 2n2n ordinary differential equations), and how the frozen constants are thawed back into a living trajectory by pure algebra. Master this one idea and the rest of the chapter — characteristic functions, separation of variables, action-angle variables — unfolds as variations on it.

Key takeaways
  • Hamilton-Jacobi theory solves dynamics by finding a canonical transformation to new variables (Q,P)(Q,P) that are all constants of the motion — the trajectory becomes a fixed point in the new chart.
  • The tool is a type-2 generating function F2(q,P,t)F_2(q,P,t) with transformed Hamiltonian K=H+∂F2/∂tK = H + \partial F_2/\partial t; demanding K≡0K\equiv 0 makes Q˙i=∂K/∂Pi=0\dot Q_i = \partial K/\partial P_i = 0 and P˙i=−∂K/∂Qi=0\dot P_i = -\partial K/\partial Q_i = 0 automatic.
  • The demand K≡0K\equiv 0 is the Hamilton-Jacobi equation H(q,∂S/∂q,t)+∂S/∂t=0H(q,\partial S/\partial q,t) + \partial S/\partial t = 0 — one nonlinear first-order PDE for the generator SS, bought at the price of abandoning 2n2n ODEs.
  • The nn new momenta are the integration constants αi\alpha_i of the complete integral; the nn new coordinates βi=∂S/∂αi\beta_i = \partial S/\partial \alpha_i complete the 2n2n constants a mechanics problem needs.
  • Along the true motion dS/dt=L\mathrm{d}S/\mathrm{d}t = L: the generator that kills the Hamiltonian is the accumulated classical action — the explicit time dependence of SS supplies exactly the −H-H that cancels HH.
  • Key idea: solving the Hamilton-Jacobi equation is equivalent to finding a canonical transformation whose generator SS kills the Hamiltonian — in the new coordinates K≡0K\equiv 0, so all 2n2n new variables are constant and the motion is reduced to algebra.

Where this lives today

The trivial-Hamiltonian idea did not retire with classical mechanics — it changed fields. In optimal control theory the exact same move (encode the whole solution family in one scalar function of state and time, then demand a PDE that makes the rest trivial) is the Hamilton-Jacobi-Bellman equation, the backbone of dynamic programming. Every time a quadrotor plans a minimum-energy path or a portfolio model prices a hedging strategy, a descendant of K≡0K \equiv 0 is being solved numerically. Modern reinforcement learning sits one step further down the same lineage: a value function is a principal function estimated by samples, and the Bellman backup is the discretized statement that a properly chosen scalar makes the remaining decision problem trivial. In 2026 the sharpest working edge is in robotics and autonomous systems, where Hamilton-Jacobi reachability analysis — solving the HJ PDE on a grid, or with neural PDE solvers for systems too high-dimensional for grids — certifies the safe operating envelope of drones and self-driving vehicles: the level sets of the computed SS are provable "cannot-crash" boundaries. The physicist's freeze-the-dynamics trick has become a safety certificate you can ship.

The physical picture

Watch a pendulum's phase point trace its oval in the (q,p)(q,p) plane. An observer using those coordinates has genuine work to do: the point moves, and predicting where it will be requires integrating Hamilton's equations. Now imagine an observer whose coordinate grid is itself carried along by the flow — a chart drawn on the moving fluid of phase space rather than on the container. To that observer the phase point never goes anywhere. It sits at the same grid intersection forever, because the grid deforms in perfect sympathy with the dynamics. All the motion has been absorbed into the dictionary between the two charts.

Figure
Two charts of one motion — the orbit in the old chart becomes a frozen point in the new one
q p phase point at t the orbit: motion to integrate old chart (q, p) canonical transformation generated by S(q, P, t) Q P (β, α) — forever β α new chart (Q, P) no orbit: nothing left to integrate same dynamics, two descriptions — the transformation absorbs all the motion into the dictionary between charts

The Hamiltonian formulation makes this dream precise. In any canonical chart the motion is governed by some Hamiltonian; the question is only how simple that Hamiltonian can be made. There is a natural ladder here, and it is worth climbing consciously. One cyclic coordinate makes one momentum constant. If every coordinate were cyclic — K=K(P)K = K(P) only — every momentum would be constant and every coordinate would drift linearly in time; this is the destination of the action-angle construction. But there is one rung higher: make KK vanish identically. Then not even linear drift survives. Coordinates and momenta alike freeze, and the system's entire history is compressed into 2n2n numbers.

Figure
The ladder of simplification — from one cyclic coordinate to a Hamiltonian that is identically zero
one coordinate cyclic one momentum conserved; the rest of the problem is untouched all coordinates cyclic: K = K(P) all momenta constant, coordinates drift linearly — the action-angle destination the top rung: K = 0 identically no drift at all — every Q and every P is frozen; motion becomes algebra better generating function time-dependent generator S(q, P, t) each rung trades coordinate cleverness for conservation — the top rung requires the generator to solve one PDE

Why does the top rung require a time-dependent generator? Because a time-independent canonical transformation can only reshuffle the energy surface, never flatten it: if ∂F2/∂t=0\partial F_2/\partial t = 0, then K=HK = H takes the same values as before, and a nonzero Hamiltonian keeps generating motion. The extra term ∂F2/∂t\partial F_2/\partial t in the transformation law is the only lever that can cancel HH rather than merely disguise it. The generator must therefore change in time at exactly the rate the dynamics accumulates — and the quantity that does precisely that is the classical action. That the action would reappear here, as the demolition charge that levels the Hamiltonian, is the most elegant twist in classical mechanics. One more orientation point before the algebra. Freezing the motion does not destroy information — it relocates it. In the new chart the trajectory is a dead point, but the map back from (Q,P)(Q,P) to (q,p)(q,p) is time-dependent, and all the orbital richness lives in that map. Solving mechanics this way splits cleanly into two stages: a hard analytic stage (find the generator SS by solving one PDE) and a purely algebraic stage (differentiate SS, invert the relations). The Hamilton-Jacobi chapter is the study of when and how the hard stage can actually be carried out.

The demand that builds the theory

Everything rests on the type-2 transformation rules, established in Type-2 Generating Function and Generating Functions: the Four Types. A generator F2(q,P,t)F_2(q,P,t) — old coordinates and new momenta as its arguments — defines the transformation implicitly and prescribes how the Hamiltonian changes:

pi=∂F2∂qi,Qi=∂F2∂Pi,K=H+∂F2∂t(1)p_i = \frac{\partial F_2}{\partial q_i},\qquad Q_i = \frac{\partial F_2}{\partial P_i},\qquad K = H + \frac{\partial F_2}{\partial t} \qquad (1)

where: F2(q,P,t)F_2(q,P,t) — the type-2 generating function; (qi,pi)(q_i,p_i) — the old canonical pair; (Qi,Pi)(Q_i,P_i) — the new pair; KK — the Hamiltonian that governs the new variables. The type-2 shape is the natural one for our program: we intend the new momenta to be constants, so a generator that takes those constants directly as arguments — and hands back the old momenta and new coordinates by differentiation — is exactly the right interface. (The near-identity structure of type-2 generators, F2=∑iqiPiF_2 = \sum_i q_iP_i giving the identity map, also means the construction deforms smoothly from "no transformation at all", which matters for perturbation theory later in the chapter.) Now impose the design goal. We want the new Hamiltonian to vanish for all values of the new variables and all times. Renaming the sought generator SS, equation (1) turns the demand K≡0K \equiv 0 into a closed condition on SS alone:

H ⁣(q1,…,qn,  ∂S∂q1,…,∂S∂qn,  t)+∂S∂t=0(2)H\!\left(q_1,\dots,q_n,\;\frac{\partial S}{\partial q_1},\dots,\frac{\partial S}{\partial q_n},\;t\right) + \frac{\partial S}{\partial t} = 0 \qquad (2)

where: S(q,α,t)S(q,\alpha,t) — Hamilton's principal function, the type-2 generator that achieves K≡0K\equiv 0; the nn constants αi\alpha_i label the family of solutions and play the role of the new momenta PiP_i. Equation (2) is the Hamilton-Jacobi equation, treated in full as the flagship of this chapter (Hamilton-Jacobi Equation). Notice what happened structurally: the momenta in HH have been replaced by gradients of an unknown scalar. One function of n+1n+1 variables now carries the entire dynamical problem. The counting deserves a hard look, because it is the honest price tag of the method. Hamilton's equations are 2n2n first-order ODEs — hard work, but of a familiar kind. Equation (2) is a single first-order PDE, generally nonlinear because HH is typically quadratic in the momenta and hence quadratic in ∂S/∂q\partial S/\partial q. Trading 2n2n ODEs for one nonlinear PDE is not obviously progress; for a generic Hamiltonian it is a strictly worse deal. The trade pays off in exactly one circumstance: when the PDE separates into nn independent one-dimensional problems, each solvable by a single quadrature. When it does — and Separation of Variables in Hamilton-Jacobi Theory maps out when that happens — the method becomes the most powerful integration engine classical mechanics possesses. What must a useful solution of (2) look like? Not the general solution, which involves arbitrary functions, but a complete integral: a solution S(q1,…,qn; α1,…,αn; t)S(q_1,\dots,q_n;\,\alpha_1,\dots,\alpha_n;\,t) depending on nn independent, nonadditive constants αi\alpha_i — one constant per coordinate, with independence meaning det⁡(∂2S/∂qi ∂αj)≠0\det(\partial^2 S/\partial q_i\,\partial\alpha_j) \neq 0. That determinant condition is what lets the αi\alpha_i serve as honest new momenta and makes the implicit relations in (1) solvable. (An additive constant S→S+cS \to S + c changes nothing, since only derivatives of SS appear; that is why the count is nn and not n+1n+1.) With a complete integral in hand, the new variables are constants and the trajectory is recovered by differentiation and inversion:

Pi=αi,Qi=βi=∂S(q,α,t)∂αi,pi=∂S(q,α,t)∂qi(3)P_i = \alpha_i,\qquad Q_i = \beta_i = \frac{\partial S(q,\alpha,t)}{\partial \alpha_i},\qquad p_i = \frac{\partial S(q,\alpha,t)}{\partial q_i} \qquad (3)

where: βi\beta_i — the nn frozen new coordinates. The middle set of relations is the heart of the payoff: nn algebraic equations connecting the qjq_j, the time tt, and 2n2n constants. Solve them for qj(t;α,β)q_j(t;\alpha,\beta) — algebra, not integration — then substitute into the last relation to read off pj(t)p_j(t). Together (αi,βi)(\alpha_i,\beta_i) are exactly the 2n2n integration constants that nn second-order equations of motion demand: the count closes perfectly, which is the formal sign that no information was lost in the freezing.

Figure
Thawing the frozen solution — from the generator S to the trajectory by pure algebra
complete integral S(q, α, t) n algebraic relations β = ∂S/∂α q, t and 2n constants mixed trajectory q(t; α, β) solved for, not integrated momenta p(t) = ∂S/∂q evaluated along q(t) differentiate w.r.t. each α invert (algebra) substitute into ∂S/∂q after the PDE is solved, no further integration ever occurs — the trajectory is extracted by differentiation and inversion

Which equation answers which question

you wantusenotes
the transformation rules and how KK relates to HHeq. (1)the type-2 interface — see Type-2 Generating Function
the PDE the generator must solveeq. (2)demanding K≡0K\equiv 0; the Hamilton-Jacobi equation
the trajectory once SS is knowneq. (3)βi=∂S/∂αi\beta_i = \partial S/\partial\alpha_i, then invert
what SS is physicallyeq. (5) belowdS/dt=L\mathrm{d}S/\mathrm{d}t = L: the accumulated action
the conservative-system shortcuteq. (6) belowS=W−EtS = W - Et; see Time-Independent Hamilton-Jacobi Equation
Derivation ADemanding a vanishing new Hamiltonian freezes the entire phase space

We are deriving the central logical chain of the article: that the single demand K≡0K\equiv 0, imposed on a type-2 generator, simultaneously (a) produces the Hamilton-Jacobi PDE as the condition on the generator, and (b) guarantees that every new coordinate and momentum is a constant of the motion. The strategy is to write the transformed Hamiltonian, eliminate the old momenta using the type-2 relations so the condition involves the generator alone, and then let Hamilton's equations in the new chart deliver the freeze. The step to watch is the substitution order: the momenta inside HH must be replaced by ∂S/∂q\partial S/\partial q before the vanishing is imposed — the PDE is a condition at every point of (q,t)(q,t) space, not along a single trajectory.

Step 1. Write the transformation law for the Hamiltonian with the generator named SS:

K=H(q,p,t)+∂S∂tK = H(q,p,t) + \frac{\partial S}{\partial t}

Why: this is the type-2 rule from eq. (1) — the new Hamiltonian differs from the old by the explicit time derivative of the generator, the one term through which a time-dependent transformation can inject or remove energy bookkeeping.

Step 2. Eliminate the old momenta. The type-2 relations give pi=∂S/∂qip_i = \partial S/\partial q_i, so

K=H ⁣(q,∂S∂q,t)+∂S∂tK = H\!\left(q,\frac{\partial S}{\partial q},t\right) + \frac{\partial S}{\partial t}

Why this matters: KK is now expressed entirely in terms of the unknown function SS and its derivatives — the momenta have been dissolved into gradients of a scalar, which is what converts a phase-space condition into a PDE on configuration space extended by time.

Step 3. Impose the design demand K≡0K \equiv 0 at every point:

H ⁣(q,∂S∂q,t)+∂S∂t=0H\!\left(q,\frac{\partial S}{\partial q},t\right) + \frac{\partial S}{\partial t} = 0

Why "at every point": we need KK to vanish as a function, for all (q,α,t)(q,\alpha,t) in the domain, so that its partial derivatives — not merely its value — are zero. A function that vanishes identically has identically vanishing gradients; that is the property the next step consumes.

Step 4. Run Hamilton's equations in the new chart. Since the transformation is canonical, the new variables obey Hamilton's equations with Hamiltonian KK:

Q˙i=∂K∂Pi=0,P˙i=−∂K∂Qi=0\dot Q_i = \frac{\partial K}{\partial P_i} = 0, \qquad \dot P_i = -\frac{\partial K}{\partial Q_i} = 0

so Pi=αiP_i = \alpha_i and Qi=βiQ_i = \beta_i are constants — the entire new phase space is frozen, and the 2n2n frozen values are the integration constants of the motion. Note: the count of constants closes exactly — nn constants αi\alpha_i come from the complete integral and nn conjugate constants βi\beta_i from the relations βi=∂S/∂αi\beta_i = \partial S/\partial\alpha_i, giving the 2n2n integration constants that nn second-order equations of motion require.

Why the cancellation is even possible

There is something suspicious about K=0K = 0. The Hamiltonian is (often) the energy — how can a coordinate change abolish the energy? The resolution is that KK is not obtained from HH by substitution alone; the extra term ∂S/∂t\partial S/\partial t is an honest reassignment of bookkeeping, and the function whose time derivative can pace the dynamics exactly is the action. Along the actual motion, the generator obeys a remarkable identity. Take the total time derivative of S(q,α,t)S(q,\alpha,t) along a trajectory (the αi\alpha_i are constants, so only qq and tt vary):

dSdt=∑i∂S∂qi q˙i+∂S∂t=∑ipiq˙i−H=L(4)\frac{\mathrm{d}S}{\mathrm{d}t} = \sum_i \frac{\partial S}{\partial q_i}\,\dot q_i + \frac{\partial S}{\partial t} = \sum_i p_i\dot q_i - H = L \qquad (4)

where: the first equality is the chain rule, the second uses pi=∂S/∂qip_i = \partial S/\partial q_i together with the Hamilton-Jacobi equation ∂S/∂t=−H\partial S/\partial t = -H, and the third is the inverse Legendre transformation. Integrated,

S=∫L dt+const(5)S = \int L\,\mathrm{d}t + \text{const} \qquad (5)

where: the integral runs along the true trajectory. The generator that trivializes the Hamiltonian is Hamilton's principal function — the classical action accumulated along the motion, studied as an object in its own right in Hamilton's Principal Function. This is why the cancellation works: SS grows at rate L=∑pq˙−HL = \sum p\dot q - H, so its explicit time dependence contributes exactly −H-H after the ∑pq˙\sum p\dot q part is accounted to the coordinate dependence. The action is the unique ledger whose columns balance the Hamiltonian to zero.

Go deeper · Derivation B · 1 minThe generator that kills the Hamiltonian is the classical action
Derivation BThe generator that kills the Hamiltonian is the classical action

The goal is the identity dS/dt=L\mathrm{d}S/\mathrm{d}t = L along the true motion — the statement that Hamilton's principal function is the accumulated action, which explains why a generator with the right explicit time dependence can cancel HH entirely. The strategy is a two-line chain-rule computation into which the two defining properties of SS (the momentum relation and the Hamilton-Jacobi equation itself) are inserted. Watch one subtlety: the derivative is taken along a trajectory of the frozen family — the constants αi\alpha_i do not vary, so no ∂S/∂αi\partial S/\partial\alpha_i terms appear.

Step 1. Chain rule along the motion qi(t)q_i(t) with α\alpha fixed:

dSdt=∑i∂S∂qi q˙i+∂S∂t\frac{\mathrm{d}S}{\mathrm{d}t} = \sum_i \frac{\partial S}{\partial q_i}\,\dot q_i + \frac{\partial S}{\partial t}

Why the α\alpha-terms are absent: the trajectory being followed is one member of the complete-integral family, on which each αi\alpha_i is a constant of the motion by construction — α˙i=0\dot\alpha_i = 0 kills those chain-rule contributions.

Step 2. Insert the two defining relations of SS: the type-2 momentum relation ∂S/∂qi=pi\partial S/\partial q_i = p_i, and the Hamilton-Jacobi equation in the form ∂S/∂t=−H\partial S/\partial t = -H:

dSdt=∑ipiq˙i−H\frac{\mathrm{d}S}{\mathrm{d}t} = \sum_i p_i \dot q_i - H

Step 3. Recognize the inverse Legendre transformation: ∑ipiq˙i−H=L\sum_i p_i\dot q_i - H = L. Hence

dSdt=L⟹S=∫L dt+const\frac{\mathrm{d}S}{\mathrm{d}t} = L \quad\Longrightarrow\quad S = \int L\,\mathrm{d}t + \text{const}

Why this closes the conceptual loop: the Lagrangian is the rate at which action accumulates; a generator that accumulates action therefore carries explicit time dependence at rate −H+∑pq˙-H + \sum p\dot q, of which the −H-H part is precisely what the transformation law K=H+∂S/∂tK = H + \partial S/\partial t needs to produce zero. *This identification of the principal function with the accumulated action is also consistent with the boundary-derivative relations ∂S/∂q=p\partial S/\partial q = p and ∂S/∂t=−H\partial S/\partial t = -H that arise from varying the action functional with movable endpoints.*

For conservative systems there is a standard first simplification that the rest of the chapter leans on. When ∂H/∂t=0\partial H/\partial t = 0, the time dependence of SS can be split off additively:

S(q,α,t)=W(q,α)−E t,H ⁣(q,∂W∂q)=E(6)S(q,\alpha,t) = W(q,\alpha) - E\,t, \qquad H\!\left(q,\frac{\partial W}{\partial q}\right) = E \qquad (6)

where: WW — Hamilton's characteristic function, and EE — the conserved energy, which joins (or generates) the constant set αi\alpha_i. The reduced, time-free PDE on the right is the Time-Independent Hamilton-Jacobi Equation, and the object WW — which generates its own, subtly different canonical transformation with K=EK = E rather than K=0K = 0 — is the subject of Hamilton's Characteristic Function. Here it is enough to note the division of labor: SS freezes everything; WW freezes the momenta and lets one clock-like coordinate run. Both live inside the same trivial-Hamiltonian program.

Limiting cases

CaseResultMeaning
conserved HHS=W(q,α)−EtS = W(q,\alpha) - Ettime separates off; the reduced problem is the time-independent HJ equation for WW
explicitly time-dependent HHfull S(q,α,t)S(q,\alpha,t) requiredno energy constant exists, but K≡0K\equiv 0 still freezes (Q,P)(Q,P) — the method survives where energy methods fail
separable systemS=∑iSi(qi;α)−EtS = \sum_i S_i(q_i;\alpha) - Etthe PDE splits into nn quadratures; the regime where the ODE-for-PDE trade wins outright
free particleS=αq−α22mtS = \alpha q - \dfrac{\alpha^2}{2m}tthe frozen constants are the momentum and initial position; inversion returns q=β+(α/m)tq = \beta + (\alpha/m)t
identity limitS=∑iqiPiS = \sum_i q_iP_i at t=t0t=t_0the principal function grows out of the identity transformation — the freeze is a continuous deformation of "do nothing", the seed of canonical perturbation theory

Worked examples

1 · A thrown ball, frozen and thawed (confidence builder)

A ball of mass m=0.5 kgm = 0.5\ \mathrm{kg} moves vertically in uniform gravity, H=p2/2m+mgqH = p^2/2m + mgq with g=9.8 m/s2g = 9.8\ \mathrm{m/s^2}. Its energy is E=100 JE = 100\ \mathrm{J} and its frozen coordinate is β=−2 s\beta = -2\ \mathrm{s} (the constants conjugate to α=E\alpha = E carry units of time here). Find the trajectory, the apex height, and the position and momentum at t=0t = 0.

Step 1. Solve the Hamilton-Jacobi equation. Since HH is conserved, use S=W−EtS = W - Et with 12m(W′)2+mgq=E\tfrac{1}{2m}(W')^2 + mgq = E, so W′=2m(E−mgq)W' = \sqrt{2m(E - mgq)} (upward branch) and S=∫ ⁣2m(E−mgq) dq−EtS = \int\!\sqrt{2m(E-mgq)}\,\mathrm{d}q - Et, taking α=E\alpha = E as the one constant.

Step 2. Freeze and differentiate. The conjugate constant is β=∂S/∂E=∫m dq2m(E−mgq)−t=−2m(E−mgq)mg−t=−pmg−t\beta = \partial S/\partial E = \int \frac{m\,\mathrm{d}q}{\sqrt{2m(E-mgq)}} - t = -\frac{\sqrt{2m(E-mgq)}}{mg} - t = -\frac{p}{mg} - t, using p=∂S/∂q=2m(E−mgq)p = \partial S/\partial q = \sqrt{2m(E-mgq)}.

Step 3. Thaw by algebra. Solving the Step 2 relation: p(t)=−mg (t+β)p(t) = -mg\,(t + \beta), and substituting into p2=2m(E−mgq)p^2 = 2m(E - mgq) gives q(t)=Emg−g2 (t+β)2q(t) = \dfrac{E}{mg} - \dfrac{g}{2}\,(t+\beta)^2 — the parabola of projectile motion, recovered without integrating a single equation of motion. The apex sits at t=−β=2 st = -\beta = 2\ \mathrm{s}, height qmax⁡=E/mg=100/(0.5×9.8)=20.4 mq_{\max} = E/mg = 100/(0.5\times 9.8) = \boxed{20.4\ \mathrm{m}}.

Step 4. Evaluate at t=0t=0: p(0)=−0.5×9.8×(0−2)=+9.8 kg m/sp(0) = -0.5\times 9.8\times(0-2) = \boxed{+9.8\ \mathrm{kg\,m/s}} (moving upward, speed 19.6 m/s19.6\ \mathrm{m/s}) and q(0)=20.41−9.82(2)2=20.41−19.6=0.81 mq(0) = 20.41 - \tfrac{9.8}{2}(2)^2 = 20.41 - 19.6 = \boxed{0.81\ \mathrm{m}}.

Step 5. Check the freeze. Energy: p2/2m+mgq=(9.8)2/1.0+4.9×0.81=96.04+3.96=100.0 J=Ep^2/2m + mgq = (9.8)^2/1.0 + 4.9\times 0.81 = 96.04 + 3.96 = 100.0\ \mathrm{J} = E ✓. The two constants (α,β)=(100 J,−2 s)(\alpha,\beta) = (100\ \mathrm{J}, -2\ \mathrm{s}) encode the whole flight: α\alpha fixes the shape (apex height), β\beta fixes the timetable (when the apex occurs).

2 · A time-dependent force, where energy methods fail (exam level)

A particle of mass m=2 kgm = 2\ \mathrm{kg} feels a linearly growing force F(t)=λtF(t) = \lambda t with λ=3 N/s\lambda = 3\ \mathrm{N/s}, so H=p22m−λt qH = \dfrac{p^2}{2m} - \lambda t\,q. Energy is not conserved and no characteristic function exists — the full principal function is required. Solve by Hamilton-Jacobi with the ansatz S=a(t) q+b(t)S = a(t)\,q + b(t), then find qq and pp at t=2 st = 2\ \mathrm{s} given α=4 kg m/s\alpha = 4\ \mathrm{kg\,m/s} and β=1 m\beta = 1\ \mathrm{m}.

Step 1. Insert the ansatz into the HJ equation 12m(∂S/∂q)2−λtq+∂S/∂t=0\tfrac{1}{2m}(\partial S/\partial q)^2 - \lambda t q + \partial S/\partial t = 0. With ∂S/∂q=a(t)\partial S/\partial q = a(t) and ∂S/∂t=a˙ q+b˙\partial S/\partial t = \dot a\,q + \dot b:

(a˙−λt)q+(a22m+b˙)=0\left(\dot a - \lambda t\right) q + \left(\frac{a^2}{2m} + \dot b\right) = 0

Step 2. Match coefficients — the equation must hold for all qq (the PDE is a pointwise identity, not an on-shell statement). Thus a˙=λt\dot a = \lambda t giving a(t)=λt22+αa(t) = \tfrac{\lambda t^2}{2} + \alpha, and b˙=−a2/2m\dot b = -a^2/2m giving b(t)=−12m∫0t(λτ22+α) ⁣2dτb(t) = -\tfrac{1}{2m}\displaystyle\int_0^t \left(\tfrac{\lambda \tau^2}{2} + \alpha\right)^{\!2}\mathrm{d}\tau. The constant α\alpha is the single new momentum.

Step 3. Freeze and differentiate: β=∂S∂α=q−1m∫0t(λτ22+α)dτ=q−1m(λt36+αt)\beta = \dfrac{\partial S}{\partial \alpha} = q - \dfrac{1}{m}\displaystyle\int_0^t\left(\tfrac{\lambda\tau^2}{2}+\alpha\right)\mathrm{d}\tau = q - \dfrac{1}{m}\left(\dfrac{\lambda t^3}{6} + \alpha t\right).

Step 4. Thaw: q(t)=β+αm t+λ6m t3q(t) = \beta + \dfrac{\alpha}{m}\,t + \dfrac{\lambda}{6m}\,t^3 and p(t)=∂S/∂q=a(t)=α+λt22p(t) = \partial S/\partial q = a(t) = \alpha + \dfrac{\lambda t^2}{2}. Sanity check against Newton: p˙=λt=F(t)\dot p = \lambda t = F(t) ✓, and α=p(0)\alpha = p(0), β=q(0)\beta = q(0) — the frozen constants are the initial conditions.

Step 5. Numbers at t=2 st = 2\ \mathrm{s}: p=4+3×42=10 kg m/sp = 4 + \tfrac{3\times 4}{2} = \boxed{10\ \mathrm{kg\,m/s}} and q=1+4×22+3×812=1+4+2=7 mq = 1 + \tfrac{4\times 2}{2} + \tfrac{3\times 8}{12} = 1 + 4 + 2 = \boxed{7\ \mathrm{m}}.

Step 6. The moral: with HH explicitly time-dependent there is no conserved energy, no WW, no energy-surface picture at all — yet K≡0K\equiv 0 still froze the system into two constants (α,β)=(4,1)(\alpha,\beta) = (4,1) and returned the exact cubic trajectory. The trivial-Hamiltonian program is strictly more general than energy conservation.

Origins · 1 minWilliam Rowan Hamilton and how this was discovered
WR
William Rowan Hamilton
1805–1865 · Trinity College Dublin and Dunsink Observatory

Hamilton arrived at mechanics through light. As Ireland's Astronomer Royal — appointed at 22, while still an undergraduate — he had reduced all of geometrical optics to the study of a single "characteristic function" whose partial derivatives encode every ray. In 1834-35 he transplanted the idea into dynamics: the motion of any system could likewise be compressed into one scalar function of endpoints and time, from which trajectories follow by differentiation. His contemporaries admired the economy but doubted the utility — the function seemed as hard to find as the motion it encoded. It took Jacobi's reworking to turn Hamilton's vision into a working method: the equation demanding that the transformed Hamiltonian vanish. Hamilton spent his later decades on quaternions, convinced they were his greatest legacy; posterity disagreed, and chose instead the optical-mechanical analogy that, a century later, guided Schrödinger to the wave equation of quantum mechanics.

History
1828
— Hamilton's Theory of Systems of Rays compresses geometrical optics into a single characteristic function, the template for everything that follows.
1834
— Hamilton's On a General Method in Dynamics imports the idea into mechanics: one scalar function generates all trajectories.
1837
— Jacobi recasts Hamilton's construction as a practical integration method — find a complete integral of one PDE and the dynamics is algebra — the form taught ever since.
1842
— Jacobi's Königsberg lectures on dynamics systematize separation of variables, delivering the Kepler problem and the spinning top to the new method.
1926
— Schrödinger, guided explicitly by the optical-mechanical analogy, promotes the vanishing-KK equation into the wave equation; the ansatz ψ=eiS/ℏ\psi = e^{iS/\hbar} returns Hamilton-Jacobi as the classical limit.

Going further

References. Goldstein, Poole & Safko, Classical Mechanics, 3rd ed., Ch. 10 · Landau & Lifshitz, Mechanics, 3rd ed., §47 · Morin, Introduction to Classical Mechanics, Ch. 15 (Hamiltonian methods) · Taylor, Classical Mechanics, Ch. 13 · Arnold, Mathematical Methods of Classical Mechanics, §47 All equations are standard results of Hamilton-Jacobi theory. The key relations are: the type-2 transformation rule K=H+∂F2/∂tK=H+\partial F_2/\partial t with pi=∂F2/∂qip_i=\partial F_2/\partial q_i and Qi=∂F2/∂PiQ_i=\partial F_2/\partial P_i; the Hamilton-Jacobi PDE obtained by imposing K=0K=0; the free-particle result q(t)=β+(α/m)tq(t)=\beta+(\alpha/m)t; and the identity dS/dt=L\mathrm{d}S/\mathrm{d}t=L. Worked-example numbers on this page (apex 20.4 m20.4\ \mathrm{m}, q(0)=0.81 mq(0)=0.81\ \mathrm{m}, p(0)=9.8 kg m/sp(0)=9.8\ \mathrm{kg\,m/s}; cubic trajectory q(2)=7 mq(2)=7\ \mathrm{m}, p(2)=10 kg m/sp(2)=10\ \mathrm{kg\,m/s}) follow directly from the boxed formulas.

Builds on: Hamilton-Jacobi Equation · Hamilton's Principal Function · Time-Independent Hamilton-Jacobi Equation Leads to: Hamilton's Characteristic Function · Action-Angle Variables · Separation of Variables in Hamilton-Jacobi Theory · Liouville Integrable Systems

If K is identically zero, the new phase space has no dynamics at all. Where did the motion physically go?

Into the transformation itself. The map between (q,p)(q,p) and (Q,P)(Q,P) generated by S(q,P,t)S(q,P,t) is time-dependent: at each instant it is a different canonical map. The point (Q,P)=(β,α)(Q,P)=(\beta,\alpha) never moves, but the dictionary that translates it back to the old chart changes continuously, and the image of the fixed point sweeps out exactly the orbit q(t),p(t)q(t), p(t). Nothing is lost — the dynamical information that used to live in the flow now lives, in full, in the tt-dependence of the map. This is the extreme endpoint of a familiar idea: an interaction picture in which all of the evolution has been absorbed into the frame.

Isn't demanding K = 0 circular? It feels like we defined the problem away by decree.

The demand is a design specification, not a solution — and it must be paid for. Writing K≡0K\equiv 0 produces a nonlinear PDE for the generator, and every ounce of difficulty in the original 2n2n equations of motion reappears, concentrated, in that PDE. For a generic Hamiltonian the PDE is no easier than the ODEs; the decree buys nothing. The construction earns its keep only when the PDE has exploitable structure — above all when it separates into one-dimensional quadratures. So the correct reading is: Hamilton-Jacobi theory converts the question "can I integrate this motion?" into the sharper question "does this PDE separate?", which turns out to be the deeper and more answerable one.

Why do we need a complete integral with n constants rather than just any solution of the PDE?

Because the constants are load-bearing: they are the new momenta. A solution without enough independent constants — say the general solution built from an arbitrary function — cannot serve as a generating function of the required type, because the relations Qi=∂S/∂PiQ_i = \partial S/\partial P_i need nn genuine momentum-like arguments to differentiate against. Independence is the condition det⁡(∂2S/∂qi∂αj)≠0\det(\partial^2 S/\partial q_i\partial\alpha_j)\neq 0, which is exactly what the implicit function theorem needs to invert βi=∂S/∂αi\beta_i = \partial S/\partial\alpha_i for the trajectory. An additive constant doesn't count (only derivatives of SS appear anywhere), which is why nn, not n+1n+1, constants are demanded.

Are the α's required to be the energy and momenta, or can I pick any constants I like?

Any nn independent constants of the complete integral will do — the identification Pi=αiP_i = \alpha_i is a labeling convention, not physics. If S(q,α,t)S(q,\alpha,t) is a complete integral, so is S(q,γ(α),t)S(q,\gamma(\alpha),t) for any invertible relabeling γ\gamma, and different choices give different (equally valid) frozen charts related by a further trivial canonical transformation. In practice one takes whatever constants the separation hands over — the energy, angular momentum components, separation constants — because they arrive for free. The action-angle construction is precisely a canonical choice of this freedom: pick the constants to be the action integrals JiJ_i, and the conjugate variables become angles with clean frequencies.

The worked example gave β the units of time. Shouldn't a coordinate have units of length?

There is no such requirement — canonical coordinates need not carry any particular dimension; only the product of a conjugate pair is constrained, since QiPiQ_iP_i must have units of action. In the projectile example the new momentum was chosen as α=E\alpha = E (joules), so its conjugate β=∂S/∂E\beta = \partial S/\partial E necessarily carries seconds: energy × time = action ✓. This pairing is general and meaningful — the variable conjugate to energy is always a time-like quantity, just as the variable conjugate to angular momentum is an angle. Reading off the units of β\beta is a quick sanity check that your differentiation of SS was correct.

How is this different from just using conservation laws to solve the problem?

Conservation laws freeze some combinations of variables; the trivial-Hamiltonian construction freezes all of them, including the ones no symmetry protects. The βi=∂S/∂αi\beta_i = \partial S/\partial\alpha_i are constants of the motion that are generally not conserved quantities in the Noether sense — they mix coordinates, momenta and time explicitly (in the projectile example, β=−p/mg−t\beta = -p/mg - t). The method manufactures them wholesale from the complete integral. That is also why it works for explicitly time-dependent Hamiltonians (worked example 2), where energy conservation fails but K≡0K\equiv 0 is still achievable: the construction never needed a symmetry, only a solvable PDE.

Does the freeze contradict Liouville's theorem — a whole orbit collapsing to a point?

No collapse occurs. Liouville's theorem concerns volumes of ensembles: a blob of initial conditions must keep its phase volume under canonical maps, and it does — the transformation is canonical at each fixed tt, so a blob in (q,p)(q,p) maps to a blob of equal volume in (Q,P)(Q,P). What freezes is each individual point's motion, not the distinction between points. Two different initial conditions land on two different frozen points (β,α)(\beta,\alpha); the ensemble's volume is untouched, merely at rest. In fact the frozen chart makes Liouville trivial: a static distribution obviously preserves its volume.

Which do I actually compute in practice — the principal function S or the characteristic function W?

For a conservative system, always WW: split S=W−EtS = W - Et and solve the reduced, time-free PDE (see Time-Independent Hamilton-Jacobi Equation); the split is where every textbook solution of Kepler, the oscillator and the top actually begins. The full SS is needed only when HH depends explicitly on time — driven systems, ramped fields (worked example 2) — where no conserved EE exists to split off. Conceptually, though, SS is the primary object: WW generates a transformation to a constant Hamiltonian K=EK = E (momenta frozen, one clock coordinate running), a slightly weaker freeze than the identically-zero KK of the principal function. The two pictures are developed side by side in Hamilton's Characteristic Function.

Before this

Where this leads