Technopedia

The technologist’s encyclopedia

Statistical Foundations of Thermodynamics

This page derives the macroscopic laws of thermodynamics from the counting of microstates. It is relevant when you need to understand why entropy increases, what temperature means microscopically, or when you need to compute thermodynamic properties (heat capacity, equation of state, fluctuations) from a microscopic model. It is scoped to the bridge between microstates and macroscopic variables; the full ensemble formalism is in Statistical mechanics.

Authoritative sources

Boltzmann entropy

For a system with WW accessible microstates (all equally probable in the microcanonical ensemble):

S=kBln⁡WS = k_B \ln W
Details

Why the logarithm? Entropy must be extensive: if you combine two independent systems A and B, the total number of microstates is Wtot=WA⋅WBW_{\text{tot}} = W_A \cdot W_B (product, by the multiplication rule). Extensivity requires Stot=SA+SBS_{\text{tot}} = S_A + S_B. The only function satisfying f(WAWB)=f(WA)+f(WB)f(W_A W_B) = f(W_A) + f(W_B) is f(W)=kBln⁡Wf(W) = k_B \ln W (up to a constant).

Concrete combinatorial example: NN coins. Toss NN fair coins. A macrostate is specified by the number of heads kk (from 00 to NN); a microstate is a specific sequence of heads and tails. The number of microstates for a given kk is the binomial coefficient:

W(k)=(Nk)=N!k!(N−k)!W(k) = \binom{N}{k} = \frac{N!}{k!(N-k)!}

For N=10N = 10, the macrostate k=5k = 5 (five heads) has W=(105)=252W = \binom{10}{5} = 252 microstates, while k=0k = 0 or k=10k = 10 has only W=1W = 1. The total number of microstates is ∑kW(k)=2N\sum_k W(k) = 2^N. The most probable macrostate is overwhelmingly the one with k≈N/2k \approx N/2, and its multiplicity grows as (NN/2)∼2N/πN/2\binom{N}{N/2} \sim 2^N / \sqrt{\pi N/2} — exponentially in NN. Taking the logarithm, S=kBln⁡WS = k_B \ln W, converts this exponential growth into a quantity that is linear in NN (extensive): ln⁡(NN/2)≈Nln⁡2−12ln⁡(πN/2)≈Nln⁡2\ln \binom{N}{N/2} \approx N \ln 2 - \tfrac{1}{2}\ln(\pi N/2) \approx N \ln 2 for large NN.

k W(k) W = 252 N = 10 coins: W(k) = C(10,k), peak at k = N/2

Why does entropy increase? The number of microstates corresponding to a macrostate with energy spread over a larger volume (or more mixed composition) is overwhelmingly larger. The system evolves toward the macrostate with the most microstates, as formalized by the Second Law and Entropy.

Gibbs/von Neumann entropy. The Boltzmann formula S=kBln⁡WS = k_B \ln W assumes every microstate is equally probable — true in the microcanonical ensemble. When microstates are not equally probable (e.g., the canonical ensemble, where higher-energy states are less likely), the correct generalization is the Gibbs entropy:

S=−kB∑ipiln⁡piS = -k_B \sum_i p_i \ln p_i

For a quantum system: S=−kB Tr(ρln⁡ρ)S = -k_B \, \text{Tr}(\rho \ln \rho) where ρ\rho is the density matrix. The two forms agree when all pi=1/Wp_i = 1/W: −kB∑i(1/W)ln⁡(1/W)=kBln⁡W-k_B \sum_i (1/W)\ln(1/W) = k_B \ln W. Use the Boltzmann form for an isolated system (equal a priori probabilities) and the Gibbs form for a system in contact with a reservoir (unequal probabilities); the full derivation is in CanonicalEnsemble.

Authoritative sources

Example problem

Toss N=20N = 20 fair coins. (a) How many microstates correspond to the macrostate k=10k = 10 heads? (b) What is the entropy of that macrostate in units of kBk_B? (c) Show that S/kBS/k_B is approximately extensive, i.e., proportional to NN.

Solution

