Equivalence of Lagrangian and Hamiltonian Formulations

Mechanics ships with two complete operating systems. One runs on configuration space: a single function L(q,q˙,t)L(q,\dot q,t), one variational principle, and nn second-order Euler–Lagrange equations. The other runs on phase space: a function H(q,p,t)H(q,p,t), and 2n2n 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, q˙i=∂H/∂pi\dot q_i=\partial H/\partial p_i, turns out to be pure bookkeeping — an identity of the transformation that holds before any physics is imposed. The other, p˙i=−∂H/∂qi\dot p_i=-\partial H/\partial q_i, 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 (2n2n 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.

Key takeaways
  • The Lagrangian formulation lives on configuration space with coordinates qq and velocities q˙\dot q; the Hamiltonian formulation lives on phase space with coordinates qq and conjugate momenta pp.
  • The bridge is the Legendre transformation H(q,p,t)=∑ipiq˙i−L(q,q˙,t)H(q,p,t)=\sum_i p_i\dot q_i - L(q,\dot q,t), with pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i invertible to give q˙i(q,p,t)\dot q_i(q,p,t).
  • Hamilton's 2n2n first-order equations q˙i=∂H/∂pi\dot q_i=\partial H/\partial p_i, p˙i=−∂H/∂qi\dot p_i=-\partial H/\partial q_i are algebraically equivalent to the nn second-order Euler–Lagrange equations.
  • The equivalence is a clean identity-by-identity matching of partial derivatives of HH and LL; no dynamical assumption is hidden in the transformation itself.
  • Both formulations follow from the same variational principle δS=0\delta S=0; the Hamiltonian version is the modified (phase-space) Hamilton's principle.
  • Key idea: matching the differential of HH 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 core insight

The Legendre transformation H=∑ipiq˙i−LH=\sum_i p_i\dot q_i - L converts the velocity q˙i\dot q_i into the momentum pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i as the active variable; matching the differential of HH 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 ([q^,p^]=iℏ[\hat q,\hat p]=i\hbar, Schrödinger evolution), while the path integral sums eiS/ℏe^{iS/\hbar} 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 LL and HH as the same physics photographed in two coordinate slices. The Lagrangian draws the landscape over (q,q˙)(q,\dot q); the Hamiltonian draws it over (q,p)(q,p). The Legendre transformation is the relabelling from the slope coordinate q˙\dot q to the slope value pp — lossless whenever LL 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 nn variables needs 2n2n initial numbers, {qi(0),q˙i(0)}\{q_i(0),\dot q_i(0)\}; a first-order system in 2n2n variables needs 2n2n numbers, {qi(0),pi(0)}\{q_i(0),p_i(0)\}. 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:

Figure
Two operating systems, one physics — the equivalence as a two-way bridge
Lagrangian OS L(q, q̇, t) on configuration space n second-order Euler–Lagrange eqs data: q(0), q̇(0) — 2n numbers strengths: symmetry, covariance Hamiltonian OS H(q, p, t) on phase space 2n first-order canonical eqs data: q(0), p(0) — 2n numbers strengths: flow, brackets, QM p = ∂L/∂q̇ q̇ = ∂H/∂p needs det(∂²L/∂q̇∂q̇) ≠ 0 solve EL solve canonical the same trajectory q(t) point for point, both routes, every regular system

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,

det⁡ ⁣(∂2L∂q˙i ∂q˙j)≠0(1)\det\!\left(\frac{\partial^2 L}{\partial\dot q_i\,\partial\dot q_j}\right)\neq0 \qquad (1)

where: regularity is precisely the invertibility of the momentum map pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i for the velocities, q˙i=q˙i(q,p,t)\dot q_i=\dot q_i(q,p,t) — the licence for the whole construction (see Legendre Transformation; positive-definite kinetic energy always qualifies). With the licence in hand, the Hamiltonian is H=∑ipiq˙i−LH=\sum_i p_i\dot q_i-L, velocities eliminated (see The Hamiltonian Function). Now the theorem, stated with its logical seams showing. The claim is a biconditional: a curve q(t)q(t) solves the Euler–Lagrange equations iff the corresponding phase-space curve (q(t),p(t))\big(q(t),p(t)\big), with p(t)p(t) manufactured by the momentum map, solves

q˙i=∂H∂piandp˙i=−∂H∂qi(2)\dot q_i=\frac{\partial H}{\partial p_i}\qquad\text{and}\qquad \dot p_i=-\frac{\partial H}{\partial q_i} \qquad (2)

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.

Figure
The dissection of the canonical pair — one identity, one law of motion
q̇ = ∂H/∂p kinematic identity of the transform holds before any physics — "what p means" ṗ = −∂H/∂q the law of motion every force lives here — "how p changes" Euler–Lagrange equation the single dynamical input Legendre transformation pure bookkeeping, no dynamics the canonical pair, sorted by logical origin to test new physics, probe the red equation — the blue one only certifies your algebra
Derivation AForward direction — Euler-Lagrange implies the canonical equations, with the seams visible

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 dH\mathrm{d}H 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 H=∑ipiq˙i−LH=\sum_i p_i\dot q_i-L, take the total differential and apply the momentum definition pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i; the dq˙i\mathrm{d}\dot q_i terms cancel in pairs (the Legendre cancellation, proven in the transform article):

dH=∑iq˙i dpi−∑i∂L∂qi dqi−∂L∂t dt\mathrm{d}H=\sum_i\dot q_i\,\mathrm{d}p_i-\sum_i\frac{\partial L}{\partial q_i}\,\mathrm{d}q_i-\frac{\partial L}{\partial t}\,\mathrm{d}t

Step 2. Since HH is a function of (q,p,t)(q,p,t) in its own right, its differential is also

dH=∑i∂H∂pi dpi+∑i∂H∂qi dqi+∂H∂t dt\mathrm{d}H=\sum_i\frac{\partial H}{\partial p_i}\,\mathrm{d}p_i+\sum_i\frac{\partial H}{\partial q_i}\,\mathrm{d}q_i+\frac{\partial H}{\partial t}\,\mathrm{d}t

Step 3. The differentials dqi,dpi,dt\mathrm{d}q_i,\mathrm{d}p_i,\mathrm{d}t are independent on phase space, so coefficients match one by one:

∂H∂pi=q˙i,∂H∂qi=−∂L∂qi,∂H∂t=−∂L∂t\frac{\partial H}{\partial p_i}=\dot q_i,\qquad \frac{\partial H}{\partial q_i}=-\frac{\partial L}{\partial q_i},\qquad \frac{\partial H}{\partial t}=-\frac{\partial L}{\partial t}

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, ddt∂L∂q˙i=∂L∂qi\frac{\mathrm{d}}{\mathrm{d}t}\frac{\partial L}{\partial\dot q_i}=\frac{\partial L}{\partial q_i} reads p˙i=∂L/∂qi\dot p_i=\partial L/\partial q_i. Substituting into the middle relation of Step 3:

p˙i=−∂H∂qi\dot p_i=-\frac{\partial H}{\partial q_i}

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
Derivation BReverse 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 (q(t),p(t))\big(q(t),p(t)\big) satisfies both canonical equations and reconstruct the Euler–Lagrange equation for q(t)q(t). The strategy: use the inverse Legendre transform L=∑ipiq˙i−HL=\sum_i p_i\dot q_i-H to rebuild LL, 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): L(q,q˙,t)=∑ipiq˙i−H(q,p,t)L(q,\dot q,t)=\sum_i p_i\dot q_i-H(q,p,t), with pp eliminated via the first canonical equation q˙i=∂H/∂pi\dot q_i=\partial H/\partial p_i — solvable for pi(q,q˙,t)p_i(q,\dot q,t) precisely because the transform of a regular LL has an invertible momentum-Hessian ∂2H/∂pi∂pj\partial^2H/\partial p_i\partial p_j. 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 L=∑jpjq˙j−HL=\sum_j p_j\dot q_j-H with respect to q˙i\dot q_i at fixed (q,t)(q,t), with p=p(q,q˙,t)p=p(q,\dot q,t):

