Once Z is known, F = −kT ln Z gives every thermodynamic quantity. Boltzmann populations explain lasers, the atmosphere and stellar spectra.
What are you preparing for?We show the practice and previous year questions of your exam.
Start from zero: one sum that holds everything
In 1920 Meghnad Saha, working in Kolkata and London, solved a puzzle that had stumped astronomers. Stars showed very different spectra, some full of hydrogen lines and some with almost none, yet they are made of nearly the same stuff. Saha showed the difference is mostly temperature.
His tool was the Boltzmann factor, summed over all states: the partition function Z. Once Z is known, energy, entropy, pressure, heat capacity and the populations of every level follow by differentiation. It is the single most useful quantity in statistical physics.
This chapter turns Z into thermodynamics, works through the standard systems that examiners ask about, and ends with level populations, lasers and the Saha equation.
Thermodynamics from the partition function (2019, Geo 2024)
Key formulas. For N independent particles with single-particle partition function Z:
U=NkT2∂T∂lnZ,F=−kTlnZN,S=TU−F,P=−(∂V∂F)T
Ideal gas. For a particle in a box of volume V, summing over translational states gives
Z=V(h22πmkT)23
Then U=23NkT and P = NkT ÷ V, recovering the ideal gas law.
Gibbs paradox. If we take ZN=ZN, as for distinguishable particles, the entropy is not extensive: mixing two identical gases appears to increase entropy, which is absurd. Gibbs resolved this by dividing by N!, since swapping identical particles does not give a new microstate:
ZN=N!ZN
This gives the Sackur-Tetrode equation for the entropy of an ideal monatomic gas, which matches measured entropies and contains Planck's constant, a hint of quantum mechanics hidden in classical gases.
Limits of Maxwell-Boltzmann statistics. MB statistics assumes that the number of available states far exceeds the number of particles, so no two particles compete for the same state. This fails at low temperature or high density, as for electrons in metals or photons in a cavity. There quantum statistics, Bose-Einstein or Fermi-Dirac, must be used.
Two-level systems and oscillators (2016, 2018, 2020, Geo 2026)
Two levels, 0 and ε. For one particle Z=1+e−kTε. For N independent particles:
U=ekTε+1Nε,C=Nk(kTε)2(ekTε+1)2ekTε
U rises from 0 to 2Nε, and C shows the Schottky peak described in gas heat capacities.
Symmetric levels ±2Δ. Then Z=2cosh2kTΔ and the mean energy per particle is −2Δtanh2kTΔ.
Worked example. Take Δ = 10 meV, 1000 particles and T = 100 K, so kT = 8.62 meV.
kTΔ = 1.16, so nlowernupper=e−1.16 ≈ 0.313.
Populations: about 761 in the lower level and 239 in the upper.
Total energy: (239 − 761) × 5 meV ≈ −2.6 eV.
Quantum harmonic oscillator. Levels (n+21)ℏω give a geometric series:
Z=1−e−kTℏωe−2kTℏω=2sinh2kTℏω1
Then U=2ℏωcoth2kTℏω per oscillator. For N one-dimensional oscillators ZN=ZN, since each sits at its own site and is distinguishable. At high T, U → NkT, and at low T, U → 2Nℏω.
Average energy in general. Since Z=∑gie−βεi, differentiating gives ⟨ε⟩=−∂β∂lnZ. This one line is the answer to every "find the average energy from Z" question.
Solved problems from a given partition function (2019, 2025, Geo 2023)
Recipe. Write ln Z. Then F = −kT ln Z, P=−∂V∂F, S=−∂T∂F, U = F + TS, CV=∂T∂U.
Perfect gas. Given Z=h3V(2πmkT)23 per molecule, lnZ=23lnT + terms without T. So
⟨ε⟩=kT2∂T∂lnZ=23kT.
CV=23k per molecule, or 23R per mole.
An unusual system. Given Q=ceαT3V, with c and α constants:
F=−kTlnc−kαT4V.
Pressure P=kαT4, independent of volume.
Entropy S=klnc+4kαT3V.
Energy U = F + TS = 3kαT4V, and CV=12kαT3V.
The relation P=3VU and the T⁴ law show this is a photon-like gas, as in thermal radiation.
Mixture of two gases. With NA molecules of A and NB of B, both ideal and monatomic,
Each Zi is proportional to V, so P=−∂V∂F=V(NA+NB)kT. Each gas exerts its own partial pressure, which is Dalton's law.
Boltzmann populations: air, lamps and lasers (2022, 2024, Geo 2024)
Population ratio. For two levels with degeneracies g1, g2 and gap ΔE,
n1n2=g1g2e−kTΔE
Thin air. For molecules in gravity, the "levels" are heights with energy mgh. So n(h)=n0e−kTmgh. For pure nitrogen at 300 K the scale height is MgRT=0.028×9.88.314×300 ≈ 9.1 km. The density halves at 9.1×ln2 ≈ 6.3 km, about two-thirds of the way up Mount Everest.
A sodium lamp. The yellow line at 590 nm means ΔE = λhc ≈ 2.10 eV. At 250 °C, kT ≈ 0.0451 eV, so kTΔE ≈ 46.6. With g2=6 and g1=2, n1n2 ≈ 3 × 5.6 × 10⁻²¹ ≈ 1.7 × 10⁻²⁰. Thermal excitation is negligible; the lamp's discharge excites the atoms.
Lasers. For a 550 nm transition, ΔE ≈ 2.25 eV. At 300 K, n1n2=e−87 ≈ 10⁻³⁸. Even at 10 000 K the ratio is only about 7 × 10⁻². Equilibrium can never give n2>n1, so a laser needs a pump that drives atoms up faster than they fall, as in a three-level ruby laser.
Macrostates and microstates in a laser. The macrostate is the set of level populations; the microstates are all the ways to assign individual atoms to those levels. Pumping moves the medium to a macrostate that is not the most probable one at room temperature.
The Saha ionisation equation (2026, IFoS 2023)
Excitation in a star. Hydrogen atoms in a stellar atmosphere have mean kinetic energy 1.2 eV, so 23kT = 1.2 eV and kT = 0.8 eV, about 9300 K. The ratio of atoms in n = 2 (g = 8) to n = 1 (g = 2) is
n1n2=4e−0.810.2≈1.2×10−5
Ionisation as a reaction. Saha treated H ⇌ p + e like a chemical equilibrium. Using partition functions for the atom, proton and free electron,
n0n+ne=g02g+(h22πmekT)23e−kTχ
where χ is the ionisation energy and the factor 2 is the electron's spin. For hydrogen g02g+=1.
Numbers. The bracket is about 2.4 × 10²¹ T23 m⁻³. With ne ≈ 10²⁰ m⁻³:
At 6000 K, n0n+ ≈ 4 × 10⁻⁵: hydrogen is almost neutral.
At 10 000 K, n0n+ ≈ 3: hydrogen is mostly ionised.
Effect of pressure. Higher pressure raises ne and pushes the balance back towards neutral atoms. So giant stars, with thin atmospheres, are more ionised than dwarfs at the same temperature. This is how astronomers separate giants from dwarfs by spectrum.
Spectral classes. Balmer lines need atoms in n = 2. Cool stars have too few excited atoms; very hot stars have ionised most of their hydrogen. The lines peak near 10 000 K, in A-type stars such as Sirius. Saha's equation turned the spectral sequence O, B, A, F, G, K, M into a temperature scale.
Deep dive: relativistic gases and internal partition functions (Geo 2025)
Ultra-relativistic gas. For E = pc, the single-particle partition function is
Z=h3V∫0∞4πp2e−kTpcdp=8πV(hckT)3
For N identical particles ZN=N!ZN. Since ln Z contains 3 ln T and ln V:
U = 3NkT, twice the non-relativistic value.
P=VNkT, the same ideal gas law.
CV=3Nk, so γ = 34.
PV=3U, as for radiation.
Internal motions. A molecule's Z factorises into translation, rotation, vibration and electronic parts, covered in gas heat capacities. Only Ztrans depends on V, so pressure always comes out as VNkT; internal motions change only U, S and CV.
Chemical equilibrium. For a reaction A + B ⇌ C, equilibrium needs μA+μB=μC. With μ=−kTlnNZ this gives a law of mass action, nAnBnC = ratio of partition functions per volume. Saha's equation is the special case with an electron as one product.
Standard partition functions compared
System
Z (one unit)
Mean energy
Heat capacity per unit
Ideal gas atom
V(h22πmkT)23
23kT
23k
Two levels 0, ε
1+e−kTε
ekTε+1ε
Schottky peak
Quantum oscillator
2sinh2kTℏω1
2ℏωcoth2kTℏω
Einstein function
Relativistic particle
8πV(hckT)3
3kT
3k
Concept clarifications: commonly confused ideas
Writing a 15-mark answer
Question: "A system of N particles has two energy levels, 0 and ε. Obtain the partition function, the internal energy and the heat capacity, and discuss their behaviour at low and high temperatures." (15 marks)
Partition function (3 marks).Z=1+e−kTε; populations of each level.
Energy (4 marks).U=NkT2∂T∂lnZ; final form; limits 0 and 2Nε.