PHYS-261 · Lesson 9 of 12 · 23 min

Thermodynamic potentials and Maxwell relations

The fundamental relation \(dU = T\,dS - P\,dV\) contains all of equilibrium thermodynamics for a simple system, but it is written in terms of entropy and volume, and entropy cannot be controlled directly in the laboratory. Experiments are done at fixed temperature, in contact with a bath, or at fixed pressure, open to the atmosphere. This lesson introduces the thermodynamic potentials, the enthalpy and the Helmholtz and Gibbs free energies, which are the natural energies for those conditions. Their mixed second derivatives give the Maxwell relations, a set of identities that turn quantities we cannot measure into ones we can. We apply them to the van der Waals gas, to the Joule–Thomson effect and to the slope of coexistence lines.

Legendre transforms and the four potentials

Starting from \(U(S, V)\), we can trade one natural variable for its conjugate by subtracting a product. Define the enthalpy \(H = U + PV\), the Helmholtz free energy \(F = U - TS\) and the Gibbs free energy \(G = U - TS + PV\). Differentiating and using the fundamental relation gives

\[\begin{aligned} dU &= T\,dS - P\,dV, & dH &= T\,dS + V\,dP, \\ dF &= -S\,dT - P\,dV, & dG &= -S\,dT + V\,dP. \end{aligned}\]

Each potential is naturally a function of the two variables whose differentials appear on its right-hand side: \(H(S, P)\), \(F(T, V)\), \(G(T, P)\). This construction, replacing a variable by the slope of a function with respect to it, is the Legendre transform, the same operation that takes a Lagrangian to a Hamiltonian in mechanics. The first derivatives of each potential give the other variables, for example \(S = -(\partial F/\partial T)_V\), \(P = -(\partial F/\partial V)_T\), \(V = (\partial G/\partial P)_T\). If any one potential is known as a function of its natural variables, everything else follows; such a function is called a fundamental equation. Statistical mechanics usually delivers \(F(T, V)\) directly, through the partition function of lesson 11.

Why free energies are free

For a system in contact with a reservoir at fixed temperature \(T\), the second law takes a form that refers only to the system. The total entropy change of system plus reservoir is \(\Delta S - Q/T \ge 0\), where \(Q\) is the heat taken from the reservoir. With \(Q = \Delta U + W\), this rearranges to

\[W \le -\Delta F \qquad (T\ \text{fixed}),\]

so the maximum work a system can do at constant temperature is the decrease of its Helmholtz free energy, which explains the name: it is the energy free to be converted into work. If the volume is also fixed, so that no work is done, then \(\Delta F \le 0\): at constant \(T\) and \(V\), a system evolves towards the minimum of \(F\). Similarly, at constant \(T\) and \(P\), the work other than expansion work is bounded by \(-\Delta G\), and \(G\) is minimized at equilibrium. That is why chemists tabulate Gibbs free energies of reaction: a reaction at fixed temperature and pressure can proceed spontaneously only if it lowers \(G\). The balance \(F = U - TS\) also shows the competition at the heart of every phase transition: at low temperature, low energy wins and matter orders; at high temperature, high entropy wins and matter disorders.

Maxwell relations

Because the potentials are functions of state, their mixed second partial derivatives are equal regardless of the order of differentiation. Applied to the four differentials above, this gives the four Maxwell relations, published by Maxwell in his Theory of Heat in 1871:

\[\begin{aligned} \Big(\frac{\partial T}{\partial V}\Big)_S &= -\Big(\frac{\partial P}{\partial S}\Big)_V, & \Big(\frac{\partial T}{\partial P}\Big)_S &= \Big(\frac{\partial V}{\partial S}\Big)_P, \\ \Big(\frac{\partial S}{\partial V}\Big)_T &= \Big(\frac{\partial P}{\partial T}\Big)_V, & \Big(\frac{\partial S}{\partial P}\Big)_T &= -\Big(\frac{\partial V}{\partial T}\Big)_P. \end{aligned}\]

The last two are the most useful, because they express how entropy changes with volume or pressure, which cannot be measured directly, in terms of the equation of state, which can. For example, \((\partial S/\partial P)_T = -(\partial V/\partial T)_P = -V\alpha\), where \(\alpha\) is the volume expansion coefficient: squeezing a substance that expands on heating lowers its entropy, so it gives off heat when compressed isothermally. Rubber, which contracts when heated under tension, shows the opposite behaviour, warming when stretched quickly, as you can feel by stretching a rubber band against your lips.

Consequences: the energy equation and heat capacities

Dividing \(dU = T\,dS - P\,dV\) by \(dV\) at constant temperature and using a Maxwell relation gives the energy equation

