advanced32 min studyLesson 131 in Physics

Legendre transforms and canonical momenta

Exchange velocities for momenta carefully, identifying when the local Hamiltonian construction exists and when it fails.

On this page

What you’ll understand

  • Construct a Hamiltonian by eliminating velocities.
  • Distinguish canonical momentum from mechanical momentum.
  • Test local invertibility before performing a Legendre transform.

A Lagrangian predicts motion using position and velocity. A Hamiltonian describes the same regular system using position and canonical momentum. This exchange is useful because momentum becomes an independent coordinate rather than a derivative that must be carried through every calculation. The exchange has a mathematical condition, however: the momentum definitions must determine the velocities locally. Checking that condition is part of the construction, not an optional technical qualification.

Momentum is a slope in velocity space

Hold position and time fixed and differentiate the Lagrangian with respect to each velocity. Those slopes define canonical momenta. For an ordinary Cartesian kinetic energy, the result is mass times velocity. A term linear in velocity shifts the slope without changing its second derivative. Thus canonical momentum can contain a position-dependent contribution even when the mechanical velocity and kinetic energy are unchanged.

The Legendre construction subtracts the original function from its tangent pairing. First form piq˙i−Lp_i\dot q_i-L, then replace every velocity using the inverted momentum equations. Leaving a velocity in the final expression means the exchange has not been completed. Positions, momenta, and time are the independent arguments of the Hamiltonian; an expression that secretly still depends on velocity cannot be differentiated as though those arguments were independent.

pi=∂L∂q˙i,H(q,p,t)=∑ipivi(q,p,t)−L(q,v(q,p,t),t)p_i=\frac{\partial L}{\partial\dot q_i},\qquad H(q,p,t)=\sum_i p_i v_i(q,p,t)-L(q,v(q,p,t),t)
The functions vi are velocities obtained from the momentum definitions, with position and time held fixed during inversion.↔ Scroll wide equations horizontally.

A local inverse needs a nonsingular Hessian

The relevant Jacobian is the matrix of second velocity derivatives of the Lagrangian. A nonzero determinant guarantees a local velocity-to-momentum inverse by the inverse function theorem. Positive definiteness is sufficient but stronger than necessary: a regular classical Lagrangian can have an indefinite Hessian. A local inverse also does not establish that the same inverse is single-valued across the entire velocity domain. Branches and coordinate charts still matter.

Consider a Lagrangian independent of one velocity. Its associated momentum vanishes regardless of that velocity, so no inverse can recover the missing information. That relation is a primary constraint, not permission to divide by zero or discard the coordinate immediately. Singular systems require the constrained Hamiltonian procedure developed later. Notice also that a regular transform need not preserve convexity properties familiar from optimization; here the immediate issue is equivalent local equations of motion.

Wij=∂2L∂q˙i∂q˙j,det⁡W≠0W_{ij}=\frac{\partial^2L}{\partial\dot q_i\partial\dot q_j},\qquad \det W\ne0
This is the regularity condition for a local Legendre transformation in the chosen coordinates. It does not promise a global inverse.↔ Scroll wide equations horizontally.

The Hamiltonian and energy need interpretation

For L=mq˙2/2+aqq˙−kq2/2L=m\dot q^2/2+a q\dot q-kq^2/2, the momentum is p=mq˙+aqp=m\dot q+a q. Eliminating velocity gives a shifted square in the Hamiltonian. The linear term is a total time derivative when a is constant, so it changes the momentum convention while leaving the physical acceleration unchanged. Comparing pp directly with mq˙m\dot q would therefore compare different quantities. This modest example prepares the distinction between canonical and kinetic momenta in electromagnetism.

For a time-independent regular Lagrangian, the associated energy function is conserved along solutions. In the present example it equals ordinary kinetic plus potential energy after the momentum shift is undone. Time-dependent coordinate choices or explicit time-dependent interactions require more care: the Hamiltonian still generates the chosen canonical evolution, but its numerical value need not equal a conserved laboratory energy. Always state the frame and explicit time dependence before calling a Hamiltonian simply the energy.

H=(p−aq)22m+kq22,q˙=p−aqmH=\frac{(p-aq)^2}{2m}+\frac{kq^2}{2},\qquad \dot q=\frac{p-aq}{m}
The example assumes m ≠ 0 and constant a and k. The mechanical momentum is p − aq rather than p.↔ Scroll wide equations horizontally.

A shifted momentum with unchanged energy

In consistent normalized units take m=2m=2, a=3a=3, k=2k=2, q=1q=1, and q˙=4\dot q=4. Compute canonical momentum and Hamiltonian without treating p as mechanical momentum.

  1. Differentiate with respect to velocity: p=2q˙+3q=8+3=11p=2\dot q+3q=8+3=11. The velocity Hessian is 2, so this example has a unique global velocity inverse.

  2. Evaluate L=2(42)/2+3(1)(4)−2(12)/2=16+12−1=27L=2(4^2)/2+3(1)(4)-2(1^2)/2=16+12-1=27. Then pq˙−L=44−27=17p\dot q-L=44-27=17. This calculation uses the original velocity only as a numerical check.

  3. Use the completed Hamiltonian: (11−3)2/4+1=17(11-3)^2/4+1=17. Its momentum derivative is (11−3)/2=4(11-3)/2=4, recovering the supplied velocity. Ordinary kinetic plus potential energy is also 16+1=1716+1=17.

The result

The canonical momentum is 11, the mechanical momentum is 8, and the Hamiltonian is 17. Confusing the two momenta would predict the wrong velocity and kinetic energy.

Explore the model

Interactive lab

Interactive lab · function

Read momentum as a tangent slope

Set a = 0.5 and interpret x as velocity in the normalized kinetic Lagrangian y = ax². Predict that changing x from 0.5 to 1 doubles the momentum from 0.5 to 1, then check the tangent-slope readout. The slope is 2ax, the momentum of this restricted model. The lab has coefficient and position controls only; it does not implement the shifted-momentum example or construct a general Legendre transform.

Read momentum as a tangent slopeThis lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Current readings: y at chosen x: 0.608; Tangent slope · 2ax: 1.35; Signed area · ax³/3: 0.182. All parameters are adjustable with the labeled controls below.−2.4−1.201.22.4−9−4.504.59xy(x, ax²)
y = ax²TangentSigned integral
y at chosen x
0.608
Tangent slope · 2ax
1.35
Signed area · ax³/3
0.182
t = 0 s

This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forMomentum is a derivative, and an invertible slope relation is what permits the change of independent variables.

Check your understanding

What does a nonsingular velocity Hessian establish?

Try it yourself

For L=q˙2/2+bq˙−V(q)L=\dot q^2/2+b\dot q-V(q) with constant b, find p and H. Explain why b does not change the physical force.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Differentiate before substituting. The linear velocity term is the total time derivative of bq.

Compare with the solution

The momentum is p=q˙+bp=\dot q+b, so q˙=p−b\dot q=p-b and H=(p−b)2/2+V(q)H=(p-b)^2/2+V(q). Hamilton's equations give p˙=−V′(q)\dot p=-V'(q) and q¨=p˙=−V′(q)\ddot q=\dot p=-V'(q) because b is constant. Thus b shifts the momentum coordinate but leaves the acceleration law unchanged. This conclusion would need modification for a nonconstant coefficient with additional dependencies.

Take it with you

  • Eliminate every velocity to finish the Legendre transformation.
  • A nonsingular velocity Hessian gives a local inverse, not necessarily a global one.
  • Canonical momentum may differ from mass times velocity.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.