11.01.02 · stat-mech-physics / thermodynamics

Thermodynamic potentials and Legendre transforms

draft3 tiersLean: nonepending prereqs

Anchor (Master): Callen, *Thermodynamics and an Introduction to Thermostatistics*, 2e (1985), Ch. 5–8; Landau & Lifshitz, *Statistical Physics*, Part 1, §15–20

Intuition [Beginner]

The internal energy encodes everything about a thermodynamic system. Written as a function of entropy and volume , the function is the fundamental relation: from it you can derive temperature, pressure, heat capacity, compressibility — every macroscopic property.

The problem is that and are hard to control in the lab. You cannot dial entropy to a chosen value the way you set temperature on a thermostat. What you actually control depends on the experiment: constant pressure (open to the atmosphere), constant temperature (in a water bath), or both.

Thermodynamic potentials are functions whose natural variables match what you control. Each one is obtained by "trading" an unwanted variable for a controllable one. The trading mechanism is the Legendre transform — the same mathematical operation that converts a Lagrangian into a Hamiltonian in classical mechanics 09.04.01 pending.

Three transforms of give the three remaining potentials:

  • Enthalpy . Natural variables: . Use it at constant pressure — reactions in open beakers, combustion, most chemistry.
  • Helmholtz free energy . Natural variables: . Use it at constant temperature and volume — sealed containers in thermal baths.
  • Gibbs free energy . Natural variables: . Use it at constant temperature and pressure — the most common lab condition. Nearly all of chemistry and biochemistry lives here.

The word "free" in "free energy" means the energy available to do useful work. At constant and , the maximum non-expansion work you can extract from a process is the change . A reaction that lowers proceeds spontaneously; one that raises does not.

The pattern is systematic: subtract to trade , add to trade . Each transform replaces one "natural" variable of with its conjugate — the quantity you actually hold fixed.

Visual [Beginner]

Picture a square whose four corners are the four thermodynamic potentials: (top-left), (top-right), (bottom-right), (bottom-left). The two sides of the square are labelled: the left and right edges carry (top) and (bottom); the top and bottom edges carry (left) and (right).

Moving clockwise around the square, each step is a Legendre transform: replaces by ; replaces by ; replaces by ; replaces by . Every potential on a given edge shares the two variables on the adjacent sides as its natural variables.

Thermodynamic square: U, H, G, F at the four corners. Sides labelled S/T (left-right) and V/P (top-bottom). Arrows between corners show Legendre transforms. The Born square is a mnemonic for which variables belong to which potential and which cross-derivatives give the Maxwell relations.

The square is not just a picture — it is a computational device. Each side of the square generates a Maxwell relation (see Intermediate), and the whole structure is the thermodynamic shadow of the Legendre-transform geometry.

Worked example [Beginner]

At and , liquid water has a standard Gibbs free energy of formation . The reaction has .

Because at constant and , the reaction is spontaneous. The negative sign means the products have lower Gibbs free energy than the reactants — the system releases useful work as it proceeds. In fact, this is the reaction that powers hydrogen fuel cells: the per two moles of water formed is the maximum electrical work extractable.

The reverse reaction — splitting water into hydrogen and oxygen — has . It does not happen on its own. You must supply at least that much energy (electrolysis does exactly this).

What makes the right potential here? The experiment is at constant temperature (room temperature) and constant pressure (the atmosphere). is the potential whose natural variables are exactly , so the sign of at fixed tells you spontaneity — no further calculation needed.

Check your understanding [Beginner]

Formal definition [Intermediate+]

Let a simple thermodynamic system be specified by its internal energy as a function of entropy , volume , and particle number . The fundamental relation in the energy representation is , and the differential form of the combined first and second laws 11.01.01 pending is

where is temperature, is pressure, and is chemical potential. The variables are the natural variables of ; the partial derivatives above are valid only when is expressed in terms of them.

A Legendre transform 09.04.01 pending replaces one or more extensive natural variables by their conjugate intensive variables. For a single variable, the Legendre transform of a function is , where and the maximum is achieved at satisfying . For convex the transform is involutive: applying it twice recovers .

The four thermodynamic potentials for a simple system with fixed are:

The differential forms follow by differentiating the definitions and substituting :

Each differential is a sum of terms in the natural variables of that potential. Reading off the partial derivatives:

Maxwell relations

For any smooth function of two variables, equality of mixed partial derivatives gives a relation between the second derivatives. Applied to each potential, this yields a Maxwell relation:

Each relation connects a thermal derivative to a mechanical derivative — it lets you replace an entropy measurement (hard) by a volume or pressure measurement (easy). The four relations are the content of the thermodynamic square (Born diagram): write at the corners of a square with on two opposite sides and on the other two. Starting from any corner, the Maxwell relation for that corner pairs the two sides not adjacent to it.

Counterexamples to common slips

  • The Gibbs free energy is not the same as the enthalpy . The two differ by : . At low temperature they nearly coincide; at high temperature the entropic term dominates and can be far below .
  • The Helmholtz free energy is not the same as the internal energy . Their difference is . At absolute zero () they agree; at finite , because the system has "spent" energy on disorder.
  • The natural variables matter. Writing instead of is legitimate, but the partial derivatives and are different quantities. Only the natural-variable partials have the simple thermodynamic interpretations (temperature, pressure, etc.).
  • The Legendre transform is not the same as a simple substitution. Replacing by in the argument list of gives , which is a legitimate function but is not a thermodynamic potential — its derivatives do not yield the conjugate variables. The Legendre transform is the correct object.

Key theorem with proof [Intermediate+]

Theorem (Maxwell relations from equality of mixed partials). Let be a thermodynamic potential expressed in its natural variables. Then the equality of mixed second partial derivatives of yields a relation between thermodynamic response functions. Specifically:

(i) From : .

(ii) From : .

(iii) From : .

(iv) From : .

Proof. We prove (iv); the others are identical in structure.

The Gibbs free energy satisfies . At fixed , is a function of with

Both and are smooth functions of . Equality of mixed partials of gives

Substituting the first-derivative identities:

This is relation (iv). The minus sign on the left comes from .

Relation (iii) follows from : and , so gives , hence .

Relations (i) and (ii) follow the same pattern from and respectively, without minus signs because both first derivatives in and appear with positive .

Corollary. The Maxwell relation (iv) lets you compute the entropy change upon compression, , from the thermal expansion coefficient , which is a purely mechanical measurement. No calorimetry is needed.

Exercises [Intermediate+]

Convexity, stability, and the thermodynamic limit [Master]

The Legendre-transform structure of thermodynamic potentials is not merely a change of variables. It rests on a convexity property of the fundamental relation .

Stability. A thermodynamic system is stable if, when slightly perturbed, it returns to equilibrium rather than running away. The mathematical content is that is a convex function of its extensive variables: (positive heat capacity ), (positive compressibility ), and the Hessian determinant condition (stability of the coupled thermal-mechanical response).

Convexity of guarantees that the Legendre transform is well-defined and involutive: the supremum in is attained at a unique point. The free energies and inherit convexity properties from : is concave in and convex in ; is concave in and concave in .

The thermodynamic limit. For a system of particles in volume , the thermodynamic limit is , with fixed. In this limit, the free energy per particle becomes a strictly convex (or concave, depending on variables) function of the intensive parameters, and fluctuations become negligible (). The convexity is a consequence of the law of large numbers applied to the partition function: , and is a cumulant generating function, which is convex in its parameters.

Homogeneous functions and Euler's theorem. Internal energy is a homogeneous function of degree 1 in its extensive variables: . Euler's theorem for homogeneous functions of degree states . For :

This is the Euler equation — it expresses in terms of products of conjugate variable pairs. The Euler equation is not the same as the first law; it is an additional relation that follows from extensivity. Combined with the differential form , the Euler equation implies the Gibbs-Duhem relation:

The Gibbs-Duhem relation constrains the intensive variables: among , , , only two are independent for a one-component system. Changes in are determined by changes in and : where and .

Response functions. The second derivatives of thermodynamic potentials are the experimentally measurable response functions:

  • Heat capacities: , .
  • Compressibilities: , .
  • Thermal expansion: .

The relation follows from the Maxwell relations and is a consistency check between thermal and mechanical response functions.

The Legendre transform as a contact transformation. The four potentials are related by Legendre transforms, which in the language of differential geometry are contact transformations on the contact manifold equipped with the contact form . A Legendre transform is a change of coordinates on this contact manifold that preserves the contact structure — the same way a symplectomorphism preserves the symplectic form in Hamiltonian mechanics. The thermodynamic phase space of Hermann (1910) and the geometrothermodynamics of Quevedo (2007) formalise this perspective.

Connections [Master]

  • Legendre transform 09.04.01 pending is the same mathematical operation in both mechanics and thermodynamics. The Hamiltonian and the Helmholtz free energy are both Legendre transforms of a fundamental relation. The convexity requirement for the transform to be involutive parallels the hyper-regularity condition for the Lagrangian-to-Hamiltonian passage.

  • Canonical ensemble and partition function 11.04.01 pending generates the Helmholtz free energy via . The Legendre transform is then the statistical-mechanical bridge between the microcanonical entropy and the canonical free energy — a large-deviation Legendre duality.

  • First and second laws 11.01.01 pending provide the differential form from which all four potentials and all Maxwell relations are derived.

  • Maxwell-Boltzmann distribution 11.02.01 pending and the kinetic theory of gases use the equation of state derivable from any of the four potentials; the Maxwell relation is the one that connects the kinetic and thermodynamic descriptions.

  • Chemical thermodynamics 14.06.01 uses the Gibbs free energy as its primary potential because chemical reactions proceed at constant . The equilibrium constant is a direct application of the Legendre-transform framework.

  • Phase transitions occur when a thermodynamic potential develops a non-analyticity as a function of its natural variables. The Ehrenfest classification (first-order: at the transition; second-order: but ) is a classification of the singularities of .

Historical & philosophical context [Master]

The theory of thermodynamic potentials is the creation of J. Willard Gibbs in a series of papers published between 1873 and 1878, collected as "On the Equilibrium of Heterogeneous Substances" in the Transactions of the Connecticut Academy of Arts and Sciences. Gibbs introduced the chemical potential , showed that are related by Legendre transforms, derived the conditions for equilibrium (minimisation of the appropriate potential under the relevant constraints), and applied the framework to phase equilibria, surfaces of discontinuity, and osmotic pressure. The 300-page paper is the single most important document in thermodynamics.

Gibbs's treatment was entirely graphical and geometric — he worked with surfaces in -space and their tangent planes, never writing "Legendre transform" explicitly. The connection to the Legendre transform of convex analysis was made explicit by Callen in his Thermodynamics (1960) and Thermodynamics and an Introduction to Thermostatistics (2nd ed., 1985), which recast Gibbs's graphical arguments into the modern axiomatic form: postulate a convex fundamental relation , define the potentials as Legendre transforms, and derive everything else.

Maxwell independently discovered the Maxwell relations and the thermodynamic square during his review of Gibbs's work (the Maxwell thermodynamic surface, a clay model of the surface, was cast in 1874 and photographed for the Theory of Heat). The mnemonic diagram (sometimes called the Born square after Max Born's 1921 presentation) is a device for remembering which cross-derivatives are equal.

The Gibbs-Duhem relation was stated by Gibbs in 1876. Its consequence — that the intensive parameters of a simple system satisfy a differential constraint — is the reason phase diagrams are two-dimensional for one-component systems: the coexistence curves at which two phases are in equilibrium are determined by , and the Gibbs-Duhem relation converts this into a differential equation for , the Clausius-Clapeyron equation .

Landau (1937) recognised that the Gibbs free energy near a second-order phase transition can be expanded in powers of an order parameter (the Landau free energy or Landau potential), and that the symmetry of the expansion under the order parameter determines the universality class of the transition. This is a constructed thermodynamic potential — not a Legendre transform of , but a coarse-grained effective potential whose minima locate the phases.

The Legendre-transform structure of thermodynamics raises a foundational question: is the entropy fundamental (as in the information-theoretic / Jaynes view) or is the free energy fundamental (as in the statistical-mechanical route through the partition function)? The two are Legendre conjugates, and in the thermodynamic limit the transform is involutive, so the question is a matter of convenience. Outside the thermodynamic limit — for small systems, glasses, or systems with long-range interactions — the Legendre transform can fail to be involutive (convexity is lost), and the choice of starting point matters. This is an active area of research in nonequilibrium statistical mechanics.

Lean formalization [Intermediate+]

Mathlib carries the foundations for convex analysis: Mathlib.Analysis.Convex.Function, the Legendre transform of convex functions on normed spaces, and the supporting theory of subdifferentials and Fenchel conjugates. It does not contain:

  • A thermodynamic-potential structure tying a convex function to its partial derivatives via the first-law differential.
  • The Maxwell relations as cross-derivative identities on such a structure.
  • The thermodynamic square as a computational device or mnemonic.
  • The Euler equation derived from homogeneity.
  • The Gibbs-Duhem relation.
  • Response functions (heat capacities, compressibilities, thermal expansion coefficients) as second-derivative objects.

The natural formalization target is a Mathlib.Physics.Thermodynamics.Potential namespace containing a structure ThermodynamicPotential parameterised by the choice of natural variables, with the four specific potentials as instances. lean_status: none reflects the absence; this unit ships without a lean_module. Tyler's review attests intermediate-tier correctness pending the external stat-mech reviewer.

Bibliography [Master]

Primary literature:

  • Gibbs, J. W., "A Method of Geometrical Representation of the Thermodynamic Properties of Substances by Means of Surfaces", Trans. Conn. Acad. II (1873), 382–404.
  • Gibbs, J. W., "On the Equilibrium of Heterogeneous Substances", Trans. Conn. Acad. III (1875–78), 108–248, 343–524. Collected in The Scientific Papers of J. Willard Gibbs, Vol. 1 (Longmans, Green, 1906), pp. 55–353.
  • Maxwell, J. C., Theory of Heat (Longmans, Green, 1871; 4th ed. 1875), Chapter VII on thermodynamic surfaces.
  • Born, M., "Kritische Betrachtungen zur traditionellen Darstellung der Thermodynamik", Phys. Zeitschrift 22 (1921), 218–224, 249–254, 282–286. Introduces the thermodynamic square in its modern form.

Modern references:

  • Callen, H. B., Thermodynamics and an Introduction to Thermostatistics, 2nd ed. (Wiley, 1985), Ch. 5–8. The standard axiomatic treatment.
  • Schroeder, D. V., An Introduction to Thermal Physics (Addison-Wesley, 2000), Ch. 5. Pedagogically excellent; the worked examples are drawn from this source.
  • Landau, L. D. & Lifshitz, E. M., Statistical Physics, Part 1, 3rd ed. (Course of Theoretical Physics Vol. 5, Pergamon, 1980), §15–20.
  • Tong, D., Statistical Physics (DAMTP Cambridge lecture notes), §1. Thermodynamic potentials and Legendre transforms.
  • Reichl, L. E., A Modern Course in Statistical Physics, 4th ed. (Wiley-VCH, 2016), Ch. 2. Thermodynamic-potential formalism with modern notation.
  • Hermann, R., Geometry, Physics, and Systems (Marcel Dekker, 1973). Contact-geometric formulation of thermodynamics.
  • Quevedo, H., "Geometrothermodynamics", J. Math. Phys. 48 (2007), 013506. Contact-manifold approach to thermodynamic geometry.

Wave 2 physics unit, produced 2026-05-18 per docs/plans/PHYSICS_PLAN.md. Both hooks_out targets are proposed; no chem-side or mechanics-side unit yet exists to receive confirmed promotion. Status remains draft pending Tyler's review and the §11 Next-Actions retro per PHYSICS_PLAN.