∂L∂q˙i=pi+∑j∂pj∂q˙i(q˙j−∂H∂pj)=pi\frac{\partial L}{\partial\dot q_i}=p_i+\sum_j\frac{\partial p_j}{\partial\dot q_i}\Big(\dot q_j-\frac{\partial H}{\partial p_j}\Big)=p_i

Why the bracket dies: it is the first canonical equation again — the same cancellation mechanics as always, now running in reverse.

Step 3. Differentiate LL with respect to qiq_i by the same logic: ∂L/∂qi=−∂H/∂qi\partial L/\partial q_i=-\partial H/\partial q_i (the bracket term cancels identically once more).

Step 4. Chain the pieces. The second canonical equation gives p˙i=−∂H/∂qi\dot p_i=-\partial H/\partial q_i; by Steps 2 and 3 this reads

ddt∂L∂q˙i=∂L∂qi\frac{\mathrm{d}}{\mathrm{d}t}\frac{\partial L}{\partial\dot q_i}=\frac{\partial L}{\partial q_i}

— 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, δ∫(∑ipiq˙i−H) dt=0\delta\int(\sum_i p_i\dot q_i-H)\,\mathrm{d}t=0 with qq and pp varied independently — the integrand is the reconstructed LL, 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 H=p2/2m+V(x)H=p^2/2m+V(x), Step 1 reconstructs L=12mx˙2−VL=\tfrac12 m\dot x^2-V, and Steps 2–4 recover mx¨=−V′(x)m\ddot x=-V'(x) — the expected equation of motion.