(a) W(10)=(2010)=184756W(10) = \binom{20}{10} = 184756.

(b) S/kB=ln⁡184756≈12.13S/k_B = \ln 184756 \approx 12.13.

(c) The maximum multiplicity scales as (NN/2)∼2N/πN/2\binom{N}{N/2} \sim 2^N/\sqrt{\pi N/2}, so S/kB≈Nln⁡2−12ln⁡(πN/2)S/k_B \approx N \ln 2 - \tfrac{1}{2}\ln(\pi N/2). For N=20N = 20: 20ln⁡2−12ln⁡(5π)≈13.86−1.73=12.1320 \ln 2 - \tfrac{1}{2}\ln(5\pi) \approx 13.86 - 1.73 = 12.13, matching (b). The leading term Nln⁡2N \ln 2 is linear in NN, confirming extensivity.

Temperature from statistics

In the microcanonical ensemble, temperature is defined by:

1T≡(∂S∂U)V,N\frac{1}{T} \equiv \left(\frac{\partial S}{\partial U}\right)_{V,N}
Details

Derivation. Consider two systems A and B in thermal contact, with total energy U=UA+UBU = U_A + U_B fixed. The most probable energy division maximizes Stot=SA(UA)+SB(UB)S_{\text{tot}} = S_A(U_A) + S_B(U_B):

∂Stot∂UA=∂SA∂UA−∂SB∂UB=0\frac{\partial S_{\text{tot}}}{\partial U_A} = \frac{\partial S_A}{\partial U_A} - \frac{\partial S_B}{\partial U_B} = 0

This gives (∂SA/∂UA)=(∂SB/∂UB)(\partial S_A/\partial U_A) = (\partial S_B/\partial U_B), i.e., the two systems have the same value of 1/T1/T. This is the statistical derivation of the zeroth law: thermal equilibrium equalizes temperature.

Reading the slope. The slope of the S(U)S(U) curve at any energy is the inverse temperature. Because S(U)S(U) is concave (its slope decreases as UU grows), a system with more energy has a lower temperature. For a concrete model, take S(U)=US(U) = \sqrt{U} (in units of kBk_B): at U=25U = 25, 1/T=1/(225)=0.11/T = 1/(2\sqrt{25}) = 0.1, so T=10T = 10. Energy flows from the steeper-slope (hotter) system to the flatter-slope (cooler) one until the slopes match.

U S slope = 1/T S(U)

Equilibrium of two systems. The total entropy Stot(UA)=SA(UA)+SB(U−UA)S_{\text{tot}}(U_A) = S_A(U_A) + S_B(U - U_A) is a concave function of UAU_A with a single maximum. At the maximum the slope vanishes, which is exactly the condition ∂SA/∂UA=∂SB/∂UB\partial S_A/\partial U_A = \partial S_B/\partial U_B. For two identical systems the maximum sits at UA=U/2U_A = U/2.

U_A S S_A S_B S_tot (max) U_A* : ∂S_A/∂U_A = ∂S_B/∂U_B = 1/T

Negative temperature. For systems with an upper bound on energy (e.g., spin systems in a magnetic field), S(U)S(U) can decrease with UU, giving T<0T < 0. Such a system is hotter than any positive-temperature system: heat flows from T=−1T = -1 KtotoT = +\infty K$ to T = +1 K$.

Authoritative sources

Example problem

Two identical systems each have entropy S(U)=aUS(U) = a \sqrt{U} (with aa a constant). They are placed in thermal contact with total energy UU. Find the equilibrium energy of each system and the common temperature.

Solution

Maximize Stot=a(UA+U−UA)S_{\text{tot}} = a(\sqrt{U_A} + \sqrt{U - U_A}). Setting ∂Stot/∂UA=0\partial S_{\text{tot}}/\partial U_A = 0:

a2UA−a2U−UA=0  ⟹  UA=U−UA  ⟹  UA=UB=U2\frac{a}{2\sqrt{U_A}} - \frac{a}{2\sqrt{U - U_A}} = 0 \implies U_A = U - U_A \implies U_A = U_B = \frac{U}{2}

The common inverse temperature is:

1T=∂S∂U∣U/2=a2U/2=a2U\frac{1}{T} = \left.\frac{\partial S}{\partial U}\right|_{U/2} = \frac{a}{2\sqrt{U/2}} = \frac{a}{\sqrt{2U}}

so T=2U/aT = \sqrt{2U}/a. The energy splits equally because the two systems are identical and S(U)S(U) is concave.

From microstates to the partition function

The microcanonical entropy S=kBln⁡WS = k_B \ln W counts states in a thin energy shell [E,E+ΔE][E, E + \Delta E]. The density of states Ω(E)\Omega(E) is the number of states per unit energy, so W(E)≈Ω(E) ΔEW(E) \approx \Omega(E)\,\Delta E. The canonical partition function is the Laplace transform of this density:

Z(T,V,N)=∫0∞Ω(E) e−βE dEZ(T,V,N) = \int_0^{\infty} \Omega(E)\, e^{-\beta E}\, dE

For a discrete spectrum this reduces to the sum over individual levels.

Details

Step 1 — from a shell to a density. The microcanonical count W(E)=Ω(E) ΔEW(E) = \Omega(E)\,\Delta E is only meaningful for a thin shell. The density of states Ω(E)\Omega(E) strips off the arbitrary shell width ΔE\Delta E and gives the number of states per unit energy. For a system with a discrete spectrum, Ω(E)\Omega(E) is a comb of delta peaks at each level; for a macroscopic system the levels are so dense that Ω(E)\Omega(E) is a smooth function.

Step 2 — why a Laplace transform. The canonical ensemble weights each energy by the Boltzmann factor e−βEe^{-\beta E} (derived in CanonicalEnsemble). Summing (integrating) the weighted density of states over all energies gives the partition function:

Z=∫0∞Ω(E) e−βE dEZ = \int_0^{\infty} \Omega(E)\, e^{-\beta E}\, dE

This is exactly the Laplace transform of Ω(E)\Omega(E) with transform variable β\beta. The Laplace transform is the tool that connects the two ensembles: the microcanonical ensemble is characterized by Ω(E)\Omega(E) (a function of energy), and the canonical ensemble by Z(β)Z(\beta) (a function of inverse temperature). The transform is invertible, so no information is lost — the two descriptions are equivalent.

Step 3 — where the integral is dominated. The integrand Ω(E) e−βE\Omega(E)\, e^{-\beta E} is a product of a growing function (Ω(E)\Omega(E), more states at higher energy) and a decaying function (e−βEe^{-\beta E}, Boltzmann suppression). The product is a peaked function, and the peak location E∗E^* is the mean energy ⟨E⟩\langle E \rangle. At low temperature (β\beta large) the peak sits near the ground state; at high temperature (β\beta small) it moves to higher energy.

E Ω(E)·e^(−βE) peak = ⟨E⟩ Z = area

Worked example (single 3D harmonic oscillator). The energy levels are En=ℏω(n+12)E_n = \hbar\omega(n + \tfrac{1}{2}), so the density of states is a comb of delta peaks. The partition function is a geometric series:

Z=∑n=0∞e−βℏω(n+1/2)=e−βℏω/21−e−βℏωZ = \sum_{n=0}^{\infty} e^{-\beta \hbar\omega(n+1/2)} = \frac{e^{-\beta\hbar\omega/2}}{1 - e^{-\beta\hbar\omega}}

At high temperature (βℏω≪1\beta\hbar\omega \ll 1), Z≈1/(βℏω)Z \approx 1/(\beta\hbar\omega), and the mean energy ⟨E⟩=−∂ln⁡Z/∂β≈kBT\langle E \rangle = -\partial \ln Z/\partial \beta \approx k_B T — the classical equipartition result. The full treatment, including the free energy and entropy, is in CanonicalEnsemble.

Authoritative sources

Example problem

A system has a continuous density of states Ω(E)=c E\Omega(E) = c\, E (linear in energy, c>0c > 0). (a) Write the partition function as an integral. (b) Evaluate it and find the mean energy ⟨E⟩\langle E \rangle.

Solution

(a) Z=∫0∞c E e−βE dEZ = \int_0^{\infty} c\, E\, e^{-\beta E}\, dE.

(b) Using ∫0∞E e−βE dE=1/β2\int_0^{\infty} E\, e^{-\beta E}\, dE = 1/\beta^2:

Z=cβ2,⟨E⟩=−∂ln⁡Z∂β=−∂∂β(ln⁡c−2ln⁡β)=2β=2kBTZ = \frac{c}{\beta^2}, \qquad \langle E \rangle = -\frac{\partial \ln Z}{\partial \beta} = -\frac{\partial}{\partial \beta}(\ln c - 2\ln\beta) = \frac{2}{\beta} = 2 k_B T

The linear density of states Ω(E)∝E\Omega(E) \propto E is that of a 2D harmonic oscillator, whose two oscillators each contribute kBTk_B T (kinetic + potential) at high temperature, giving ⟨E⟩=2kBT\langle E \rangle = 2 k_B T — consistent with the result above.

Canonical partition function

For a system in contact with a heat bath at temperature TT (canonical ensemble):

Z(T,V,N)=∑ie−βEi,β=1kBTZ(T,V,N) = \sum_i e^{-\beta E_i}, \quad \beta = \frac{1}{k_B T}

All thermodynamic quantities follow from ZZ:

F=−kBTln⁡ZS=−(∂F∂T)V,NU=−∂ln⁡Z∂βP=kBT(∂ln⁡Z∂V)T,NF = -k_B T \ln Z S = -\left(\frac{\partial F}{\partial T}\right)_{V,N} U = -\frac{\partial \ln Z}{\partial \beta} P = k_B T \left(\frac{\partial \ln Z}{\partial V}\right)_{T,N}

The Helmholtz free energy FF is the thermodynamic potential natural to the canonical ensemble; its role in equilibrium and stability is developed in Thermodynamic Potentials and Equilibrium.

Why ZZ works — the simplest non-trivial case. The two-level system (levels E0=0E_0 = 0, E1=εE_1 = \varepsilon) is the minimal example that shows the machinery. Its partition function is Z=1+e−βεZ = 1 + e^{-\beta\varepsilon}. At low temperature the ground state dominates (Z→1Z \to 1, ⟨E⟩→0\langle E \rangle \to 0); at high temperature both levels are equally populated (Z→2Z \to 2, ⟨E⟩→ε/2\langle E \rangle \to \varepsilon/2). The heat capacity C=∂⟨E⟩/∂TC = \partial \langle E \rangle/\partial T vanishes at both extremes and peaks in between — the Schottky anomaly. The interactive simulation below lets you sweep the temperature and watch the populations, mean energy, and heat capacity respond.

Details

Ideal gas (key result). For NN non-interacting, indistinguishable particles in volume VV:

ZN=1N![VλT3]N,λT=h2πmkBTZ_N = \frac{1}{N!}\left[\frac{V}{\lambda_T^3}\right]^N, \quad \lambda_T = \frac{h}{\sqrt{2\pi m k_B T}}

where λT\lambda_T is the thermal de Broglie wavelength and the 1/N!1/N! (Gibbs factor) corrects for indistinguishability. From this single expression: PV=NkBTPV = Nk_B T (ideal gas law), U=32NkBTU = \tfrac{3}{2}Nk_B T (monatomic), CV=32NkBC_V = \tfrac{3}{2}Nk_B.

Quantum correction. When nλT3≳1n\lambda_T^3 \gtrsim 1 (high density or low temperature), quantum statistics (Fermi–Dirac or Bose–Einstein) replace the classical Boltzmann factor.

The full ensemble formalism — the Boltzmann-factor derivation from a reservoir, additivity of partition functions, pressure, and the density-matrix formulation — is developed in CanonicalEnsemble.

Authoritative sources

Fluctuations

In the canonical ensemble, energy fluctuates around its mean:

⟨(ΔU)2⟩=kBT2CV\langle (\Delta U)^2 \rangle = k_B T^2 C_V

