---
title: Thermodynamic Potentials and Maxwell Relations
module: Thermodynamics
moduleNumber: 1
lessonNumber: 4
order: 104
summary: >
  The fundamental relation $\d U=T\,\d S-P\,\d V+\mu\,\d N$ packages the first and
  second laws into one exact differential. Legendre transforms swap each
  conjugate pair to produce the Helmholtz, enthalpy, Gibbs, and grand potentials,
  each minimized under its own natural variables. Equality of mixed second
  partials of these potentials gives the Maxwell relations, which convert
  unmeasurable entropy derivatives into measurable ones from the equation of
  state.
topics: [Thermodynamics]
sources:
  - book: Callen
    ref: "Ch. 5 — Legendre Transformed Representations; §5.1–5.3, and Ch. 3 §3.6 Maxwell Relations"
  - book: Schroeder
    ref: "Ch. 5 — Free Energy and Chemical Thermodynamics; §5.1"
  - book: Reif
    ref: "Ch. 5 §5.5–5.9, Ch. 8 — Equilibrium between Phases and Chemical Species"
  - book: Kardar (Statistical Physics of Particles)
    ref: "Ch. 1 — Thermodynamics; §1.9"
draft: false
---

The first law supplies an energy that changes by heat and work; the second law
supplies an entropy and a temperature. Combined for a reversible process, they
collapse into a single differential relation among state functions, the
fundamental relation. Everything measurable about a simple system — its equation
of state, its heat capacities, its response to fields — is a partial derivative of
that relation or of one of its Legendre transforms. This lesson builds the four
standard potentials, reads off the natural variables of each, and derives the
Maxwell relations that make otherwise inaccessible derivatives computable.

## The fundamental relation

For a reversible process the second law gives $\delta Q_{\rm rev}=T\,\d S$ and the
first law gives $\delta W=-P\,\d V$ for a simple fluid, plus $\mu\,\d N$ if
particles are exchanged. Substituting into $\d U=\delta Q+\delta W$,

$$
\d U = T\,\d S - P\,\d V + \mu\,\d N.
$$

Though derived along a reversible path, this is a relation among state functions
and their differentials, so it holds between any two neighboring equilibrium
states however they are connected. It is the **fundamental relation** in the
**energy representation**, and it identifies the intensive variables as partial
derivatives of $U(S,V,N)$:

$$
T = \left(\frac{\partial U}{\partial S}\right)_{V,N},\qquad
P = -\left(\frac{\partial U}{\partial V}\right)_{S,N},\qquad
\mu = \left(\frac{\partial U}{\partial N}\right)_{S,V}.
$$

The variables $(S,V,N)$ are the **natural variables** of $U$: given $U$ as a
function of them, every other thermodynamic quantity follows by differentiation,
with no integration constant left undetermined. A relation like $U(S,V,N)$ that
contains the complete thermodynamics is a **fundamental equation**; an equation of
state such as $PV=Nk_BT$ is only a partial derivative of one and does not by
itself determine the rest.

Because $U$, $S$, $V$, $N$ are all extensive, $U(\lambda S,\lambda V,\lambda N)=\lambda U(S,V,N)$.
Applying Euler's theorem for first-order homogeneous functions to this scaling
gives the **Euler relation**

$$
U = TS - PV + \mu N,
$$

and differentiating it and subtracting the fundamental relation yields the
**Gibbs–Duhem relation** $S\,\d T - V\,\d P + N\,\d\mu = 0$, which shows the three
intensive variables $T$, $P$, $\mu$ are not independent: fixing two determines the
third.

## Legendre transforms and the four potentials

The energy $U(S,V,N)$ has entropy among its natural variables, but $S$ is neither
directly controlled nor directly measured in the laboratory, where temperature is
the accessible variable. A **Legendre transform** exchanges a natural variable for
its conjugate derivative without losing information, replacing $S$ by $T=\partial U/\partial S$.