\[\Big(\frac{\partial U}{\partial V}\Big)_T = T\Big(\frac{\partial P}{\partial T}\Big)_V - P.\]

For an ideal gas \(P = nRT/V\), the right-hand side is zero, which proves that the internal energy of an ideal gas depends only on its temperature, a fact we assumed in lesson 3 and Joule tested experimentally. Another chain of manipulations gives a general expression for the difference of heat capacities,

\[C_P - C_V = \frac{TV\alpha^2}{\kappa_T},\]

where \(\kappa_T = -\frac{1}{V}(\partial V/\partial P)_T\) is the isothermal compressibility. Since \(\kappa_T > 0\) for any stable substance, \(C_P \ge C_V\) always. For an ideal gas it reduces to \(nR\); for copper at room temperature it is about 3% of \(C_P\), which is why theory can predict \(C_V\) and experiment can measure \(C_P\) and the two still be compared.

The van der Waals gas

The van der Waals equation \(P = RT/(V - b) - a/V^2\) per mole is a good laboratory for these ideas. The energy equation gives \((\partial U/\partial V)_T = a/V^2\), so \(U = C_VT - a/V\): pulling the molecules apart against their attraction stores potential energy. The Maxwell relation \((\partial S/\partial V)_T = (\partial P/\partial T)_V = R/(V - b)\) integrates to \(S = C_V\ln T + R\ln(V - b) + \text{constant}\), so the excluded volume reduces the entropy, because each molecule has less room. The program checks these relations numerically for nitrogen.

Below a critical temperature, van der Waals isotherms have a wiggle: a region where the pressure increases with volume, which would make the gas unstable. The physical system avoids it by separating into liquid and vapour at a single pressure. Maxwell showed in 1875 where that pressure lies: since \(G\) must be equal in the two coexisting phases, and \(dG = V\,dP\) along an isotherm, the horizontal line must cut the isotherm so that the two loops it encloses have equal areas. The wiggle disappears at the critical point, where \((\partial P/\partial V)_T = (\partial^2 P/\partial V^2)_T = 0\); solving gives

\[T_c = \frac{8a}{27Rb}, \qquad P_c = \frac{a}{27b^2}, \qquad V_c = 3b.\]

In reduced variables \(t = T/T_c\), \(p = P/P_c\), \(v = V/V_c\), the van der Waals equation becomes \(p = 8t/(3v - 1) - 3/v^2\), the same for every substance: the law of corresponding states. Real fluids obey it only roughly, but the idea that substances behave alike near their critical points proved deep, and lesson 12 of the computational course met its modern form in the Ising model.

Reduced pressure against reduced volume for van der Waals isotherms at reduced temperatures 0.85, 0.9, 1.0 and 1.2. The isotherm at 0.9 has an S-shaped wiggle, cut by a horizontal line at a reduced pressure of 0.647 between a liquid volume near 0.6 and a gas volume near 2.35; the two loops above and below the line are shaded as equal areas. The critical isotherm has an inflection point at volume 1 and pressure 1, marked with a dot.
Van der Waals isotherms in reduced variables, with the Maxwell equal-area construction at T = 0.9 Tc and the critical point at (1, 1)
Maxwell relations and the energy equation checked for a van der Waals gas, and the equal-area construction
import math
R = 8.314462618
a, b = 0.1370, 3.87e-5          # nitrogen: Pa m^6/mol^2 and m^3/mol
Cv = 2.5 * R

def P(T, V): return R * T / (V - b) - a / V**2
def S(T, V): return Cv * math.log(T) + R * math.log(V - b)      # entropy up to a constant
def U(T, V): return Cv * T - a / V

# Maxwell relation (dS/dV)_T = (dP/dT)_V checked by central differences
T0, V0, h = 200.0, 2.0e-4, 1e-6
dSdV = (S(T0, V0 * (1 + h)) - S(T0, V0 * (1 - h))) / (2 * V0 * h)
dPdT = (P(T0 * (1 + h), V0) - P(T0 * (1 - h), V0)) / (2 * T0 * h)
print(f"at T = {T0} K, V = {V0 * 1e6:.0f} cm^3/mol:")
print(f"  (dS/dV)_T = {dSdV:.4f} J/(K m^3)   (dP/dT)_V = {dPdT:.4f} Pa/K")
# Energy equation (dU/dV)_T = T (dP/dT)_V - P  must equal a / V^2
dUdV = (U(T0, V0 * (1 + h)) - U(T0, V0 * (1 - h))) / (2 * V0 * h)
print(f"  (dU/dV)_T = {dUdV:.2f} Pa;  T (dP/dT)_V - P = {T0 * dPdT - P(T0, V0):.2f} Pa;  a/V^2 = {a / V0**2:.2f} Pa")