For a macroscopic system (N∼1023N \sim 10^{23}), the relative fluctuation is:

⟨(ΔU)2⟩⟨U⟩∼1N≈10−12\frac{\sqrt{\langle(\Delta U)^2\rangle}}{\langle U \rangle} \sim \frac{1}{\sqrt{N}} \approx 10^{-12}
Details

Why thermodynamics works. The energy distribution P(E)=Ω(E)e−βE/ZP(E) = \Omega(E)e^{-\beta E}/Z is a narrow peak around ⟨E⟩\langle E \rangle with width σE=kBT2CV\sigma_E = \sqrt{k_B T^2 C_V}. In the thermodynamic limit (N→∞N \to \infty, V→∞V \to \infty, N/VN/V fixed), the relative width σE/⟨E⟩∼1/N→0\sigma_E/\langle E \rangle \sim 1/\sqrt{N} \to 0, so the peak becomes a delta function. This justifies treating U,S,TU, S, T as sharp, deterministic quantities: the first and second laws are not violated, they are the overwhelmingly probable behavior.

E P(E) ⟨E⟩ −σ +σ σ = √(k_B T² C_V), σ/⟨E⟩ ~ 1/√N

Small systems. For nanoparticles, molecular motors, or single-molecule experiments (N∼102N \sim 10^2–10610^6), the relative fluctuations are significant. The fluctuation-dissipation theorem and Jarzynski equality (⟨e−βW⟩=e−βΔF\langle e^{-\beta W} \rangle = e^{-\beta \Delta F}) replace the deterministic second law with statistical inequalities. These are treated in Nonequilibrium statistical mechanics.

The full derivation of the energy variance, and the related pressure and volume fluctuations (including critical opalescence), are in CanonicalEnsemble.

Authoritative sources

Third law from statistics

For a system with a non-degenerate ground state, the entropy vanishes as the temperature approaches absolute zero:

T→0  ⟹  W→1  ⟹  S=kBln⁡1=0T \to 0 \implies W \to 1 \implies S = k_B \ln 1 = 0
Details

Statistical statement of the third law. In the canonical ensemble, the probability of a state of energy EE is e−βE/Ze^{-\beta E}/Z. As T→0T \to 0 (β→∞\beta \to \infty), the Boltzmann factor e−βEe^{-\beta E} suppresses every state except the ground state. If the ground state is unique (non-degenerate, g0=1g_0 = 1), then Z→1Z \to 1 and the system is certainly in that one state: W→1W \to 1, so S=kBln⁡W→0S = k_B \ln W \to 0.

Role of ground-state degeneracy. If the ground state is g0g_0-fold degenerate, then Z→g0Z \to g_0 and S→kBln⁡g0≠0S \to k_B \ln g_0 \neq 0. The residual entropy S0=kBln⁡g0S_0 = k_B \ln g_0 is the statistical content of the third law’s “perfect crystal” caveat: a perfectly ordered crystal has a unique ground state (g0=1g_0 = 1), while a disordered solid (e.g., ice, with many equivalent proton arrangements) retains a finite residual entropy. This connects to the thermodynamic statement in Second Law and Entropy.

Connection to the heat capacity. The third law is consistent with the low-temperature behavior of the heat capacity: for a non-degenerate system, C→0C \to 0 as T→0T \to 0 (as seen in the two-level Schottky anomaly and the harmonic oscillator), so no entropy is “left behind” at zero temperature. For the two-level system, at kBT=εk_B T = \varepsilon (βε=1\beta\varepsilon = 1), S/kB=ln⁡(1+e−1)+1/(e+1)≈0.582S/k_B = \ln(1+e^{-1}) + 1/(e+1) \approx 0.582 — already well below the high-temperature limit kBln⁡2≈0.693 kBk_B \ln 2 \approx 0.693\, k_B.

k_B T/ε S/k_B ln 2 S → 0 as T → 0

Authoritative sources

Example problem

A system has a non-degenerate ground state at E0=0E_0 = 0 and a single excited state at E1=εE_1 = \varepsilon. (a) Find S(T)S(T) in the canonical ensemble. (b) Show that S→0S \to 0 as T→0T \to 0 and S→kBln⁡2S \to k_B \ln 2 as T→∞T \to \infty.

Solution

(a) With Z=1+e−βεZ = 1 + e^{-\beta\varepsilon}:

S=kB(ln⁡Z+β⟨E⟩)=kB[ln⁡(1+e−βε)+βεeβε+1]S = k_B\left(\ln Z + \beta\langle E \rangle\right) = k_B\left[\ln(1+e^{-\beta\varepsilon}) + \frac{\beta\varepsilon}{e^{\beta\varepsilon}+1}\right]

(b) As T→0T \to 0 (βε→∞\beta\varepsilon \to \infty): e−βε→0e^{-\beta\varepsilon} \to 0, so ln⁡(1+e−βε)→0\ln(1+e^{-\beta\varepsilon}) \to 0 and βε/(eβε+1)→0\beta\varepsilon/(e^{\beta\varepsilon}+1) \to 0, giving S→0S \to 0. As T→∞T \to \infty (βε→0\beta\varepsilon \to 0): ln⁡(1+e−βε)→ln⁡2\ln(1+e^{-\beta\varepsilon}) \to \ln 2 and βε/(eβε+1)→0\beta\varepsilon/(e^{\beta\varepsilon}+1) \to 0, giving S→kBln⁡2S \to k_B \ln 2. The low-temperature limit S→0S \to 0 is the statistical third law for this non-degenerate two-level system.

Quizz

Quizz

A three-dimensional harmonic oscillator has energy levels Enxnynz=ℏω(nx+ny+nz+32)E_{n_x n_y n_z} = \hbar\omega\left(n_x + n_y + n_z + \tfrac{3}{2}\right), ni=0,1,2,…n_i = 0, 1, 2, \ldots. It is in contact with a heat bath at temperature TT.

(a) Write the partition function ZZ as a product of three identical 1D sums and evaluate it. (b) Find the mean energy ⟨E⟩\langle E \rangle. (c) Find the heat capacity CVC_V and show that CV→3kBC_V \to 3 k_B as T→∞T \to \infty and CV→0C_V \to 0 as T→0T \to 0.

Solution

(a) The 3D partition function factorizes into three independent 1D oscillators:

Z=(∑n=0∞e−βℏω(n+1/2))3=(e−βℏω/21−e−βℏω)3Z = \left(\sum_{n=0}^{\infty} e^{-\beta\hbar\omega(n+1/2)}\right)^3 = \left(\frac{e^{-\beta\hbar\omega/2}}{1 - e^{-\beta\hbar\omega}}\right)^3

(b) The mean energy is three times the 1D result:

⟨E⟩=3(ℏω2+ℏωeβℏω−1)\langle E \rangle = 3\left(\frac{\hbar\omega}{2} + \frac{\hbar\omega}{e^{\beta\hbar\omega}-1}\right)

(c) The heat capacity is:

CV=3kB(βℏω)2eβℏω(eβℏω−1)2C_V = 3 k_B (\beta\hbar\omega)^2 \frac{e^{\beta\hbar\omega}}{(e^{\beta\hbar\omega}-1)^2}
  • High temperature (βℏω≪1\beta\hbar\omega \ll 1): expand eβℏω≈1+βℏωe^{\beta\hbar\omega} \approx 1 + \beta\hbar\omega, so CV≈3kB(βℏω)2/(βℏω)2=3kBC_V \approx 3 k_B (\beta\hbar\omega)^2/(\beta\hbar\omega)^2 = 3 k_B. This is the classical equipartition result: three oscillators, each with a kinetic and a potential quadratic term, contribute 3×kB=3kB3 \times k_B = 3 k_B.
  • Low temperature (βℏω≫1\beta\hbar\omega \gg 1): eβℏω≫1e^{\beta\hbar\omega} \gg 1, so CV≈3kB(βℏω)2e−βℏω→0C_V \approx 3 k_B (\beta\hbar\omega)^2 e^{-\beta\hbar\omega} \to 0. The oscillator is frozen in its ground state, consistent with the statistical third law.