Sign in or create a free account to continue.

CHEM-271 · Lesson 8 of 12 · 25 min

Fundamental equations, Maxwell relations and chemical potential

▶ Video coming soon A video version of this lesson is on the way.

The first seven lessons introduced five state functions, U, H, S, A and G, and used each where it was convenient. This lesson ties them together. Combining the first and second laws gives a single equation for dU, and from it follow equations for dH, dA and dG. Because these are exact differentials of state functions, their mixed second derivatives are equal, and that simple fact produces the Maxwell relations, which turn quantities that are hard to measure, such as the change of entropy with volume, into quantities that are easy to measure, such as the change of pressure with temperature. The lesson ends by extending the equations to systems whose composition can change, which introduces the chemical potential, the central quantity for phase and chemical equilibrium.

The fundamental equation

For a reversible change in a closed system that does only expansion work, the first law gives \(\mathrm{d}U = \delta q_\mathrm{rev} + \delta w_\mathrm{rev}\), with \(\delta q_\mathrm{rev} = T\,\mathrm{d}S\) from the definition of entropy and \(\delta w_\mathrm{rev} = -P\,\mathrm{d}V\). Therefore

\[\mathrm{d}U = T\,\mathrm{d}S - P\,\mathrm{d}V.\]

This is the fundamental equation of thermodynamics. Although it was derived for a reversible path, it contains only state functions and their differentials, so it holds for any infinitesimal change between equilibrium states, reversible or not. In an irreversible change the separate identifications of T dS with the heat and −P dV with the work fail, but their sum is still dU.

The fundamental equation shows that U is naturally a function of S and V, its natural variables. If S and V are known as functions of each other, every other property follows. The other energies are obtained by Legendre transformations, which swap a variable for its conjugate. Adding PV to U gives the enthalpy, whose natural variables are S and P; subtracting TS gives the Helmholtz energy, with natural variables T and V; doing both gives the Gibbs energy, with natural variables T and P:

\[\mathrm{d}H = T\,\mathrm{d}S + V\,\mathrm{d}P, \qquad \mathrm{d}A = -S\,\mathrm{d}T - P\,\mathrm{d}V, \qquad \mathrm{d}G = -S\,\mathrm{d}T + V\,\mathrm{d}P.\]

Each equation also identifies partial derivatives. From dU, \((\partial U/\partial S)_V = T\) and \((\partial U/\partial V)_S = -P\). From dG, \((\partial G/\partial T)_P = -S\) and \((\partial G/\partial P)_T = V\), the results used in lesson 7. The Gibbs energy is the most useful of the four because its natural variables, temperature and pressure, are the ones chemists control.

Partial derivatives and exact differentials

A function f(x, y) of two variables has partial derivatives \((\partial f/\partial x)_y\), the slope with y held fixed, and \((\partial f/\partial y)_x\). Its total differential is \(\mathrm{d}f = (\partial f/\partial x)_y\,\mathrm{d}x + (\partial f/\partial y)_x\,\mathrm{d}y\). If f is smooth, the order of differentiation does not matter: \(\partial^2 f/\partial y\,\partial x = \partial^2 f/\partial x\,\partial y\). This is the Euler reciprocity relation. It gives a test of exactness: a differential \(M\,\mathrm{d}x + N\,\mathrm{d}y\) is the differential of some function only if \((\partial M/\partial y)_x = (\partial N/\partial x)_y\). Heat and work fail this test, which is the mathematical statement that they are not state functions.

Two more identities are needed constantly. The reciprocal rule says that a derivative is the inverse of the derivative taken the other way, with the same variable held fixed. The cyclic rule, sometimes called the triple product rule, says that for three variables linked by one equation the product of the three cyclic partial derivatives is −1. Together they let us rewrite any derivative of P, V and T in terms of two measurable coefficients: the expansion coefficient α = (1/V)(∂V/∂T)_P and the isothermal compressibility κ_T = −(1/V)(∂V/∂P)_T.

The Maxwell relations

