Advanced Physics‹›⌂ 0:00 studied

Module 13 · 11 min read · Free chapter

Partition function: thermodynamics, populations and the Saha equation

In short

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∂ln⁡Z∂T,F=−kTln⁡ZN,S=U−FT,P=−(∂F∂V)TU = NkT^2\frac{\partial\ln Z}{\partial T}, \qquad F = -kT\ln Z_N, \qquad S = \frac{U - F}{T}, \qquad P = -\left(\frac{\partial F}{\partial V}\right)_T

Ideal gas. For a particle in a box of volume V, summing over translational states gives

Z=V(2πmkTh2)32Z = V\left(\frac{2\pi mkT}{h^2}\right)^{\frac{3}{2}}

Then U=32NkTU = \dfrac{3}{2}NkT and P = NkT ÷ V, recovering the ideal gas law.

Gibbs paradox. If we take ZN=ZNZ_N = Z^N, 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=ZNN!Z_N = \frac{Z^N}{N!}

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−εkTZ = 1 + e^{-\frac{\varepsilon}{kT}}. For N independent particles:

U=NεeεkT+1,C=Nk(εkT)2eεkT(eεkT+1)2U = \frac{N\varepsilon}{e^{\frac{\varepsilon}{kT}} + 1}, \qquad C = Nk\left(\frac{\varepsilon}{kT}\right)^2\frac{e^{\frac{\varepsilon}{kT}}}{\left(e^{\frac{\varepsilon}{kT}} + 1\right)^2}

U rises from 0 to Nε2\dfrac{N\varepsilon}{2}, and C shows the Schottky peak described in gas heat capacities.

Symmetric levels ±Δ2\dfrac{\Delta}{2}. Then Z=2cosh⁡Δ2kTZ = 2\cosh\dfrac{\Delta}{2kT} and the mean energy per particle is −Δ2tanh⁡Δ2kT-\dfrac{\Delta}{2}\tanh\dfrac{\Delta}{2kT}.

Worked example. Take Δ = 10 meV, 1000 particles and T = 100 K, so kT = 8.62 meV.

  1. ΔkT\dfrac{\Delta}{kT} = 1.16, so nuppernlower=e−1.16\dfrac{n_{upper}}{n_{lower}} = e^{-1.16} ≈ 0.313.
  2. Populations: about 761 in the lower level and 239 in the upper.
  3. Total energy: (239 − 761) × 5 meV ≈ −2.6 eV.

Quantum harmonic oscillator. Levels (n+12)ℏω\left(n + \dfrac{1}{2}\right)\hbar\omega give a geometric series:

Z=e−ℏω2kT1−e−ℏωkT=12sinh⁡ℏω2kTZ = \frac{e^{-\frac{\hbar\omega}{2kT}}}{1 - e^{-\frac{\hbar\omega}{kT}}} = \frac{1}{2\sinh\frac{\hbar\omega}{2kT}}

Then U=ℏω2coth⁡ℏω2kTU = \dfrac{\hbar\omega}{2}\coth\dfrac{\hbar\omega}{2kT} per oscillator. For N one-dimensional oscillators ZN=ZNZ_N = Z^N, since each sits at its own site and is distinguishable. At high T, U → NkT, and at low T, U → Nℏω2\dfrac{N\hbar\omega}{2}.

Average energy in general. Since Z=∑gie−βεiZ = \sum g_ie^{-\beta\varepsilon_i}, differentiating gives ⟨ε⟩=−∂ln⁡Z∂β\langle\varepsilon\rangle = -\dfrac{\partial\ln Z}{\partial\beta}. 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=−∂F∂VP = -\dfrac{\partial F}{\partial V}, S=−∂F∂TS = -\dfrac{\partial F}{\partial T}, U = F + TS, CV=∂U∂TC_V = \dfrac{\partial U}{\partial T}.

Perfect gas. Given Z=Vh3(2πmkT)32Z = \dfrac{V}{h^3}(2\pi mkT)^{\frac{3}{2}} per molecule, ln⁡Z=32ln⁡T\ln Z = \dfrac{3}{2}\ln T + terms without T. So

  1. ⟨ε⟩=kT2∂ln⁡Z∂T=32kT\langle\varepsilon\rangle = kT^2\dfrac{\partial\ln Z}{\partial T} = \dfrac{3}{2}kT.
  2. CV=32kC_V = \dfrac{3}{2}k per molecule, or 32R\dfrac{3}{2}R per mole.

An unusual system. Given Q=ceαT3VQ = ce^{\alpha T^3V}, with c and α constants:

  1. F=−kTln⁡c−kαT4VF = -kT\ln c - k\alpha T^4V.
  2. Pressure P=kαT4P = k\alpha T^4, independent of volume.
  3. Entropy S=kln⁡c+4kαT3VS = k\ln c + 4k\alpha T^3V.
  4. Energy U = F + TS = 3kαT4V3k\alpha T^4V, and CV=12kαT3VC_V = 12k\alpha T^3V.

The relation P=U3VP = \dfrac{U}{3V} and the T⁴ law show this is a photon-like gas, as in thermal radiation.

Mixture of two gases. With NAN_A molecules of A and NBN_B of B, both ideal and monatomic,

Z=ZANAZBNBNA! NB!,F=−NAkTln⁡eZANA−NBkTln⁡eZBNBZ = \frac{Z_A^{N_A}Z_B^{N_B}}{N_A!\,N_B!}, \qquad F = -N_AkT\ln\frac{eZ_A}{N_A} - N_BkT\ln\frac{eZ_B}{N_B}

Each ZiZ_i is proportional to V, so P=−∂F∂V=(NA+NB)kTVP = -\dfrac{\partial F}{\partial V} = \dfrac{(N_A + N_B)kT}{V}. 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 g1g_1, g2g_2 and gap ΔE,

n2n1=g2g1e−ΔEkT\frac{n_2}{n_1} = \frac{g_2}{g_1}e^{-\frac{\Delta E}{kT}}

Thin air. For molecules in gravity, the "levels" are heights with energy mgh. So n(h)=n0e−mghkTn(h) = n_0e^{-\frac{mgh}{kT}}. For pure nitrogen at 300 K the scale height is RTMg=8.314×3000.028×9.8\dfrac{RT}{Mg} = \dfrac{8.314 \times 300}{0.028 \times 9.8} ≈ 9.1 km. The density halves at 9.1×ln⁡29.1 \times \ln 2 ≈ 6.3 km, about two-thirds of the way up Mount Everest.

A sodium lamp. The yellow line at 590 nm means ΔE = hcλ\dfrac{hc}{\lambda} ≈ 2.10 eV. At 250 °C, kT ≈ 0.0451 eV, so ΔEkT\dfrac{\Delta E}{kT} ≈ 46.6. With g2=6g_2 = 6 and g1=2g_1 = 2, n2n1\dfrac{n_2}{n_1} ≈ 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, n2n1=e−87\dfrac{n_2}{n_1} = e^{-87} ≈ 10⁻³⁸. Even at 10 000 K the ratio is only about 7 × 10⁻². Equilibrium can never give n2>n1n_2 > n_1, 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 32kT\dfrac{3}{2}kT = 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

n2n1=4e−10.20.8≈1.2×10−5\frac{n_2}{n_1} = 4e^{-\frac{10.2}{0.8}} \approx 1.2 \times 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,

n+nen0=2g+g0(2πmekTh2)32e−χkT\frac{n_+n_e}{n_0} = \frac{2g_+}{g_0}\left(\frac{2\pi m_ekT}{h^2}\right)^{\frac{3}{2}}e^{-\frac{\chi}{kT}}

where χ is the ionisation energy and the factor 2 is the electron's spin. For hydrogen 2g+g0=1\dfrac{2g_+}{g_0} = 1.

Numbers. The bracket is about 2.4 × 10²¹ T32T^{\frac{3}{2}} m⁻³. With nen_e ≈ 10²⁰ m⁻³:

  • At 6000 K, n+n0\dfrac{n_+}{n_0} ≈ 4 × 10⁻⁵: hydrogen is almost neutral.
  • At 10 000 K, n+n0\dfrac{n_+}{n_0} ≈ 3: hydrogen is mostly ionised.

Effect of pressure. Higher pressure raises nen_e 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=Vh3∫0∞4πp2e−pckT dp=8πV(kThc)3Z = \frac{V}{h^3}\int_0^\infty 4\pi p^2e^{-\frac{pc}{kT}}\,dp = 8\pi V\left(\frac{kT}{hc}\right)^3

For N identical particles ZN=ZNN!Z_N = \dfrac{Z^N}{N!}. Since ln Z contains 3 ln T and ln V:

  1. U = 3NkT, twice the non-relativistic value.
  2. P=NkTVP = \dfrac{NkT}{V}, the same ideal gas law.
  3. CV=3NkC_V = 3Nk, so γ = 43\dfrac{4}{3}.
  4. PV=U3PV = \dfrac{U}{3}, as for radiation.

Internal motions. A molecule's Z factorises into translation, rotation, vibration and electronic parts, covered in gas heat capacities. Only ZtransZ_{trans} depends on V, so pressure always comes out as NkTV\dfrac{NkT}{V}; internal motions change only U, S and CVC_V.

Chemical equilibrium. For a reaction A + B ⇌ C, equilibrium needs μA+μB=μC\mu_A + \mu_B = \mu_C. With μ=−kTln⁡ZN\mu = -kT\ln\dfrac{Z}{N} this gives a law of mass action, nCnAnB\dfrac{n_C}{n_An_B} = 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(2πmkTh2)32V\left(\dfrac{2\pi mkT}{h^2}\right)^{\frac{3}{2}} 32kT\dfrac{3}{2}kT 32k\dfrac{3}{2}k
Two levels 0, ε 1+e−εkT1 + e^{-\frac{\varepsilon}{kT}} εeεkT+1\dfrac{\varepsilon}{e^{\frac{\varepsilon}{kT}} + 1} Schottky peak
Quantum oscillator 12sinh⁡ℏω2kT\dfrac{1}{2\sinh\frac{\hbar\omega}{2kT}} ℏω2coth⁡ℏω2kT\dfrac{\hbar\omega}{2}\coth\dfrac{\hbar\omega}{2kT} Einstein function
Relativistic particle 8πV(kThc)38\pi V\left(\dfrac{kT}{hc}\right)^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)

  1. Partition function (3 marks). Z=1+e−εkTZ = 1 + e^{-\frac{\varepsilon}{kT}}; populations of each level.
  2. Energy (4 marks). U=NkT2∂ln⁡Z∂TU = NkT^2\dfrac{\partial\ln Z}{\partial T}; final form; limits 0 and Nε2\dfrac{N\varepsilon}{2}.
  3. Heat capacity (5 marks). Differentiate; Schottky form; peak near kT ≈ 0.42ε; sketch.
  4. Discussion (3 marks). No more than half in the upper level at positive T; link to negative temperature and paramagnetic salts.

Mains practice: questions to try

These are practice questions written by us, not past papers. The UPSC questions on this topic are shown in the previous year questions panel.

# Question Marks What it tests
1 Find the height at which the density of an oxygen atmosphere at 250 K falls to one-third. 5 barometric law
2 A system has three levels 0, ε, 2ε, each non-degenerate. Find Z and the mean energy. 10 partition function
3 Find the entropy of N quantum oscillators at high temperature. 10 oscillator Z
4 Using Saha's equation, find the temperature at which hydrogen with nen_e = 10²¹ m⁻³ is half ionised. 15 Saha
5 Show that Z = (aVT52)NN!\dfrac{(aVT^{\frac{5}{2}})^N}{N!} describes an ideal gas with CV=52NkC_V = \dfrac{5}{2}Nk. 10 reading Z

Quick revision

  • ⟨ε⟩=−∂ln⁡Z∂β\langle\varepsilon\rangle = -\dfrac{\partial\ln Z}{\partial\beta}; F = −kT ln ZNZ_N; ZN=ZNN!Z_N = \dfrac{Z^N}{N!} for gases.
  • Recipe: F → P, S → U → CVC_V.
  • Two levels: U=NεeεkT+1U = \dfrac{N\varepsilon}{e^{\frac{\varepsilon}{kT}} + 1}; ±Δ2\dfrac{\Delta}{2} levels: −Δ2tanh⁡Δ2kT-\dfrac{\Delta}{2}\tanh\dfrac{\Delta}{2kT}.
  • Oscillator Z=12sinh⁡ℏω2kTZ = \dfrac{1}{2\sinh\frac{\hbar\omega}{2kT}}.
  • n2n1=g2g1e−ΔEkT\dfrac{n_2}{n_1} = \dfrac{g_2}{g_1}e^{-\frac{\Delta E}{kT}}; nitrogen halves at 6.3 km.
  • No inversion in equilibrium; lasers need pumping.
  • Saha: ionisation rises with T, falls with nen_e; Balmer lines peak near 10 000 K.
  • Relativistic: U = 3NkT, PV=U3PV = \dfrac{U}{3}; mixtures obey Dalton's law.

