2.1.11 · D2Analytical Mechanics

Visual walkthrough — Hamiltonian — definition H = Σpᵢq̇ᵢ − L

1,898 words9 min readBack to topic

We build one idea: how to swap the variable "velocity" for the variable "momentum". That swap is the whole game, and it is called a Legendre Transform.


Step 1 — A curve, and two honest ways to describe it

WHAT. Forget physics for a moment. Take any curve that bends upward — a bowl shape. Call the horizontal axis and the height of the curve . "" just means "the height of the curve above the point ".

WHY. Before we swap variables we must ask: what does it even mean to describe a curve? The usual way is the list of points . But there is a second, equally complete way — describe the curve by its slopes. This second description is exactly what turns into , so we start here.

PICTURE.

Figure — Hamiltonian — definition H = Σpᵢq̇ᵢ − L

The blue bowl is . The amber dot sits at one chosen . The cyan line touching the bowl there is the tangent — the straight line that grazes the curve at that single point. Its steepness is the slope, written :

Here (read "-prime of ") is the derivative — a number that answers "if I nudge a tiny bit right, how fast does the height climb?" A steep bowl gives a big ; a flat bottom gives .


Step 2 — Reading the curve by its slope instead of its height

WHAT. As you slide the amber dot left to right along the bowl, the tangent's slope steadily changes. For a bowl (a convex curve — one that only ever bends one way) each position gives a different slope . No two points share a slope.

WHY. That "no two points share a slope" property is the key that lets us run the description backwards: if someone hands you a slope , there is exactly one point on the bowl with that slope. So the slope can serve as a label for points, just as good as itself. This is why we insist the curve is convex — otherwise two points would share a slope and the label would be ambiguous.

PICTURE.

Figure — Hamiltonian — definition H = Σpᵢq̇ᵢ − L

Two amber dots, two cyan tangents, two clearly different slopes. The arrow reminds you: slope is a legitimate name-tag for position on a convex curve. We are about to trade the name-tag for the name-tag .


Step 3 — The gap between the tangent line and the curve

WHAT. Pick a point at with slope . Extend its tangent line all the way back to the vertical axis (to ). Read off where it crosses. Call the crossing height (the minus sign is a convention that will pay off). Then

Let us name every symbol right here:

  • — slope times horizontal distance = how much height the straight tangent line gains from up to .
  • — the actual height of the curve at .
  • — the vertical gap you'd fall from the tangent's back-projection to the axis; equivalently the negative of the tangent's intercept.

WHY. This one algebraic combination is the entire Legendre transform. Everything after this is bookkeeping. We build it geometrically first so the formula is never a rabbit out of a hat.

PICTURE.

Figure — Hamiltonian — definition H = Σpᵢq̇ᵢ − L

Follow the cyan tangent line back to the axis. The amber bracket is . Notice: as we slide , both and change, so changes too — and we will now think of as a function of the slope , not of .


Step 4 — Prove the swap really removed (the differential trick)

WHAT. We must check that genuinely depends on and not secretly on . Take a tiny change of everything (a differential, written = "an infinitesimal change of"):

The two terms cancel, leaving

WHY. Look what happened: contains only — no leftover . That is the mathematical proof that is a clean function of . And the coefficient of is , so : the transform is its own inverse, slopes and positions have simply traded roles.

PICTURE.

Figure — Hamiltonian — definition H = Σpᵢq̇ᵢ − L

The cartoon shows the cancellation: a green arrow and a red arrow annihilate, and only the amber survives. This exact cancellation is what happens in the physics derivation below — watch for it.


Step 5 — Rename the axes: this IS the Hamiltonian

WHAT. Now change the dictionary. Replace:

geometry word physics word
horizontal velocity ("" = rate of change of coordinate )
height [[Lagrangian Mechanics
slope momentum
transform Hamiltonian

WHY. The Lagrangian is a bowl-shaped function of velocity (for a normal kinetic term it literally is a parabola). Its slope in the velocity direction is the momentum — that is not a coincidence, it is the definition (here means "slope while holding the other variables fixed"). So the Legendre transform of in the direction is exactly .

PICTURE.

Figure — Hamiltonian — definition H = Σpᵢq̇ᵢ − L

Same bowl as Step 1, relabelled. The horizontal axis now reads , the curve is , the amber gap is . Nothing new happened — we only changed the words on the axes.


Step 6 — Do it for a real particle (bowl → parabola)

WHAT. Take . The velocity-bowl is the parabola .

  • Slope (momentum): .
  • Invert: — read the position off the slope.
  • Assemble:

WHY. This is Step 3's with an actual parabola, so you see the number appear as the intercept-gap of the tangent to a parabola. This recovers kinetic-plus-potential energy — the canonical energy of the system.

PICTURE.

Figure — Hamiltonian — definition H = Σpᵢq̇ᵢ − L

The cyan parabola ; the amber gap read at velocity equals . The tangent's slope is the momentum . Every quantity in the boxed answer is visible in the drawing.


Step 7 — The degenerate case: a flat curve breaks the swap

WHAT. What if is not a bowl in ? Suppose is linear in the velocity, e.g. . Then the slope is the constant — it does not depend on at all.

WHY. Now the swap fails: the equation cannot be inverted for (many give the same slope). Geometrically the "bowl" has degenerated into a straight ramp — every point shares one slope, so slope is no longer a valid name-tag (contrast Step 2). This is the singular Legendre case; it is exactly why the parent's condition " must be quadratic in " appears. It flags constrained/gauge systems handled by more advanced machinery.

PICTURE.

Figure — Hamiltonian — definition H = Σpᵢq̇ᵢ − L

Left: healthy bowl, slopes fan out, unique labels. Right: a straight ramp — the tangent line is the curve, one slope for all points, the inversion has no answer. The amber "no unique " mark warns you.

Recall When can you trust the swap?

Legendre transform is invertible iff the curve is strictly convex in the swapped variable ::: iff curves (is not flat/linear) in , i.e. .


The one-picture summary

Figure — Hamiltonian — definition H = Σpᵢq̇ᵢ − L

The blueprint compresses all seven steps: the velocity-bowl , its tangent whose slope is the momentum , and the amber intercept-gap that is the Hamiltonian . Read the picture, read the physics.

Recall Feynman retelling (say it out loud)

"The Lagrangian is a bowl-shaped hill drawn against velocity. At any velocity, the steepness of that hill is what we call momentum. Now here's the trick: instead of labelling each spot on the hill by its velocity, label it by its steepness — because on a bowl every spot has its own unique steepness. To do the relabelling, draw the tangent line at your spot and slide it back to the axis; the little gap it leaves, , is the Hamiltonian. When I take a tiny step, the velocity-change term cancels perfectly and only the momentum-change survives — that cancellation is the proof that the Hamiltonian truly forgot about velocity and only remembers momentum. If the hill is a real parabola, this gap works out to , the good old energy. And if the hill were a flat ramp instead of a bowl, every spot would share the same steepness, the relabelling would be impossible, and the whole trick would break — which is the physicist's warning sign of a constrained system."


Related: Legendre Transform · Hamilton's Canonical Equations · Phase Space · Poisson Brackets · Conservation Laws & Noether's Theorem · back to the parent topic.