Applying Euler reciprocity to each of the four fundamental equations gives the four Maxwell relations, published by James Clerk Maxwell in his textbook Theory of Heat in 1871:

\[\Bigl(\frac{\partial T}{\partial V}\Bigr)_S = -\Bigl(\frac{\partial P}{\partial S}\Bigr)_V, \quad \Bigl(\frac{\partial T}{\partial P}\Bigr)_S = \Bigl(\frac{\partial V}{\partial S}\Bigr)_P, \quad \Bigl(\frac{\partial S}{\partial V}\Bigr)_T = \Bigl(\frac{\partial P}{\partial T}\Bigr)_V, \quad \Bigl(\frac{\partial S}{\partial P}\Bigr)_T = -\Bigl(\frac{\partial V}{\partial T}\Bigr)_P.\]

The last two are the most useful, because they convert derivatives of entropy, which cannot be measured directly, into derivatives of P, V and T, which can. The third says that the entropy gained by expanding a substance at constant temperature equals the rate at which its pressure rises on heating at constant volume. The fourth says that the entropy lost by compressing it equals its rate of thermal expansion. Water between 0 °C and 4 °C, which contracts on heating, therefore gains entropy when it is compressed.

The thermodynamic equation of state

Dividing dU = T dS − P dV by dV at constant temperature gives \((\partial U/\partial V)_T = T(\partial S/\partial V)_T - P\), and the third Maxwell relation turns this into

\[\Bigl(\frac{\partial U}{\partial V}\Bigr)_T = T\Bigl(\frac{\partial P}{\partial T}\Bigr)_V - P,\]

the thermodynamic equation of state. It gives the internal pressure from the equation of state alone. For an ideal gas \(P = nRT/V\), so \(T(\partial P/\partial T)_V = P\) and the internal pressure is zero, which is the result of Joule's free expansion derived here from the second law. For a van der Waals gas, \(T(\partial P/\partial T)_V = RT/(V_\mathrm{m} - b)\), and the internal pressure is \(a/V_\mathrm{m}^2\), as lesson 3 stated. PHYS-261 uses the same relation to derive the Joule–Thomson coefficient.

A similar manipulation gives the general difference between the heat capacities: \(C_P - C_V = TV\alpha^2/\kappa_T\). For an ideal gas, α = 1/T and κ_T = 1/P, which gives nR. For liquids and solids the difference is small but not negligible: about 0.8 J/(K mol) for water at 25 °C and about 0.7 J/(K mol) for copper. Because α² is never negative and κ_T is always positive, C_P is never less than C_V.

Open systems and the chemical potential

So far the amount of each substance has been fixed. In a reaction or a phase change, amounts change, and G depends on them as well as on T and P. For a mixture of components with amounts \(n_1, n_2, \ldots\), the chemical potential of component i is

\[\mu_i = \Bigl(\frac{\partial G}{\partial n_i}\Bigr)_{T,P,n_{j \neq i}},\]

the rate at which the Gibbs energy rises as component i is added, with temperature, pressure and the amounts of all other components held fixed. The fundamental equation for G becomes \(\mathrm{d}G = -S\,\mathrm{d}T + V\,\mathrm{d}P + \sum_i \mu_i\,\mathrm{d}n_i\). Gibbs introduced the chemical potential in his 1876 paper; it is a partial molar quantity, the partial molar Gibbs energy, and like every partial molar quantity it is intensive. Because G is extensive, integrating at constant composition gives \(G = \sum_i n_i\mu_i\), and comparing the two expressions for dG gives the Gibbs–Duhem equation, \(\sum_i n_i\,\mathrm{d}\mu_i = 0\) at constant T and P: the chemical potentials of the components of a mixture cannot change independently.

For a pure substance, μ is simply the molar Gibbs energy, \(G_\mathrm{m}\). For a perfect gas, lesson 7 showed that \(\mu = \mu^{\circ} + RT\ln(p/p^{\circ})\), and in a mixture of perfect gases the same holds for each component with its partial pressure. For a real gas, Gilbert Lewis introduced in 1901 the fugacity f, an effective pressure defined so that the same form holds exactly: \(\mu = \mu^{\circ} + RT\ln(f/p^{\circ})\). The ratio φ = f/p is the fugacity coefficient. It is found from the compression factor by \(\ln\varphi = \int_0^p (Z - 1)\,\mathrm{d}p/p\). A gas whose attractions dominate, with Z < 1, has φ < 1: it is less inclined to escape than a perfect gas at the same pressure.

Why chemical potential decides equilibrium

Suppose a small amount dn of a substance moves from phase α to phase β at constant T and P. The Gibbs energy changes by \(\mathrm{d}G = (\mu_\beta - \mu_\alpha)\,\mathrm{d}n\). The transfer is spontaneous if dG < 0, that is, if \(\mu_\beta < \mu_\alpha\). Matter flows spontaneously from high chemical potential to low, just as heat flows from high temperature to low, and the flow stops when the chemical potentials are equal. At equilibrium, the chemical potential of each substance is the same in every phase in which it is present. This single condition underlies the phase diagrams of lesson 9, the laws of solutions in lesson 10, and, applied to reactions, the equilibrium constant of lesson 11.

The chemical potential of a pure phase depends on temperature with slope \((\partial\mu/\partial T)_P = -S_\mathrm{m}\). Because \(S_\mathrm{m}(\mathrm{gas}) > S_\mathrm{m}(\mathrm{liquid}) > S_\mathrm{m}(\mathrm{solid})\), the gas line falls most steeply and the solid line least. At low temperature the solid has the lowest chemical potential and is the stable phase; at higher temperature the liquid line crosses below it, at the melting point; at higher temperature still the gas line crosses below the liquid, at the boiling point.

Chemical potential against temperature at constant pressure for the solid, liquid and gas phases of a substance, drawn as three straight lines of increasing downward slope, labelled with slopes minus S solid, minus S liquid and minus S gas. The solid line is lowest at low temperature, the liquid line lowest in the middle range and the gas line lowest at high temperature. The crossings are marked as the melting point and the boiling point, and the stable phase in each range is shaded along the lowest line.
Chemical potential and phase stability: the phase with the lowest μ is stable

A worked example: a Maxwell relation in use

Worked problem

The entropy change on isothermal compression of a liquid

Water at 25 °C has α = 2.57 × 10⁻⁴ K⁻¹ and Vm = 18.07 cm³/mol. By how much does the molar entropy change when the pressure is raised from 1 bar to 1001 bar at 25 °C?

Show solution
  1. The fourth Maxwell relation: (∂S/∂P)T = −(∂V/∂T)P = −αV.
  2. For one mole, (∂Sm/∂P)T = −(2.57 × 10⁻⁴ K⁻¹)(18.07 × 10⁻⁶ m³/mol) = −4.64 × 10⁻⁹ J/(K mol Pa).
  3. ΔP = 1000 bar = 1.00 × 10⁸ Pa, and α and V change little over this range.
  4. ΔSm ≈ −4.64 × 10⁻⁹ × 1.00 × 10⁸ = −0.46 J/(K mol).

Answer: The molar entropy falls by about 0.46 J/(K mol): a small change, found without any calorimetry.

Measuring this entropy change directly would require measuring the heat released during a reversible compression, a difficult experiment. The Maxwell relation gives it from the thermal expansion coefficient, which is easy to measure with a dilatometer. Many thermodynamic tables for water, steam and refrigerants are constructed this way, from careful measurements of P, V and T combined with heat capacities at one pressure.

A program: checking a Maxwell relation and finding a fugacity

The program checks the Maxwell relation \((\partial S/\partial V)_T = (\partial P/\partial T)_V\) for a van der Waals gas by numerical differentiation. The entropy of a van der Waals gas, relative to a reference state, is \(S_\mathrm{m} = C_{V,\mathrm{m}}\ln T + R\ln(V_\mathrm{m} - b) + \text{constant}\); the program differentiates it and the equation of state independently and compares the results. It then computes the internal pressure, the difference C_P − C_V for water and copper, and the fugacity coefficient of nitrogen at 300 K by integrating (Z − 1)/P, comparing it with the closed-form van der Waals expression.

import math

R = 8.314462618e-2                 # L bar/(K mol)
a, b, Cv = 1.370, 0.0387, 2.5 * R  # nitrogen, van der Waals

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

V, T, h = 0.50, 300.0, 1e-5
dSdV = (S(V + h, T) - S(V - h, T)) / (2 * h)
dPdT = (P(V, T + h) - P(V, T - h)) / (2 * h)
print(f'(dS/dV)_T = {dSdV:.6f}  (dP/dT)_V = {dPdT:.6f}  bar/K')
print(f'internal pressure T(dP/dT)_V - P = {T * dPdT - P(V, T):.4f} bar;  a/V^2 = {a / V ** 2:.4f} bar')

# Cp - Cv = T V alpha^2 / kappa for a liquid and a solid at 298.15 K (SI units)
for name, Vm, alpha, kappa in (('water', 18.07e-6, 2.57e-4, 4.52e-10), ('copper', 7.11e-6, 4.95e-5, 7.14e-12)):
    print(f'{name:7s} Cp - Cv = {298.15 * Vm * alpha ** 2 / kappa:.2f} J/(K mol)')

# fugacity coefficient of nitrogen at 300 K
def Vm_at(p, T):
    lo, hi = b * 1.0001, 10 * R * T / p + b
    for _ in range(200):
        mid = 0.5 * (lo + hi)
        if P(mid, T) > p: lo = mid
        else: hi = mid
    return 0.5 * (lo + hi)

def ln_phi_integral(p, T, n=4000):
    tot, prev = 0.0, None
    for k in range(1, n + 1):
        pk = p * k / n
        f = (pk * Vm_at(pk, T) / (R * T) - 1) / pk
        if prev is None: prev = f        # (Z-1)/p has a finite limit as p -> 0
        tot += 0.5 * (f + prev) * p / n
        prev = f
    return tot

def ln_phi_closed(p, T):
    V = Vm_at(p, T)
    return math.log(R * T / (p * (V - b))) + b / (V - b) - 2 * a / (R * T * V)

print()
for p in (10, 50, 100, 300):
    li, lc = ln_phi_integral(p, 300.0), ln_phi_closed(p, 300.0)
    print(f'N2 at {p:3d} bar: phi = {math.exp(li):.4f} (integral)  {math.exp(lc):.4f} (closed form)  fugacity = {p * math.exp(lc):6.1f} bar')
Output
(dS/dV)_T = 0.180240  (dP/dT)_V = 0.180240  bar/K
internal pressure T(dP/dT)_V - P = 5.4800 bar;  a/V^2 = 5.4800 bar
water   Cp - Cv = 0.79 J/(K mol)
copper  Cp - Cv = 0.73 J/(K mol)

N2 at  10 bar: phi = 0.9936 (integral)  0.9936 (closed form)  fugacity =    9.9 bar
N2 at  50 bar: phi = 0.9707 (integral)  0.9707 (closed form)  fugacity =   48.5 bar
N2 at 100 bar: phi = 0.9491 (integral)  0.9491 (closed form)  fugacity =   94.9 bar
N2 at 300 bar: phi = 0.9550 (integral)  0.9550 (closed form)  fugacity =  286.5 bar

The two derivatives agree to six decimal places, as the Maxwell relation demands, and the internal pressure equals a/V², 5.48 bar for nitrogen at a molar volume of 0.5 L. The heat-capacity differences confirm the small values quoted for water and copper. The fugacity coefficient of nitrogen at 300 K stays close to 1 at moderate pressures, dipping slightly below because attractions dominate. It reaches a minimum near 0.95 between 100 and 300 bar and has turned back upward by 300 bar, as the excluded volume begins to take over; at still higher pressures it exceeds 1. The numerical integral and the closed form agree to four decimal places.

Common mistakes

  • MistakedU = T dS − P dV holds only for reversible changes.

    InsteadIt holds for any change between equilibrium states; only the identification of T dS as heat requires reversibility.

  • MistakeThe Maxwell relations are approximations.

    InsteadThey are exact consequences of the equality of mixed second derivatives of state functions.

  • MistakeThe chemical potential is the molar Gibbs energy in every case.

    InsteadThat is true for a pure substance; in a mixture μᵢ is the partial molar Gibbs energy, which depends on composition.

  • MistakeMatter flows from high concentration to low.

    InsteadIt flows from high chemical potential to low; concentration is one influence on μ among several.

  • MistakeCP − CV = R for every substance.

    InsteadThat holds for an ideal gas; in general CP − CV = TVα²/κT.

  • MistakeFugacity is a real pressure that can be read on a gauge.

    InsteadIt is an effective pressure defined so that μ = μ° + RT ln(f/p°) holds exactly.

Summary and key terms

  • The fundamental equation dU = T dS − P dV combines the first and second laws; dH = T dS + V dP, dA = −S dT − P dV, dG = −S dT + V dP.
  • Euler reciprocity applied to these gives the four Maxwell relations (1871).
  • (∂U/∂V)T = T(∂P/∂T)V − P: zero for an ideal gas and a/Vm² for a van der Waals gas.
  • CP − CV = TVα²/κT, equal to nR for an ideal gas and small for condensed phases.
  • The chemical potential μᵢ = (∂G/∂nᵢ)T,P,nⱼ is the partial molar Gibbs energy; G = Σnᵢμᵢ and Σnᵢdμᵢ = 0.
  • Matter moves from high μ to low; at equilibrium each substance has the same μ in every phase.
Fundamental equation
dU = T dS − P dV, valid for any change between equilibrium states of a closed system.
Natural variables
The variables in which a thermodynamic potential has its simplest differential, such as T and P for G.
Maxwell relation
An equality between partial derivatives that follows from the exactness of dU, dH, dA or dG.
Thermodynamic equation of state
(∂U/∂V)T = T(∂P/∂T)V − P.
Chemical potential
The partial molar Gibbs energy of a component, μᵢ = (∂G/∂nᵢ)T,P,nⱼ.
Gibbs–Duhem equation
Σnᵢ dμᵢ = 0 at constant temperature and pressure.
Fugacity
An effective pressure that makes μ = μ° + RT ln(f/p°) exact for a real gas.

Practice problems

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

  1. Use dA = −S dT − P dV to derive a Maxwell relation.

    Show answer

    (∂S/∂V)T = (∂P/∂T)V.

  2. Show that (∂U/∂V)T = 0 for an ideal gas using the thermodynamic equation of state.

    Show answer

    T(∂P/∂T)V = T(nR/V) = P, so T(∂P/∂T)V − P = 0.

  3. For a van der Waals gas, what is the internal pressure of CO₂ (a = 3.640 L² bar/mol²) at Vm = 0.20 L/mol?

    Show answer

    a/Vm² = 3.640/0.040 = 91 bar.

  4. Mercury has α = 1.81 × 10⁻⁴ K⁻¹, κT = 4.0 × 10⁻¹¹ Pa⁻¹ and Vm = 14.8 cm³/mol. Estimate CP − CV at 298 K.

    Show answer

    298 × 14.8 × 10⁻⁶ × (1.81 × 10⁻⁴)²/4.0 × 10⁻¹¹ = 3.6 J/(K mol).

  5. Ice and liquid water coexist at 0 °C and 1 bar. What can you say about their chemical potentials?

    Show answer

    They are equal; otherwise water would move from the phase of higher μ to the other.

  6. Why does the gas line fall most steeply on a plot of μ against T?

    Show answer

    (∂μ/∂T)P = −Sm, and the gas has the largest molar entropy.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz