Equivalence of Lagrangian and Hamiltonian Formulations
Mechanics ships with two complete operating systems. One runs on configuration space: a single function , one variational principle, and second-order Euler–Lagrange equations. The other runs on phase space: a function , and first-order canonical equations. The interfaces look nothing alike — different variables, different equation counts, different geometry — and yet every trajectory computed in one is a trajectory of the other, point for point, for every regular mechanical system. This article is the proof, run carefully in both directions, and the anatomy of why it works. The bridge is the Legendre transformation you have already mastered, but the equivalence theorem is more than "the transform exists." Its content is a precise dissection of the canonical equations themselves. One of them, , turns out to be pure bookkeeping — an identity of the transformation that holds before any physics is imposed. The other, , is where the entire Euler–Lagrange content — every force in the problem — actually lives. Knowing which half is which inoculates you against a surprisingly common illusion: that Hamilton's equations were somehow derived from algebra alone. Beyond the proof, the theorem earns its keep as a practical dictionary. Initial data match ( numbers either way), conserved quantities match, cyclic coordinates translate into banked momenta, and the two great quantization schemes — path-integral and canonical — shadow the two classical formulations exactly. When the Hessian degenerates the dictionary tears, and that tear is where gauge theory begins.
- The Lagrangian formulation lives on configuration space with coordinates and velocities ; the Hamiltonian formulation lives on phase space with coordinates and conjugate momenta .
- The bridge is the Legendre transformation , with invertible to give .
- Hamilton's first-order equations , are algebraically equivalent to the second-order Euler–Lagrange equations.
- The equivalence is a clean identity-by-identity matching of partial derivatives of and ; no dynamical assumption is hidden in the transformation itself.
- Both formulations follow from the same variational principle ; the Hamiltonian version is the modified (phase-space) Hamilton's principle.
- Key idea: matching the differential of taken two ways yields Hamilton's equations identically, with the single dynamical input being the Euler–Lagrange equation — and the construction runs backwards just as cleanly, provided the velocity Hessian is nonsingular.
The Legendre transformation converts the velocity into the momentum as the active variable; matching the differential of taken two ways yields Hamilton's equations identically, with the single dynamical input being the Euler–Lagrange equation.
Where this lives today
The two formulations quantize into the two pillars of modern theory: canonical quantization promotes the Hamiltonian side (, Schrödinger evolution), while the path integral sums over the Lagrangian side's action. Their agreement — for regular systems — is the quantum shadow of this article's theorem, and their disagreement points (ordering ambiguities, anomalies, constrained systems) trace back exactly to where the classical dictionary strains: singular Lagrangians and the Dirac constraint analysis. Computation splits along the same seam. Trajectory-optimization and control engineers work Hamiltonian-side — Pontryagin's maximum principle is a canonical system with the costate as momentum — while structural and multibody simulation often stays Lagrangian-side, where constraints are natural. In machine learning both operating systems have been reborn as inductive biases: Lagrangian neural networks and Hamiltonian neural networks learn the same dynamics from data, and choosing between them is a live engineering decision that rehearses, on GPUs, the trade-offs this article catalogued.
The physical picture
Think of and as the same physics photographed in two coordinate slices. The Lagrangian draws the landscape over ; the Hamiltonian draws it over . The Legendre transformation is the relabelling from the slope coordinate to the slope value — lossless whenever is convex in the velocities, which positive-definite kinetic energy guarantees. Nothing physical can depend on which photograph you consult; the equivalence theorem is the formal receipt for that claim. A dimension count makes the equivalence plausible before any algebra. A second-order system in variables needs initial numbers, ; a first-order system in variables needs numbers, . Same information, repackaged: the Hamiltonian route splits each second-order equation into two first-order halves — and, crucially, one of those halves is nothing but the definition of momentum solved for the velocity. That is the dissection to carry through this article: one canonical equation is kinematics of the transform, the other is the law of motion. Forces live entirely in the second:
Why keep both operating systems, if they compute the same trajectories? Because they expose different structure. The Lagrangian is a scalar under coordinate changes — symmetry arguments, Noether's theorem, and relativistic field theory live there. The Hamiltonian's phase space carries the flow, the brackets, Liouville's theorem, canonical transformations — and the road to quantum and statistical mechanics. Professionals translate constantly; the theorem below is the guarantee that translation never costs physics.
The bridge, and the dissection
Set up the standing assumptions once. The Lagrangian is regular: its velocity Hessian is invertible,
where: regularity is precisely the invertibility of the momentum map for the velocities, — the licence for the whole construction (see Legendre Transformation; positive-definite kinetic energy always qualifies). With the licence in hand, the Hamiltonian is , velocities eliminated (see The Hamiltonian Function). Now the theorem, stated with its logical seams showing. The claim is a biconditional: a curve solves the Euler–Lagrange equations iff the corresponding phase-space curve , with manufactured by the momentum map, solves
where: the two equations have unequal logical status, and the proof will make it explicit: the first is an identity of the transformation — true for any curve consistent with the momentum map, physical or not — while the second is exactly equivalent to the Euler–Lagrange equation. Forces, potentials, the entire content of the dynamics enter through the second equation alone.
We are proving that every Euler–Lagrange solution, pushed through the momentum map, satisfies both canonical equations — and bookkeeping which input justifies which output. The strategy is the differential-matching argument: compute once from the definition and once as a function of its own variables, and equate coefficients. The step to watch is the last one: exactly one substitution uses the equation of motion, and it lands in exactly one place.
Step 1. From the definition , take the total differential and apply the momentum definition ; the terms cancel in pairs (the Legendre cancellation, proven in the transform article):
Step 2. Since is a function of in its own right, its differential is also
Step 3. The differentials are independent on phase space, so coefficients match one by one:
Why no physics has been used yet: everything so far is the transformation talking. The first relation is already the first canonical equation — an identity. The second relates coordinate-slopes of H and L but says nothing about motion. Any curve whatsoever that respects the momentum map satisfies these.
Step 4. Now, and only now, impose the dynamics: on Euler–Lagrange solutions, reads . Substituting into the middle relation of Step 3:
Why this is the entire dynamical content: one substitution, one output. The second canonical equation is the Euler–Lagrange equation transcribed into phase-space variables — nothing more, nothing less. Anyone who believes Hamilton's equations emerged from algebra alone has overlooked this line.
Go deeper · Derivation B · 1 minReverse direction — the canonical equations imply Euler-Lagrange
Equivalence is a two-way claim, and the return trip is where the regularity condition actually earns its keep. We assume a curve satisfies both canonical equations and reconstruct the Euler–Lagrange equation for . The strategy: use the inverse Legendre transform to rebuild , verify the momentum map re-emerges, then chain the two canonical equations together. Watch where invertibility is indispensable: without it the velocity cannot even be defined from the phase-space data.
Step 1. Reconstruct the Lagrangian by the inverse transform (the involution property of the Legendre article): , with eliminated via the first canonical equation — solvable for precisely because the transform of a regular has an invertible momentum-Hessian . Why regularity is the hinge: if the map were not invertible, distinct momenta would claim the same velocity data and the reconstructed L would be ill-defined — this is exactly what happens for gauge theories.
Step 2. Recover the momentum map from the reconstruction. Differentiating with respect to at fixed , with :
Why the bracket dies: it is the first canonical equation again — the same cancellation mechanics as always, now running in reverse.
Step 3. Differentiate with respect to by the same logic: (the bracket term cancels identically once more).
Step 4. Chain the pieces. The second canonical equation gives ; by Steps 2 and 3 this reads
— the Euler–Lagrange equation. Both directions closed: the two formulations select identical curves. The equivalence also matches the variational roots: the canonical equations follow from the phase-space (modified) Hamilton's principle, with and varied independently — the integrand is the reconstructed , so the two action principles are one principle in two variable sets. The variational derivation itself is worked in Hamilton's Canonical Equations. As a quick sanity check: for , Step 1 reconstructs , and Steps 2–4 recover — the expected equation of motion.
What translates into what
| Lagrangian side | Hamiltonian side | via |
|---|---|---|
| second-order EL equations | first-order canonical equations | the dissection above |
| initial data | initial data | momentum map, both ways |
| cyclic coordinate | independent of ; banked | |
| ; conserved | matched time-slopes | |
| energy function | , same values | Legendre dictionary |
| action | phase-space action | same principle, two variable sets |
| gauge freedom | canonical transformations | generating functions |
Limiting cases
| Case | Result | Meaning |
|---|---|---|
| regular (positive-definite ) | full two-way equivalence | the standard mechanical situation |
| dictionary tears; constraints | singular/gauge systems need Dirac–Bergmann | |
| cyclic coordinate present | conserved visible on both sides | Hamiltonian side shows it as a missing variable in |
| quadratic (oscillator) | round trip exact in closed form | Worked Example 1; the standard test case |
| relativistic particle | equivalence intact ( convex for ) | regularity, not the form, is what matters |
| free particle | both reduce to | sanity floor |
Worked examples
1 · Round trip on the harmonic oscillator (confidence builder)
Take , , released from at rest. Run both operating systems and confirm they produce the same motion, the same frequency, and the same conserved number.
Step 1. Lagrangian route. ; Euler–Lagrange: , so and for this release.
Step 2. Hamiltonian route. , . Canonical pair: (the identity half) and (the dynamics half). Differentiate the first, substitute the second: — the same second-order equation, reassembled from its two halves.
Step 3. Match the trajectories numerically at (a quarter period, ): Lagrangian route gives , . Hamiltonian route: , and ✓ — identical state, either bookkeeping.
Step 4. Match the conserved number. Lagrangian side, energy function: at release. Hamiltonian side at : ✓. Same value, carried by two different functions of two different variable sets — the equivalence in one number.
2 · Projectile with a cyclic coordinate: watch the dictionary work (exam level)
A projectile of mass is launched with , (). Solve by the Hamiltonian route, exploit the cyclic coordinate, find the apex height, and audit against the Lagrangian route and energy conservation.
Step 1. Build . , momenta , , so . At launch: , .
Step 2. Read the structure before solving — the Hamiltonian payoff. is absent from : cyclic, so and is banked for the whole flight. No explicit : is conserved. Two conservation laws harvested by inspection.
Step 3. Integrate the remaining pair: gives ; apex at : . Height from : — matching the elementary .
Step 4. Audit both books. Lagrangian route: , — the same equations the canonical pairs reassemble into, so trajectories agree identically. Energy check at the apex: , , total — exactly the launch kinetic energy ✓. Everything the Lagrangian knows, the Hamiltonian knows; but the banked and conserved were visible before integrating on the Hamiltonian side — that head start is why the phase-space formulation dominates whenever structure matters more than raw equation-pushing.
Origins · 1 minCarl Gustav Jacob Jacobi and how this was discovered
Jacobi took Hamilton's 1834–35 essays — brilliant, optical in spirit, and awkward to compute with — and made them into a machine. His Königsberg lectures, published as the Vorlesungen über Dynamik, hammered out the transformation theory: which changes of phase-space variables preserve the canonical form, how generating functions organize them, and how a single partial differential equation (now Hamilton–Jacobi) can replace the entire system of motion. Along the way he policed the logic of the equivalence itself, insisting on which relations were identities of the transform and which carried dynamics — the very dissection of this article. Working at a furious pace despite chronic ill health, Jacobi also co-founded the theory of elliptic functions in a legendary rivalry with Abel; the two strands met when his elliptic functions turned out to solve the spinning tops his mechanics had organized. He died of smallpox at 46, his lecture notes still setting the syllabus for analytical mechanics two centuries on.
Going further
References. Goldstein, Poole & Safko, Classical Mechanics, 3rd ed., §8.1 and §8.5 · Landau & Lifshitz, Mechanics, 3rd ed., §40 · Taylor, Classical Mechanics, §13.3 · Arnold, Mathematical Methods of Classical Mechanics, Ch. 3 and §14–15 · Morin, Introduction to Classical Mechanics, Ch. 15 The key checkpoints in the derivation are: (1) the Legendre cancellation of terms; (2) coefficient matching giving the three relations , , ; (3) the SHO Hamiltonian and the confirmation that both routes yield . Worked-example numbers on this page (oscillator , , quarter-period state , ; projectile , apex at , energy both ends) are illustrative arithmetic recomputed from the boxed formulas.
Builds on: Legendre Transformation · Generalized Momenta · The Hamiltonian Function · Hamilton's Canonical Equations Leads to: Phase Space · Hamiltonian Flow · Liouville's Theorem · Hamiltonian as Total Energy
If the two formulations are equivalent, why does anyone bother with both?
Equivalent content, very different affordances. The Lagrangian is a coordinate-change scalar: symmetries are manifest, Noether's theorem is one line, constraints join via multipliers, and relativistic field theories practically write themselves. The Hamiltonian buys state-space structure: conserved quantities visible by inspection (Worked Example 2 harvested two before integrating), a geometric flow with Liouville's theorem, canonical transformations that can trivialize a problem, and direct lines to statistical and quantum mechanics. The professional pattern is a pipeline, not a choice: construct from symmetry, transform to to analyze, compute, or quantize — with this article's theorem as the warranty that the pipeline never leaks.
How can varying q and p independently in the phase-space action be legitimate, when p is defined from q̇?
Because on phase space is not defined from — it is an independent coordinate, and the variational principle is entitled to wiggle all directions. The magic is that the stationarity conditions themselves re-derive the relation you feared was being ignored: varying in yields , which is exactly the momentum–velocity link, now as an output rather than an assumption. Varying (with endpoints fixed only in — note the asymmetry) yields the dynamical half. The Lagrangian principle bakes the link in from the start; the phase-space principle discovers it. Same principle, two bookkeeping conventions — the full derivation is in Hamilton's Canonical Equations.
Where exactly does the equivalence break for singular Lagrangians, and what survives?
It breaks at the very first step of either direction: the momentum map is not invertible, so velocities cannot be traded for momenta (forward) and cannot be reconstructed from them (reverse). What survives is a constrained equivalence. The image of the momentum map is a submanifold of phase space; Dirac's algorithm builds a Hamiltonian there, sorts constraints into classes, and identifies which generate gauge transformations — redundancies of description rather than physics. The Lagrangian and constrained-Hamiltonian descriptions then agree again, on the constraint surface, up to gauge. Electromagnetism is the canonical worked case; this is not pathology but the normal condition of every fundamental field theory we have.
Do the two sides' gauge freedoms — adding dF/dt to L, canonical transformations of H — correspond?
They overlap but are not identical in scope, and the mismatch is instructive. Adding a total derivative to changes nothing in the Euler–Lagrange equations; through the dictionary it induces a specific canonical transformation (generated by ) that relabels momenta . But the canonical group is far larger: transformations may mix and wholesale (even swap their roles), most of which correspond to no Lagrangian-side relabeling at all — there is no configuration-space change of variables that turns a coordinate into a momentum. This asymmetry is a genuine advantage of the phase-space formulation: action-angle variables and Hamilton–Jacobi theory live in that extra freedom.
Is the equivalence local or global — can convexity hold in patches but fail overall?
The theorem as proven is local: regularity (1) makes the momentum map a local diffeomorphism, and the two dynamics agree wherever the map is honestly invertible. Global subtleties are real but tame in mechanics: for the standard the map is globally linear in and the equivalence is global. Exotic Lagrangians with non-convex velocity dependence (some effective field theories, k-essence models in cosmology) can have momentum maps that fold, giving multiple Hamiltonian branches with genuinely different physics on each — the Legendre–Fenchel construction and branch-tracking then replace the naive dictionary. If your kinetic energy is positive-definite, none of this touches you.
Numerically, does it matter which side I integrate?
Often decisively. Reducing the canonical pair back to a second-order equation and handing it to a generic ODE solver discards the phase-space structure; energy then drifts secularly over long integrations. Symplectic integrators — leapfrog, Störmer–Verlet, and their higher-order kin — advance the first-order canonical system by maps that exactly preserve the phase-space area element, which is why solar-system and molecular-dynamics codes hold energy errors bounded over billions of steps. The equivalence theorem says the exact trajectories agree; discretization breaks the tie, and it breaks it in favour of the Hamiltonian side whenever long-time fidelity matters. (Variational integrators, built by discretizing the Lagrangian action, recover the same benefit from the other shore — fittingly, the two approaches are themselves equivalent.)
The two canonical equations look symmetric — why does all the physics sit in only one of them?
The symmetry of appearance hides an asymmetry of origin, and a change of system makes it vivid. Keep the same kinetic energy but swap the potential for something else: the Hamiltonian changes only through , the identity is untouched, and only feels the new force. The identity half depends on how momentum was defined (the kinetic structure); the dynamical half depends on what forces act. In the geometric language of the flow, the canonical structure (the ninety-degree rotation) is fixed once and for all, while supplies the landscape — changing physics means changing the landscape, never the rotation. That division of labour is precisely what canonical transformations exploit, and what breaks (informatively) in the constrained case.