Mains answer practice

Write your answer first, then open the points a good answer should cover.

  1. Write U, F, S and P in terms of the partition function and explain why Z_N = Z^N/N! for a gas.

    Show answer points
    • U = NkT² ∂ln Z/∂T
    • F = −kT ln Z_N
    • S = (U − F)/T
    • P = −∂F/∂V
    • N! for identical particles, Gibbs paradox
  2. N particles have two levels 0 and ε. Find Z, U and C.

    Show answer points
    • Z = 1 + e^(−ε/kT)
    • U = Nε/(e^(ε/kT) + 1)
    • limits 0 and Nε/2
    • C = Nk(ε/kT)² e^(ε/kT)/(e^(ε/kT)+1)²
    • Schottky peak near kT ≈ 0.42ε
  3. Given Q = c e^(αT³V), find P, S, U and C_V.

    Show answer points
    • F = −kT ln c − kαT⁴V
    • P = kαT⁴
    • S = k ln c + 4kαT³V
    • U = 3kαT⁴V
    • C_V = 12kαT³V
  4. At what height is the density of a pure nitrogen atmosphere at 300 K half its sea-level value?

    Show answer points
    • n(h) = n₀ e^(−mgh/kT)
    • scale height RT/Mg
    • ≈ 9.1 km
    • h = 9.1 × ln 2
    • ≈ 6.3 km
  5. State Saha's ionisation equation and explain how it accounts for stellar spectral classes.

    Show answer points
    • n₊nₑ/n₀ = (2g₊/g₀)(2πmₑkT/h²)^(3/2) e^(−χ/kT)
    • ionisation rises with T
    • falls with electron density
    • Balmer lines need n = 2 atoms
    • lines peak near 10 000 K, A stars
  6. For a mixture of N_A and N_B ideal monatomic molecules, find the Helmholtz free energy and pressure.

    Show answer points
    • Z = Z_A^N_A Z_B^N_B/(N_A! N_B!)
    • F = −kT ln Z
    • Stirling gives N ln(eZ/N) terms
    • each Z_i ∝ V
    • P = (N_A + N_B)kT/V, Dalton's law
  7. For an ultra-relativistic gas with Z = 8πV(kT/hc)³ per particle, find U, P and C_V.

    Show answer points
    • Z_N = Z^N/N!
    • ln Z has 3 ln T and ln V
    • U = 3NkT
    • P = NkT/V
    • C_V = 3Nk, PV = U/3
  8. Find the ratio of upper to lower level populations for a 550 nm laser transition at 300 K and explain why pumping is needed.

    Show answer points
    • ΔE = hc/λ ≈ 2.25 eV
    • kT ≈ 0.026 eV
    • ratio e^(−87) ≈ 10⁻³⁸
    • equilibrium never gives inversion
    • pump needed for gain

Previous year questions

Previous year questions for UPSC CSE will appear here once each one is checked word for word against the official question paper.

Learn with AI

A tutor that asks instead of telling, a partner that argues the other side, and this chapter told through your own district.

Tell the tutor what you are stuck on. It will guide you with questions and give the answer after a few tries.

🙋 Raise a doubt or feedback

Stuck somewhere, or spotted a mistake? Write to the ExamHike team. We usually reply within a day, and you will see the reply on My progress.

Log in to ask a doubt or send feedback →

Frequently asked questions

How is U found from Z?

U = NkT² ∂ln Z/∂T.

What is the Schottky anomaly?

A heat-capacity peak from a two-level system.

What does the Saha equation give?

The ionised fraction of a gas at temperature T.

Why can't heating make a laser?

Equilibrium never inverts populations.

More in this module: Kinetic theory and statistical physics

Official sources

Facts in this chapter were checked against these official sources.

  1. IGNOU BPHCT-135 Basic concepts of statistical mechanics and classical statistics units
  2. MIT OpenCourseWare 8.333 Statistical mechanics I, ensembles notes
  3. OpenStax Astronomy 2e, Chapter 17: Analyzing starlight and spectral classes