Intuition What this page is for
The parent note built the machine . Here we drive it through every road condition : nice curves, sign traps, degenerate (straight-line) inputs, limiting behaviour where the transform blows up, a real lab word-problem, and an exam twist.
If you meet a case not on this page, it will still be a combination of these cells — nothing new can surprise you.
Prerequisites we lean on: Internal Energy and the First Law , Maxwell Relations , Thermodynamic Stability and Convexity , and the mechanics cousin Lagrangian to Hamiltonian (Legendre in Mechanics) . Chemistry payoff lands in Chemical Potential and Phase Equilibrium ; the statistical origin of F lives in Partition Functions .
Every Legendre problem is one (or a blend) of these cells:
Cell
Case class
What can go wrong / what to watch
Hit by
A
Convex power law f = 2 1 a x 2 , a > 0
the "textbook" case, sign of g
Ex 1
B
Sign trap: slope is negative (− P slot)
subtract a negative = add
Ex 2
C
Non-quadratic convex f = e x
inverting p = f ′ needs ln , domain p > 0
Ex 3
D
Degenerate: linear f = c x
slope constant → transform undefined/collapses
Ex 4
E
Limiting / boundary: convexity a → 0 +
transform diverges, stability edge
Ex 5
F
Real-world word problem (lab: fixed T , P )
choosing the right potential G
Ex 6
G
Full thermo swap on a real gas
recover P , S as slopes
Ex 7
H
Exam twist: double transform (involution)
prove you return home
Ex 8
We now hit each cell.
Worked example Legendre transform of
f ( x ) = 2 1 a x 2 with a > 0
Forecast: guess the sign of g ( p ) before reading. (Trap: people expect it positive like f .)
Step 1. Slope: p = f ′ ( x ) = a x .
Why this step? The Legendre transform re-labels the curve by its slope, so the first thing we compute is the slope function.
Step 2. Invert: x = p / a .
Why this step? g must be a function of p alone ; every x must be evicted.
Step 3. Substitute into g = f − p x :
g ( p ) = 2 1 a ( a p ) 2 − p ⋅ a p = 2 a p 2 − a p 2 = − 2 a p 2 .
Why this step? This is the definition g = f − p x ; the negative result is the point — the intercept of a rising tangent sits below the axis.
Verify: d p d g = − a p = − x . ✓ Matches the slope relation d g / d p = − x . Numerically with a = 2 , x = 3 : f = 9 , p = 6 , g = − 9 . Since f − p x = 9 − 18 = − 9 . ✓
Worked example Enthalpy from
U : swap V , whose slope is negative
Suppose near equilibrium U ( V ) = U 0 + 2 1 k ( V − V 0 ) 2 at fixed S , N , with k > 0 . Build the transform on V .
Forecast: do we get U − P V or U + P V ? Guess first.
Step 1. Read the slope with its sign : ∂ V ∂ U = k ( V − V 0 ) . From the first law d U = ⋯ − P d V , that slope is − P .
So − P = k ( V − V 0 ) , i.e. P = − k ( V − V 0 ) .
Why this step? The whole trap is forgetting the minus in − P d V . Reading the sign from the differential kills the trap.
Step 2. Legendre subtract = slope × variable = ( − P ) V . So
H = U − ( − P ) V = U + P V .
Why this step? "Subtract slope×variable" is literal; here slope is − P , so we subtract a negative → add P V .
Step 3. Differential check: d H = d U + P d V + V d P = ( T d S − P d V ) + P d V + V d P = T d S + V d P .
Why this step? Confirms the − P d V cancelled and H now rides on d P — pressure became the driver.
Verify (numbers): let k = 4 , V 0 = 1 , U 0 = 0 , V = 3 . Then U = 2 1 ( 4 ) ( 2 ) 2 = 8 , P = − 4 ( 2 ) = − 8 , so H = U + P V = 8 + ( − 8 ) ( 3 ) = 8 − 24 = − 16 . And the wrong formula U − P V = 8 − ( − 24 ) = 32 — clearly different, showing the sign matters. ✓
H = U − P V ."
The slope of U in V is − P , not P . Subtracting ( − P ) V adds P V . Always read the slope's sign from the differential first.
Worked example Legendre transform of
f ( x ) = e x
Forecast: for which p does g ( p ) even exist? Guess the domain.
Step 1. Slope: p = f ′ ( x ) = e x .
Why this step? Same first move — get the slope function.
Step 2. Invert: since e x > 0 always, we need p > 0 , and x = ln p .
Why this step? Inverting p = f ′ ( x ) is where the domain of g is born. e x only produces positive slopes, so g lives only on p > 0 — a genuine restriction, unlike the parabola.
Step 3. g ( p ) = f − p x = e l n p − p ln p = p − p ln p .
Why this step? Plain substitution of x = ln p into g = f − p x .
Verify: d p d g = 1 − ( ln p + 1 ) = − ln p = − x . ✓ (slope relation holds). At x = 0 : p = 1 , g = 1 − 1 ⋅ 0 = 1 = f ( 0 ) — tangent at the bottom has intercept = f , correct since slope×0 term vanishes. ✓
Worked example What happens for
f ( x ) = c x (a line)?
Forecast: guess whether the transform exists at all.
Step 1. Slope: p = f ′ ( x ) = c — a constant , independent of x .
Why this step? We always start with the slope; here it never changes.
Step 2. Try to invert p = c for x . Impossible: for p = c every x qualifies; for p = c no x does.
Why this step? The transform requires a one-to-one slope map. A straight line has one slope everywhere → the map collapses.
Step 3. Interpret. Along p = c : g = f − p x = c x − c x = 0 . The "curve" degenerates to a single point ( c , 0 ) — all information about which x is lost.
Why this step? Shows the failure geometrically: a line has no curvature, so "tangent lines" don't fan out — they're all the same line, carrying no positional info.
Verify: Second derivative f ′′ = 0 . The Legendre transform is well-defined exactly when f ′′ = 0 (strict convexity/concavity). Here f ′′ = 0 ⇒ degenerate. ✓ This is why stability (∂ 2 U / ∂ S 2 = T / C V > 0 ) is what guarantees the thermo transforms work.
g ( p ) = − 2 a p 2 as a → 0 +
Forecast: guess what happens to g at fixed p as the parabola flattens.
Step 1. Fix p = 0 , let a → 0 + : g = − 2 a p 2 → − ∞ .
Why this step? a is the curvature f ′′ . Sending a → 0 approaches the degenerate line of Cell D — the transform must break, and it does so by diverging.
Step 2. Meanwhile the x that produces slope p is x = p / a → ∞ .
Why this step? To keep slope p on an ever-flatter parabola you must go ever further out — the tangent point runs to infinity, dragging the intercept to − ∞ .
Step 3. Thermodynamic reading: if C V → ∞ (curvature of U in S vanishing), the system loses its ability to set a unique temperature-entropy relation — a phase-transition-like edge.
Why this step? Connects the pure-math limit to real physics: diverging response = onset of instability.
Verify: at a = 0.1 , p = 2 : g = − 0.2 4 = − 20 . At a = 0.01 : g = − 0.02 4 = − 200 . Monotonically to − ∞ . ✓
Worked example "A reaction runs in an open beaker on the bench. Which potential do I minimize?"
The beaker is open to the atmosphere (pressure P fixed by the room) and sits in the lab (temperature T fixed by the room). Particle number N can change as reactants convert.
Forecast: guess the potential before computing.
Step 1. List the controlled variables: T (room) and P (atmosphere).
Why this step? The right potential is the one whose natural variables are exactly what you hold fixed — then equilibrium becomes a clean minimum.
Step 2. Match to the fundamental relations. Only G has d G = − S d T + V d P + μ d N , natural in ( T , P , N ) .
Why this step? U ( S , V , N ) , H ( S , P , N ) , F ( T , V , N ) all still carry an uncontrolled natural variable (S or V ). G alone is native to the bench.
Step 3. At fixed T , P : d G = μ d N . Equilibrium ⇔ d G = 0 ⇔ chemical potentials balance.
Why this step? This is the whole reason chemists live in G ; see Chemical Potential and Phase Equilibrium .
Verify (units): [ μ d N ] = ( J/mol ) ( mol ) = J , matching [ G ] = J . And d G = − S d T + V d P + μ d N with d T = d P = 0 leaves only μ d N . ✓
F ( T , V , N ) of an ideal gas, read off pressure and entropy
Take the Helmholtz free energy piece F = − N k B T ln V + ( terms not depending on V ) at fixed T , N .
Forecast: guess whether P = + ∂ F / ∂ V or − ∂ F / ∂ V .
Step 1. From d F = − S d T − P d V + μ d N , the V -slope is ( ∂ V ∂ F ) T , N = − P .
Why this step? Read the sign straight from the differential (Cell B lesson).
Step 2. Compute: ∂ V ∂ ( − N k B T ln V ) = − V N k B T . Set equal to − P :
− P = − V N k B T ⇒ P = V N k B T .
Why this step? The ideal gas law drops out as a slope of a potential — no separate postulate needed.
Step 3. Entropy from the other slot: S = − ( ∂ T ∂ F ) V , N .
Why this step? Same machine, different variable — a Maxwell/slope pairing (see Maxwell Relations ).
Verify (numbers): N = 2 , k B = 1 (natural units), T = 300 , V = 10 : P = 10 2 ⋅ 1 ⋅ 300 = 60 . And ∂ F / ∂ V = − 10 2 ⋅ 300 = − 60 = − P . ✓ Units of N k B T / V : m 3 ( J/K ) ( K ) = J/m 3 = Pa . ✓
f ( x ) = 2 1 a x 2 twice and show you return home
Forecast: guess what the second transform gives — the original, or something scaled?
Step 1. First transform (from Ex 1): g ( p ) = − 2 a p 2 , with slope d p d g = − a p .
Why this step? We need g and its slope as the input to the second transform.
Step 2. New conjugate variable q = d p d g = − a p , so p = − a q .
Why this step? The involution proof requires treating g as a fresh f and repeating the recipe.
Step 3. Second transform h ( q ) = g − q p = − 2 a p 2 − q ( − a q ) = − 2 a ( − a q ) 2 + a q 2 = − 2 a q 2 + a q 2 = 2 a q 2 .
Why this step? This is 2 1 a q 2 — identical in form to the original f . The transform is its own inverse.
Verify (numbers): a = 2 , q = 3 : h = 2 1 ( 2 ) ( 9 ) = 9 = f ( 3 ) = 2 1 ( 2 ) ( 9 ) = 9 . ✓ Involution confirmed — this is the mathematical guarantee that no information was ever lost across all four potentials.
Recall Which cell fails, and why?
Only Cell D (linear f , f ′′ = 0 ) has no well-defined transform ::: because the slope map p = f ′ ( x ) is not invertible — one slope for all x .
What guarantees thermo transforms always work ::: stability/convexity, e.g. ∂ 2 U / ∂ S 2 = T / C V > 0 .
Mnemonic Read the sign, then subtract slope×variable
Every case reduced to: (1) compute slope, (2) invert (this reveals the domain and whether it's degenerate), (3) g = f − ( slope ) ( x ) . The only villain is the sign of the slope and the flatness (f ′′ = 0 ) that kills invertibility.