# Critical point and the Joule-Thomson inversion temperature
Tc, Vc, Pc = 8 * a / (27 * R * b), 3 * b, a / (27 * b * b)
print(f"\ncritical point: Tc = {Tc:.1f} K, Pc = {Pc / 1e6:.2f} MPa, Vc = {Vc * 1e6:.0f} cm^3/mol")
print(f"low-pressure inversion temperature 2a/(Rb) = {2 * a / (R * b):.0f} K")

# Maxwell equal-area construction in reduced units at T/Tc = 0.9
def p_red(t, v): return 8 * t / (3 * v - 1) - 3 / v**2
def area_diff(p, t):
    """Roots of p_red(t, v) = p give liquid and gas volumes; return equal-area mismatch."""
    vs, grid = [], [0.34 + 0.0005 * i for i in range(40000)]
    for v1, v2 in zip(grid, grid[1:]):
        if (p_red(t, v1) - p) * (p_red(t, v2) - p) < 0:
            vs.append((v1 + v2) / 2)
    vl, vg = vs[0], vs[-1]
    integral = (8 * t / 3) * math.log((3 * vg - 1) / (3 * vl - 1)) + 3 / vg - 3 / vl
    return integral - p * (vg - vl), vl, vg
t = 0.9
lo, hi = 0.45, 0.70
for _ in range(50):
    mid = (lo + hi) / 2
    if area_diff(mid, t)[0] > 0: lo = mid
    else: hi = mid
d, vl, vg = area_diff(mid, t)
print(f"\nT = 0.9 Tc: saturation pressure {mid:.4f} Pc, liquid volume {vl:.3f} Vc, gas volume {vg:.3f} Vc")
Output
at T = 200.0 K, V = 200 cm^3/mol:
  (dS/dV)_T = 51546.5754 J/(K m^3)   (dP/dT)_V = 51546.5754 Pa/K
  (dU/dV)_T = 3425000.00 Pa;  T (dP/dT)_V - P = 3425000.00 Pa;  a/V^2 = 3425000.00 Pa

critical point: Tc = 126.2 K, Pc = 3.39 MPa, Vc = 116 cm^3/mol
low-pressure inversion temperature 2a/(Rb) = 852 K

T = 0.9 Tc: saturation pressure 0.6470 Pc, liquid volume 0.603 Vc, gas volume 2.349 Vc

The central differences confirm \((\partial S/\partial V)_T = (\partial P/\partial T)_V\) and \((\partial U/\partial V)_T = a/V^2\) to every digit printed. With constants fitted to nitrogen, the critical point comes out at 126.2 K and 3.39 MPa, the measured values, because \(a\) and \(b\) were chosen to match them; the predicted critical volume of 116 cm³/mol is about 30% larger than the measured 90 cm³/mol, a typical shortcoming of the model. At \(0.9T_c\) the equal-area construction gives a saturation pressure of \(0.647P_c\), with the liquid occupying \(0.60V_c\) and the vapour \(2.35V_c\). The model also predicts that nitrogen cools on throttling below about 850 K; the measured low-pressure inversion temperature is about 620 K, so the van der Waals estimate is too high, but it gets the sign and the order of magnitude right.

Phase coexistence and the Clausius–Clapeyron equation

Two phases can coexist at temperature \(T\) and pressure \(P\) only if their Gibbs free energies per molecule, their chemical potentials, are equal; otherwise molecules would move to the phase with the lower value and lower the total \(G\). Moving along the coexistence curve, \(dG\) per mole must stay equal in both phases, so \(-s_1\,dT + v_1\,dP = -s_2\,dT + v_2\,dP\), and

\[\frac{dP}{dT} = \frac{s_2 - s_1}{v_2 - v_1} = \frac{L}{T\,\Delta v},\]

since the entropy of transition is the latent heat divided by the temperature. This is the Clausius–Clapeyron equation used in lesson 5, now derived. For a vapour treated as an ideal gas and a liquid of negligible volume, \(\Delta v \approx RT/P\) per mole and it integrates to \(P \propto e^{-L/RT}\), the familiar exponential growth of vapour pressure with temperature. Applied to water, it predicts that the saturation vapour pressure rises by about 6 to 7% per kelvin near 15 °C, so a warmer atmosphere can hold more water vapour, a relation central to climate science and to the capstone of this course.

Worked problem

Vapour pressure from the Clausius–Clapeyron equation

Water boils at 100 °C at 101.3 kPa, with \(L = 40.7\) kJ/mol. Estimate the boiling temperature at 70 kPa, the pressure at about 3000 m altitude.