> **Definition (Legendre transform).** For a function $U(S)$ with slope
> $T=\d U/\d S$, the Legendre transform is $F(T)=U-TS$, a function of the slope
> $T$ rather than the coordinate $S$. Then $\d F = \d U - T\,\d S - S\,\d T = -S\,\d T$,
> so $S=-\partial F/\partial T$; the transform is its own inverse and no
> information is lost.

Carrying out the transform on each conjugate pair generates the standard
potentials. Each subtracts a product of conjugates from $U$ and thereby swaps one
extensive natural variable for its intensive partner.

- **Internal energy** $U(S,V,N)$, with $\d U = T\,\d S - P\,\d V + \mu\,\d N$.
- **Helmholtz free energy** $F = U - TS$, natural variables $(T,V,N)$, with
  $$\d F = -S\,\d T - P\,\d V + \mu\,\d N.$$
- **Enthalpy** $H = U + PV$, natural variables $(S,P,N)$, with
  $$\d H = T\,\d S + V\,\d P + \mu\,\d N.$$
- **Gibbs free energy** $G = U - TS + PV$, natural variables $(T,P,N)$, with
  $$\d G = -S\,\d T + V\,\d P + \mu\,\d N.$$
- **Grand potential** $\Phi = U - TS - \mu N = F - \mu N$, natural variables
  $(T,V,\mu)$, with
  $$\d\Phi = -S\,\d T - P\,\d V - N\,\d\mu.$$

From the Euler relation $G = \mu N$, so the Gibbs energy per particle is the
chemical potential, and $\Phi = -PV$, so the grand potential is minus the pressure
times the volume. These identities are used constantly in the ensemble lessons:
$F=-k_BT\ln Z$ ties the Helmholtz energy to the canonical partition function, and
$\Phi=-k_BT\ln\Xi$ ties the grand potential to the grand partition function.

$$
% caption: The four potentials linked by Legendre transforms; each arrow swaps one conjugate pair, $S\leftrightarrow T$ subtracting $TS$ and $V\leftrightarrow P$ adding $PV$, so opposite corners differ by both swaps.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}\node[draw,thick,minimum size=1.2cm] (U) at (0,3) {$U(S,V)$};
\node[draw,thick,minimum size=1.2cm] (F) at (5,3) {$F(T,V)$};
\node[draw,thick,minimum size=1.2cm] (H) at (0,0) {$H(S,P)$};
\node[draw,thick,minimum size=1.2cm] (G) at (5,0) {$G(T,P)$};
\draw[->,black,very thick] (U)--(F) node[midway,above]{$-TS$};
\draw[->,black,very thick] (H)--(G) node[midway,above]{$-TS$};
\draw[->,black,very thick] (U)--(H) node[midway,left]{$+PV$};
\draw[->,black,very thick] (F)--(G) node[midway,right]{$+PV$};
\end{tikzpicture}
$$

## Natural variables and minimum principles

Each potential is the quantity minimized at equilibrium when its natural intensive
variables are held fixed by reservoirs. The entropy-maximum principle $\d S\ge 0$
for an isolated system translates, by Legendre transform, into a minimum principle
for each potential under its matching constraints.

| Potential | Symbol | Natural variables | Differential | Minimized at fixed |
| --- | --- | --- | --- | --- |
| Internal energy | $U$ | $S,V,N$ | $T\,\d S-P\,\d V+\mu\,\d N$ | $S,V,N$ |
| Helmholtz | $F$ | $T,V,N$ | $-S\,\d T-P\,\d V+\mu\,\d N$ | $T,V,N$ |
| Enthalpy | $H$ | $S,P,N$ | $T\,\d S+V\,\d P+\mu\,\d N$ | $S,P,N$ |
| Gibbs | $G$ | $T,P,N$ | $-S\,\d T+V\,\d P+\mu\,\d N$ | $T,P,N$ |
| Grand potential | $\Phi$ | $T,V,\mu$ | $-S\,\d T-P\,\d V-N\,\d\mu$ | $T,V,\mu$ |

The Helmholtz energy is minimized by a system at fixed temperature and volume,
which is the setting of the canonical ensemble; the Gibbs energy at fixed
temperature and pressure, the setting of most chemistry; the grand potential at
fixed temperature, volume, and chemical potential, the setting of the
grand-canonical ensemble. Each minimum expresses the same competition: $F=U-TS$ is
lowered either by reducing energy or by raising entropy, and temperature sets the
exchange rate between the two. At low $T$ the energy term dominates and the system
orders; at high $T$ the entropy term dominates and it disorders.

$$
% caption: The Helmholtz free energy $F=U-TS$ starts at $U$ when $T=0$ and falls below it as temperature rises; the gap between the two curves is the entropy term $TS$, so higher $T$ favors the disordered (high-$S$) state.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}\draw[->,black] (0,0)--(6.6,0) node[right,black]{$T$};
\draw[->,black] (0,0)--(0,4.0) node[above,black]{$F$};
\draw[acc,very thick] (0.2,3.3)--(6.0,3.0);
\node[acc,right] at (4.3,3.25) {energy $U$};
\draw[black,very thick] (0.2,3.3)--(6.0,0.4);
\node[black,right] at (2.2,2.3) {$F$};
\draw[<->,black,thick] (4.0,1.45)--(4.0,3.05);
\node[black,right] at (4.05,2.25) {$TS$ gap};
\node[black,below] at (1.1,0.0) {ordered};
\node[black,below] at (5.3,0.0) {disordered};
\end{tikzpicture}
$$

## Maxwell relations

Each potential's differential has the form $\d\Psi = X\,\d y + Y\,\d z$ with $X$
and $Y$ the first partial derivatives. Because $\Psi$ is a state function, its
mixed second partials are equal, $\partial^2\Psi/\partial y\,\partial z = \partial^2\Psi/\partial z\,\partial y$,
which forces a relation between the cross-derivatives of $X$ and $Y$. These are
the **Maxwell relations**. From the four potentials (at fixed $N$):

$$
\left(\frac{\partial T}{\partial V}\right)_S = -\left(\frac{\partial P}{\partial S}\right)_V
\quad(U),\qquad
\left(\frac{\partial S}{\partial V}\right)_T = \left(\frac{\partial P}{\partial T}\right)_V
\quad(F),
$$

$$
\left(\frac{\partial T}{\partial P}\right)_S = \left(\frac{\partial V}{\partial S}\right)_P
\quad(H),\qquad
\left(\frac{\partial S}{\partial P}\right)_T = -\left(\frac{\partial V}{\partial T}\right)_P
\quad(G).
$$

A mnemonic organizes all four. Arrange the four natural variables $S,T,P,V$ on the
sides of a square and the four potentials on its corners, ordered so that each
potential sits between its two natural variables. The relations are read by
following the corners and edges; the two diagonal arrows fix the signs.

$$
% caption: The thermodynamic square: each potential sits on the edge between its two natural variables ($U$ between $S,V$; $F$ between $V,T$; $G$ between $T,P$; $H$ between $P,S$); conjugate pairs $S$–$T$ and $V$–$P$ sit on opposite corners, and the diagonal arrows fix the Maxwell-relation signs.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}\draw[very thick] (0,0) rectangle (4,4);
\node[draw,fill=white,inner sep=2pt] at (0,4) {$S$};
\node[draw,fill=white,inner sep=2pt] at (4,4) {$V$};
\node[draw,fill=white,inner sep=2pt] at (0,0) {$P$};
\node[draw,fill=white,inner sep=2pt] at (4,0) {$T$};
\node[black!70,fill=white,inner sep=1.5pt] at (2,4) {$U$};
\node[black!70,fill=white,inner sep=1.5pt] at (4,2) {$F$};
\node[black!70,fill=white,inner sep=1.5pt] at (2,0) {$G$};
\node[black!70,fill=white,inner sep=1.5pt] at (0,2) {$H$};
\draw[->,acc,thick] (0,0)--(4,4);
\draw[->,acc,thick] (4,0)--(0,4);
\end{tikzpicture}
$$

## Extracting inaccessible derivatives

The practical value of the Maxwell relations is that entropy is not directly
measurable, but the relations trade an entropy derivative for a derivative of the
equation of state, which is. The Helmholtz relation is the workhorse example.

> **Worked example.** Find how the entropy of a gas changes with volume at fixed
> temperature, $(\partial S/\partial V)_T$, using only the equation of state.
> The Helmholtz Maxwell relation gives
> $$\left(\frac{\partial S}{\partial V}\right)_T = \left(\frac{\partial P}{\partial T}\right)_V.$$
> For an ideal gas $P=Nk_BT/V$, so $(\partial P/\partial T)_V = Nk_B/V$ and
> $$\left(\frac{\partial S}{\partial V}\right)_T = \frac{Nk_B}{V}.$$
> Integrating at fixed $T$ recovers the volume dependence of the entropy,
> $S(V)-S(V_0)=Nk_B\ln(V/V_0)$, the configurational part of the Sackur–Tetrode
> entropy derived later. The right-hand side used only $P(T,V)$, a measured
> quantity, to fix a change in the unmeasurable entropy.

The same maneuver gives the general **energy equation**. From $\d U=T\,\d S-P\,\d V$
at fixed $T$,

$$
\left(\frac{\partial U}{\partial V}\right)_T = T\left(\frac{\partial S}{\partial V}\right)_T - P
= T\left(\frac{\partial P}{\partial T}\right)_V - P,
$$

using the Helmholtz relation again. For an ideal gas the right-hand side is
$T\cdot Nk_B/V - P = 0$, confirming $(\partial U/\partial V)_T=0$ without appeal to
the Joule experiment — the temperature-only dependence of the ideal-gas energy
follows from its equation of state alone. For a van der Waals gas the same formula
gives a nonzero $(\partial U/\partial V)_T = a N^2/V^2$, the internal-pressure term
that makes a real gas cool on free expansion.

$$
% caption: A Maxwell relation converts an unmeasurable entropy derivative on the left into a derivative of the equation of state on the right, which follows directly from $P(T,V)$.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}\node[draw,acc,thick,fill=acc!10,minimum height=1.0cm,minimum width=3.2cm] (L) at (0,0)
  {$\left(\dfrac{\partial S}{\partial V}\right)_T$};
\node[draw,black,thick,fill=black!8,minimum height=1.0cm,minimum width=3.2cm] (R) at (6,0)
  {$\left(\dfrac{\partial P}{\partial T}\right)_V$};
\draw[<->,black,very thick] (L)--(R);
\node[black,above] at (3,0.35) {Maxwell};
\node[acc,below,align=center] at (0,-0.85) {not measured\\directly};
\node[black,below,align=center] at (6,-0.85) {from the\\equation of state};
\end{tikzpicture}
$$

Combined with the response-function identities of the next lesson, the Maxwell
relations reduce the entire thermodynamics of a simple substance to three
measured inputs: the equation of state $P(T,V)$, one heat capacity as a function
of temperature, and a single reference entropy. Everything else is a derivative.

## Summary

- The fundamental relation $\d U = T\,\d S - P\,\d V + \mu\,\d N$ combines the
  first and second laws; $U(S,V,N)$ is a fundamental equation containing the whole
  thermodynamics, with $T,P,\mu$ its first derivatives. The Euler relation
  $U=TS-PV+\mu N$ and Gibbs–Duhem $S\,\d T-V\,\d P+N\,\d\mu=0$ follow from
  extensivity.
- Legendre transforms swap conjugate pairs to give $F=U-TS$, $H=U+PV$,
  $G=U-TS+PV$, and $\Phi=F-\mu N$, each with its own natural variables and each
  minimized at equilibrium under those variables. $G=\mu N$ and $\Phi=-PV$.
- Equality of mixed second partials of each potential yields the four Maxwell
  relations, summarized by the thermodynamic square.
- The Maxwell relations convert unmeasurable entropy derivatives into equation-of-
  state derivatives; $(\partial S/\partial V)_T=(\partial P/\partial T)_V$ gives
  the ideal-gas $Nk_B/V$ and the general energy equation
  $(\partial U/\partial V)_T=T(\partial P/\partial T)_V-P$.