What translates into what

Lagrangian sideHamiltonian sidevia
nn second-order EL equations2n2n first-order canonical equationsthe dissection above
initial data q(0),q˙(0)q(0),\dot q(0)initial data q(0),p(0)q(0),p(0)momentum map, both ways
cyclic coordinate ∂L/∂qi=0\partial L/\partial q_i=0HH independent of qiq_i; pip_i banked∂H/∂qi=−∂L/∂qi\partial H/\partial q_i=-\partial L/\partial q_i
∂L/∂t=0\partial L/\partial t=0∂H/∂t=0\partial H/\partial t=0; HH conservedmatched time-slopes
energy function h(q,q˙,t)h(q,\dot q,t)H(q,p,t)H(q,p,t), same valuesLegendre dictionary
action ∫L dt\int L\,\mathrm{d}tphase-space action ∫(∑pq˙−H)dt\int(\sum p\dot q-H)\mathrm{d}tsame principle, two variable sets
gauge freedom L→L+dF/dtL\to L+\mathrm{d}F/\mathrm{d}tcanonical transformationsgenerating functions

Limiting cases

CaseResultMeaning
regular LL (positive-definite TT)full two-way equivalencethe standard mechanical situation
det⁡(∂2L/∂q˙∂q˙)=0\det(\partial^2L/\partial\dot q\partial\dot q)=0dictionary tears; constraints ϕ(q,p)=0\phi(q,p)=0singular/gauge systems need Dirac–Bergmann
cyclic coordinate presentconserved pip_i visible on both sidesHamiltonian side shows it as a missing variable in HH
quadratic LL (oscillator)round trip exact in closed formWorked Example 1; the standard test case
relativistic particleequivalence intact (LL convex for v<cv<c)regularity, not the T−VT-V form, is what matters
free particleboth reduce to q¨=0\ddot q=0sanity floor

Worked examples

1 · Round trip on the harmonic oscillator (confidence builder)

Take m=0.50 kgm=0.50\ \mathrm{kg}, k=8.0 N/mk=8.0\ \mathrm{N/m}, released from x0=0.10 mx_0=0.10\ \mathrm{m} 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. L=12mx˙2−12kx2L=\tfrac12 m\dot x^2-\tfrac12 kx^2; Euler–Lagrange: mx¨=−kxm\ddot x=-kx, so ω=k/m=16=4.0 rad/s\omega=\sqrt{k/m}=\sqrt{16}=4.0\ \mathrm{rad/s} and x(t)=0.10cos⁡4tx(t)=0.10\cos4t for this release.

Step 2. Hamiltonian route. p=mx˙p=m\dot x, H=p22m+12kx2H=\dfrac{p^2}{2m}+\tfrac12 kx^2. Canonical pair: x˙=p/m\dot x=p/m (the identity half) and p˙=−kx\dot p=-kx (the dynamics half). Differentiate the first, substitute the second: x¨=p˙/m=−kx/m\ddot x=\dot p/m=-kx/m — the same second-order equation, reassembled from its two halves.

Step 3. Match the trajectories numerically at t=π/8 st=\pi/8\ \mathrm{s} (a quarter period, ωt=π/2\omega t=\pi/2): Lagrangian route gives x=0x=0, x˙=−0.10×4sin⁡(π/2)=−0.40 m/s\dot x=-0.10\times4\sin(\pi/2)=-0.40\ \mathrm{m/s}. Hamiltonian route: p(t)=−mωx0sin⁡ωt=−0.50×4×0.10=−0.20 kg m/sp(t)=-m\omega x_0\sin\omega t=-0.50\times4\times0.10=-0.20\ \mathrm{kg\,m/s}, and x˙=p/m=−0.40 m/s\dot x=p/m=-0.40\ \mathrm{m/s} ✓ — identical state, either bookkeeping.

Step 4. Match the conserved number. Lagrangian side, energy function: h=T+V=12kx02=12×8.0×0.010=0.040 Jh=T+V=\tfrac12 kx_0^2=\tfrac12\times8.0\times0.010=0.040\ \mathrm{J} at release. Hamiltonian side at t=π/8t=\pi/8: H=p2/2m=(0.20)2/1.0=0.040 JH=p^2/2m=(0.20)^2/1.0=0.040\ \mathrm{J} ✓. 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 m=0.20 kgm=0.20\ \mathrm{kg} is launched with x˙0=30 m/s\dot x_0=30\ \mathrm{m/s}, y˙0=40 m/s\dot y_0=40\ \mathrm{m/s} (g=9.81 m/s2g=9.81\ \mathrm{m/s^2}). 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 HH. L=12m(x˙2+y˙2)−mgyL=\tfrac12 m(\dot x^2+\dot y^2)-mgy, momenta px=mx˙p_x=m\dot x, py=my˙p_y=m\dot y, so H=px2+py22m+mgyH=\dfrac{p_x^2+p_y^2}{2m}+mgy. At launch: px=6.0p_x=6.0, py=8.0 kg m/sp_y=8.0\ \mathrm{kg\,m/s}.

Step 2. Read the structure before solving — the Hamiltonian payoff. xx is absent from HH: cyclic, so p˙x=−∂H/∂x=0\dot p_x=-\partial H/\partial x=0 and px=6.0 kg m/sp_x=6.0\ \mathrm{kg\,m/s} is banked for the whole flight. No explicit tt: HH is conserved. Two conservation laws harvested by inspection.

Step 3. Integrate the remaining pair: p˙y=−∂H/∂y=−mg=−1.962 N\dot p_y=-\partial H/\partial y=-mg=-1.962\ \mathrm{N} gives py(t)=8.0−1.962 tp_y(t)=8.0-1.962\,t; apex at py=0p_y=0: t∗=8.0/1.962=4.08 st^*=8.0/1.962=4.08\ \mathrm{s}. Height from y˙=py/m\dot y=p_y/m: y∗=y˙0t∗−12gt∗2=40×4.08−4.905×16.63=163.1−81.6=81.5 my^*=\dot y_0 t^*-\tfrac12 g t^{*2}=40\times4.08-4.905\times16.63=163.1-81.6=\boxed{81.5\ \mathrm{m}} — matching the elementary y˙02/2g=1600/19.62=81.5 m\dot y_0^2/2g=1600/19.62=81.5\ \mathrm{m}.

Step 4. Audit both books. Lagrangian route: mx¨=0m\ddot x=0, my¨=−mgm\ddot y=-mg — the same equations the canonical pairs reassemble into, so trajectories agree identically. Energy check at the apex: T=px22m=360.40=90 JT=\dfrac{p_x^2}{2m}=\dfrac{36}{0.40}=90\ \mathrm{J}, V=mgy∗=0.20×9.81×81.5=160 JV=mgy^*=0.20\times9.81\times81.5=160\ \mathrm{J}, total 250 J250\ \mathrm{J} — exactly the launch kinetic energy 12×0.20×(302+402)=250 J\tfrac12\times0.20\times(30^2+40^2)=250\ \mathrm{J} ✓. Everything the Lagrangian knows, the Hamiltonian knows; but the banked pxp_x and conserved HH 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
CG
Carl Gustav Jacob Jacobi
1804–1851 · Königsberg and Berlin

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.

History
1788
— Lagrange's Mécanique analytique: mechanics as n second-order equations from one scalar function
1834
— Hamilton's On a General Method in Dynamics introduces H and the paired first-order equations
1835
— Hamilton's second essay completes the correspondence with the Lagrangian formulation
1843
— Jacobi's transformation theory systematizes the equivalence and its canonical freedoms
1890
— Poincaré's Méthodes nouvelles exploits the phase-space form for qualitative dynamics
1948
— Feynman's path integral quantizes the Lagrangian side; canonical quantization had taken the Hamiltonian side — equivalence, quantum edition

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 dq˙\mathrm{d}\dot q terms; (2) coefficient matching giving the three relations ∂H/∂pi=q˙i\partial H/\partial p_i=\dot q_i, ∂H/∂qi=−∂L/∂qi\partial H/\partial q_i=-\partial L/\partial q_i, ∂H/∂t=−∂L/∂t\partial H/\partial t=-\partial L/\partial t; (3) the SHO Hamiltonian H=p2/2m+kx2/2H=p^2/2m+kx^2/2 and the confirmation that both routes yield mx¨=−kxm\ddot x=-kx. Worked-example numbers on this page (oscillator ω=4.0 rad/s\omega=4.0\ \mathrm{rad/s}, H=0.040 JH=0.040\ \mathrm{J}, quarter-period state x=0x=0, p=−0.20 kg m/sp=-0.20\ \mathrm{kg\,m/s}; projectile px=6.0 kg m/sp_x=6.0\ \mathrm{kg\,m/s}, apex 81.5 m81.5\ \mathrm{m} at 4.08 s4.08\ \mathrm{s}, energy 250 J250\ \mathrm{J} 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 LL from symmetry, transform to HH 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 pp is not defined from q˙\dot q — it is an independent coordinate, and the variational principle is entitled to wiggle all 2n2n directions. The magic is that the stationarity conditions themselves re-derive the relation you feared was being ignored: varying pp in ∫(∑pq˙−H) dt\int(\sum p\dot q-H)\,\mathrm{d}t yields q˙=∂H/∂p\dot q=\partial H/\partial p, which is exactly the momentum–velocity link, now as an output rather than an assumption. Varying qq (with endpoints fixed only in qq — 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 ϕa(q,p)=0\phi_a(q,p)=0 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 dF(q,t)/dt\mathrm{d}F(q,t)/\mathrm{d}t to LL changes nothing in the Euler–Lagrange equations; through the dictionary it induces a specific canonical transformation (generated by FF) that relabels momenta p→p+∂F/∂qp\to p+\partial F/\partial q. But the canonical group is far larger: transformations may mix qq and pp 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 L=12q˙TM(q)q˙−VL=\tfrac12\dot q^{\mathsf T}M(q)\dot q-V the map is globally linear in q˙\dot q 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 V(x)V(x) for something else: the Hamiltonian changes only through VV, the identity x˙=p/m\dot x=p/m is untouched, and only p˙=−∂H/∂x\dot p=-\partial H/\partial x 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 HH 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.

Before this

Where this leads