Show solution
  1. Integrated form: \(\ln(P_2/P_1) = -\frac{L}{R}\Big(\frac{1}{T_2} - \frac{1}{T_1}\Big)\).
  2. \(\ln(70/101.3) = -0.3696\), so \(\frac{1}{T_2} = \frac{1}{373.15} + \frac{0.3696 \times 8.314}{40\,700} = 0.0026799 + 0.0000755 = 0.0027554\).
  3. \(T_2 = 362.9\) K \(= 89.8\) °C.
  4. Tables give about 90 °C, so the approximation of an ideal vapour with constant \(L\) is excellent here.

Answer: Water boils at about 90 °C at 70 kPa.

Common mistakes

  • MistakeUsing \(F\) or \(G\) with variables other than their natural ones and expecting simple derivatives.

    Instead\(F\) is naturally a function of \(T\) and \(V\), \(G\) of \(T\) and \(P\); only then are the first derivatives simple.

  • MistakeGetting the signs of Maxwell relations wrong.

    InsteadDerive them from the differentials each time: equate mixed partials of \(dF = -S\,dT - P\,dV\) or \(dG = -S\,dT + V\,dP\).

  • MistakeAssuming \(U\) depends only on \(T\) for every gas.

    InsteadThe energy equation gives \((\partial U/\partial V)_T = a/V^2\) for a van der Waals gas.

  • MistakeUsing the van der Waals wiggle as physical behaviour.

    InsteadReplace it by the Maxwell equal-area tie line; the system separates into two phases.

  • MistakeExpecting the van der Waals equation to be quantitatively accurate.

    InsteadIt is qualitative; real critical volumes and inversion temperatures can be off by 30% or more.

Summary and key terms

  • \(H = U + PV\), \(F = U - TS\), \(G = U - TS + PV\), with natural variables \((S, P)\), \((T, V)\), \((T, P)\).
  • At fixed \(T\) and \(V\), \(F\) is minimized; at fixed \(T\) and \(P\), \(G\) is minimized; \(-\Delta F\) bounds the work at constant \(T\).
  • Maxwell relations follow from equality of mixed partials, for example \((\partial S/\partial V)_T = (\partial P/\partial T)_V\).
  • The energy equation shows that \(U\) of an ideal gas depends only on \(T\); in general \(C_P - C_V = TV\alpha^2/\kappa_T\).
  • The van der Waals gas has a critical point at \(T_c = 8a/27Rb\) and needs Maxwell's equal-area construction below it.
  • Equal chemical potentials at coexistence give the Clausius–Clapeyron equation \(dP/dT = L/(T\Delta v)\).
Helmholtz free energy
F = U - TS, minimized at fixed temperature and volume.
Gibbs free energy
G = U - TS + PV, minimized at fixed temperature and pressure.
Legendre transform
The exchange of a variable for its conjugate slope, used to build the potentials.
Maxwell relations
Identities between partial derivatives that follow from the potentials being functions of state.
chemical potential
The Gibbs free energy per particle; equal in coexisting phases.
law of corresponding states
Substances obey the same equation of state in reduced variables.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Derive \((\partial S/\partial P)_T = -(\partial V/\partial T)_P\) from \(dG\).

    Show answer

    \(dG = -S\,dT + V\,dP\), so \(S = -(\partial G/\partial T)_P\) and \(V = (\partial G/\partial P)_T\). Equating \(\partial^2 G/\partial P\,\partial T\) taken both ways gives the result.

  2. For an ideal gas, use the energy equation to show \((\partial U/\partial V)_T = 0\).

    Show answer

    \(T(\partial P/\partial T)_V - P = T(nR/V) - nRT/V = 0\).

  3. Find the critical temperature of a van der Waals gas with \(a = 0.364\) Pa m⁶/mol² and \(b = 4.27 \times 10^{-5}\) m³/mol (carbon dioxide).

    Show answer

    \(T_c = 8 \times 0.364/(27 \times 8.314 \times 4.27 \times 10^{-5}) = 304\) K.

  4. A reaction at 298 K has \(\Delta H = -50\) kJ and \(\Delta S = -100\) J/K. Is it spontaneous at constant T and P? Above what temperature would it stop being so?

    Show answer

    \(\Delta G = -50\,000 + 298 \times 100 = -20\,200\) J, so yes. It stops when \(T > 50\,000/100 = 500\) K.

  5. Estimate the vapour pressure of water at 20 °C from its value at 100 °C using \(L = 44\) kJ/mol.

    Show answer

    \(\ln(P/101.3) = -(44\,000/8.314)(1/293.15 - 1/373.15) = -3.87\), so \(P = 101.3 \times 0.0209 = 2.1\) kPa, close to the measured 2.34 kPa.

  6. Why does stretched rubber warm when stretched quickly?

    Show answer

    Stretching aligns the polymer chains and lowers their entropy at fixed temperature; in a fast, nearly adiabatic stretch the entropy is held constant instead, so the temperature rises.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz