Skip to main content

Thermodynamic Functions from Statistics

The power of statistical thermodynamics is that once the partition function is known, the macroscopic thermodynamic functions follow by differentiation. This turns molecular energy levels into heat capacities, entropies, equations of state, and equilibrium constants.

Atkins uses this machinery to show that classical thermodynamic quantities are not independent assumptions. They emerge from molecular state counting, especially through the canonical partition function QQ and the Helmholtz energy A=kTlnQA=-kT\ln Q.

A Maxwell-Boltzmann distribution plot compares molecular speed distributions for several noble gases.

Figure: Molecular speed distributions as one route from microscopic state populations to thermodynamic functions. Image: Wikimedia Commons, Pdbailey, Cryptic C62, and Lilyu, public domain.

Definitions

The canonical ensemble describes systems with fixed NN, VV, and TT, in thermal contact with a heat reservoir. Its partition function is

Q=stateseEs/kTQ=\sum_{\mathrm{states}} e^{-E_s/kT}

where EsE_s is the energy of a complete system microstate.

The Helmholtz energy is

A=kTlnQA=-kT\ln Q

For independent indistinguishable molecules,

Q=qNN!Q=\frac{q^N}{N!}

where qq is the molecular partition function. Stirling's approximation,

lnN!NlnNN\ln N!\approx N\ln N-N

is used for macroscopic NN.

Thermodynamic functions follow from AA:

S=(AT)V,NS=-\left(\frac{\partial A}{\partial T}\right)_{V,N} U=A+TSU=A+TS p=(AV)T,Np=-\left(\frac{\partial A}{\partial V}\right)_{T,N} μ=(AN)T,V\mu=\left(\frac{\partial A}{\partial N}\right)_{T,V}

For reactions, molecular partition functions lead to equilibrium constants through standard molar Gibbs energies and through ratios of partition functions for products and reactants.

Key results

If Q=qN/N!Q=q^N/N!, then

A=NkTlnq+kTlnN!A=-NkT\ln q+kT\ln N!

Using Stirling's approximation,

ANkTln(qN)NkTA\approx -NkT\ln\left(\frac{q}{N}\right)-NkT

For a monatomic ideal gas, q=qtrans=V/Λ3q=q_{\mathrm{trans}}=V/\Lambda^3, so

A=NkT[ln(VNΛ3)+1]A=-NkT\left[\ln\left(\frac{V}{N\Lambda^3}\right)+1\right]

Pressure follows immediately:

p=(AV)T,N=NkTVp=-\left(\frac{\partial A}{\partial V}\right)_{T,N} =\frac{NkT}{V}

which is the perfect gas law:

pV=NkT=nRTpV=NkT=nRT

The entropy of an ideal monatomic gas is the Sackur-Tetrode equation:

S=Nk[ln(VNΛ3)+52]S=Nk\left[\ln\left(\frac{V}{N\Lambda^3}\right)+\frac{5}{2}\right]

or, molar form,

Sm=R[ln(VmNAΛ3)+52]S_m=R\left[\ln\left(\frac{V_m}{N_A\Lambda^3}\right)+\frac{5}{2}\right]

For a general molecular partition function,

U=NkT2(lnqT)VU=NkT^2\left(\frac{\partial\ln q}{\partial T}\right)_V

when the zero of energy is chosen consistently. Heat capacity is

CV=(UT)VC_V=\left(\frac{\partial U}{\partial T}\right)_V

Residual entropy occurs when a crystal has more than one arrangement even as T0T\to0. If W0>1W_0\gt 1,

S(0)=klnW0S(0)=k\ln W_0

which explains why orientational disorder can leave a nonzero entropy when the simple Third Law assumption of a unique perfect crystal is not met.

The canonical relation A=kTlnQA=-kT\ln Q is one of the most compact results in physical chemistry. It says that the free energy is determined by the logarithm of the weighted number of accessible states. A system with many low-energy states has a large QQ and therefore a lower AA. This is the statistical version of the thermodynamic drive toward lower Helmholtz energy at fixed TT and VV.

Differentiation of lnQ\ln Q gives averages because the Boltzmann factor contains energy in the exponent. For example,

U=(lnQβ)V,NU=-\left(\frac{\partial\ln Q}{\partial\beta}\right)_{V,N}

with β=1/kT\beta=1/kT. A derivative with respect to β\beta pulls down the energy of each state, weighted by its probability. This is a recurring statistical trick: derivatives of generating functions produce moments of distributions.

The pressure derivation from translational QQ is especially important because it shows that the perfect gas equation is not merely empirical. The volume dependence of qtransq_{\mathrm{trans}} means that increasing volume increases the number of translational states. The system exerts pressure because expanding the volume lowers AA by increasing translational entropy. In this view, gas pressure is an entropic force.

Entropy contains two related contributions. One is the logarithm of the number of accessible states, and the other reflects how the average energy changes with temperature. In the canonical ensemble,

S=klnQ+UTS=k\ln Q+\frac{U}{T}

for appropriate energy conventions. This formula shows why entropy rises when either more states become accessible or energy is distributed over higher levels.

The N!N! correction resolves the Gibbs paradox for ideal gases. If identical particles were counted as distinguishable, mixing two samples of the same gas would appear to produce an entropy increase, even though no observable change occurs. Dividing by N!N! removes the overcounting of particle labels. For different gases, the labels correspond to observable species identity, so a real entropy of mixing remains.

Residual entropy illustrates that entropy is not only about thermal motion. Ice, for example, can retain many proton arrangements consistent with local bonding rules. If these arrangements remain frozen in at low temperature, there is configurational multiplicity even without thermal excitation. This connects statistical thermodynamics to materials disorder, glasses, orientational crystals, and magnetic systems.

Equilibrium constants can be built from partition functions because chemical potentials can. For an ideal-gas reaction, the standard Gibbs energy contains molecular partition functions, zero-point energies, electronic energies, and standard-state translational factors. A reaction is product-favored when the product side has lower energetic terms and/or greater accessible-state multiplicity after standard-state corrections. This perspective explains why entropy can drive dissociation at high temperature even when bond breaking is enthalpically costly.

Heat capacity is a fluctuation measure in the canonical ensemble. A system has high heat capacity when its energy can change substantially with temperature, which occurs when there are accessible states near kTkT. In more advanced form,

CV=E2E2kT2C_V=\frac{\langle E^2\rangle-\langle E\rangle^2}{kT^2}

This equation explains why heat capacity is nonnegative in stable canonical systems and why closely spaced energy levels produce large thermal responses.

The statistical route also clarifies the limits of classical thermodynamics. Classical thermodynamics gives relationships among properties without identifying molecular origins. Statistical thermodynamics predicts those properties from masses, moments of inertia, frequencies, degeneracies, and interaction models. The two approaches agree when the molecular model is accurate and the system is large enough for fluctuations to be negligible on the macroscopic scale.

Visual

FunctionStatistical routePhysical interpretation
AAkTlnQ-kT\ln Qfree energy at fixed T,VT,V
UUlnQ/β- \partial\ln Q/\partial\betamean internal energy
SS(A/T)V-(\partial A/\partial T)_Vaccessible microstates plus energy spread
pp(A/V)T-(\partial A/\partial V)_Tresponse to volume change
μ\mu(A/N)T,V(\partial A/\partial N)_{T,V}cost of adding a molecule
CVC_V(U/T)V(\partial U/\partial T)_Vthermal accessibility of energy modes

Worked example 1: Deriving ideal gas pressure from QQ

Problem. Show explicitly that the translational partition function gives pV=NkTpV=NkT for a monatomic gas.

Method. Use

q=VΛ3q=\frac{V}{\Lambda^3}

and

A=kTlnqNN!A=-kT\ln\frac{q^N}{N!}
  1. Write lnQ\ln Q:
lnQ=NlnqlnN!\ln Q=N\ln q-\ln N!
  1. Substitute qq:
lnq=lnV3lnΛ\ln q=\ln V-3\ln\Lambda

Only lnV\ln V depends on volume.

  1. Helmholtz derivative:
p=kT(lnQV)T,Np=kT\left(\frac{\partial\ln Q}{\partial V}\right)_{T,N}
  1. Differentiate:
lnQV=NlnVV=NV\frac{\partial\ln Q}{\partial V} =N\frac{\partial\ln V}{\partial V} =\frac{N}{V}
  1. Pressure:
p=kTNVp=kT\frac{N}{V}
  1. Rearranged:
pV=NkTpV=NkT

Checked answer. The equation of state follows from translational states because qtransq_{\mathrm{trans}} is proportional to VV.

Worked example 2: Heat capacity of a two-level system

Problem. A mole of independent molecules has two nondegenerate levels separated by ϵ\epsilon with ϵ/k=300 K\epsilon/k=300\ \mathrm{K}. Calculate the molar internal energy above the ground state at T=300 KT=300\ \mathrm{K}.

Method. For two levels,

p1=eϵ/kT1+eϵ/kTp_1=\frac{e^{-\epsilon/kT}}{1+e^{-\epsilon/kT}}

and

Um=NAϵp1=R(ϵ/k)p1U_m=N_A\epsilon p_1=R(\epsilon/k)p_1
  1. Exponent:
ϵkT=300300=1\frac{\epsilon}{kT}=\frac{300}{300}=1
  1. Boltzmann factor:
e1=0.3679e^{-1}=0.3679
  1. Upper population:
p1=0.36791+0.3679=0.2689p_1=\frac{0.3679}{1+0.3679}=0.2689
  1. Molar energy:
Um=R(300 K)(0.2689)U_m=R(300\ \mathrm{K})(0.2689)
  1. Substitute:
Um=(8.314)(300)(0.2689)=670.8 J mol1U_m=(8.314)(300)(0.2689)=670.8\ \mathrm{J\ mol^{-1}}

Checked answer. The energy is less than the equal-population limit R(300)/2=1247 J mol1R(300)/2=1247\ \mathrm{J\ mol^{-1}}, as expected at T=ϵ/kT=\epsilon/k.

Code

import numpy as np

R = 8.314462618

def two_level_energy(theta, T):
x = theta / T
p1 = np.exp(-x) / (1 + np.exp(-x))
return R * theta * p1

def two_level_cv(theta, T):
x = theta / T
ex = np.exp(x)
return R * x**2 * ex / (ex + 1)**2

for T in [50, 100, 300, 1000]:
print(f"T={T:5.0f} K U={two_level_energy(300,T):8.2f} J/mol Cv={two_level_cv(300,T):7.3f} J/K/mol")

Common pitfalls

  • Differentiating qq when the correct thermodynamic object is QQ. For gases, the N!N! factor affects entropy and chemical potential.
  • Forgetting which variables are held constant in derivatives.
  • Mixing molecular and molar constants. Use kk per molecule and R=NAkR=N_Ak per mole.
  • Dropping zero-point energies inconsistently when comparing reactions.
  • Treating the partition function as a purely mathematical trick. It is the bridge from quantum state accessibility to thermodynamic response.

When deriving thermodynamic functions, track the independent variables. The canonical ensemble naturally gives A(T,V,N)A(T,V,N). Pressure, entropy, and chemical potential are derivatives of AA with respect to VV, TT, and NN under specified constraints. If you switch to constant pressure, you need GG or an appropriate transformation. Many derivation errors come from differentiating the right expression while holding the wrong variable fixed.

Use Stirling's approximation only in its domain. It is excellent for macroscopic NN, but not for a handful of particles in small statistical examples. Atkins uses small-particle examples to illustrate configurations and weights; those should be counted exactly. The thermodynamic formulas using lnN!NlnNN\ln N!\approx N\ln N-N assume large NN.

The statistical view also clarifies standard-state corrections. Translational partition functions depend on volume, so chemical potentials depend on pressure or concentration. When building equilibrium constants from molecular data, the standard-state volume or pressure factors are not optional bookkeeping; they determine the numerical standard Gibbs energy.

As a final check, compare statistical results with thermodynamic identities already known. A monatomic ideal gas should give U=3nRT/2U=3nRT/2, pV=nRTpV=nRT, and a positive entropy that increases with VV and TT. If a partition-function derivation violates these limits, the error is usually in distinguishability, the volume dependence, the chosen energy zero, or the variables held constant during differentiation.

For finite systems, fluctuations are not negligible. The canonical formulas still define ensemble averages, but small clusters, nanoscale systems, and simulations may show noticeable deviations from smooth macroscopic behavior.

In simulations, time averages and ensemble averages agree only under appropriate ergodic sampling. Poor sampling can make a correct statistical formula look wrong.

Always inspect convergence before interpreting molecular thermodynamics.

Connections