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 accessible microstates (all equally probable in the microcanonical ensemble):
Details
Why the logarithm? Entropy must be extensive: if you combine two independent systems A and B, the total number of microstates is (product, by the multiplication rule). Extensivity requires . The only function satisfying is (up to a constant).
Concrete combinatorial example: coins. Toss fair coins. A macrostate is specified by the number of heads (from to ); a microstate is a specific sequence of heads and tails. The number of microstates for a given is the binomial coefficient:
For , the macrostate (five heads) has microstates, while or has only . The total number of microstates is . The most probable macrostate is overwhelmingly the one with , and its multiplicity grows as — exponentially in . Taking the logarithm, , converts this exponential growth into a quantity that is linear in (extensive): for large .
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 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:
For a quantum system: where is the density matrix. The two forms agree when all : . 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 fair coins. (a) How many microstates correspond to the macrostate heads? (b) What is the entropy of that macrostate in units of ? (c) Show that is approximately extensive, i.e., proportional to .
Solution
(a) .
(b) .
(c) The maximum multiplicity scales as , so . For : , matching (b). The leading term is linear in , confirming extensivity.
Temperature from statistics §
In the microcanonical ensemble, temperature is defined by:
Details
Derivation. Consider two systems A and B in thermal contact, with total energy fixed. The most probable energy division maximizes :
This gives , i.e., the two systems have the same value of . This is the statistical derivation of the zeroth law: thermal equilibrium equalizes temperature.
Reading the slope. The slope of the curve at any energy is the inverse temperature. Because is concave (its slope decreases as grows), a system with more energy has a lower temperature. For a concrete model, take (in units of ): at , , so . Energy flows from the steeper-slope (hotter) system to the flatter-slope (cooler) one until the slopes match.
Equilibrium of two systems. The total entropy is a concave function of with a single maximum. At the maximum the slope vanishes, which is exactly the condition . For two identical systems the maximum sits at .
Negative temperature. For systems with an upper bound on energy (e.g., spin systems in a magnetic field), can decrease with , giving . Such a system is hotter than any positive-temperature system: heat flows from KT = +\infty K$ to T = +1 K$.
Authoritative sources
Example problem
Two identical systems each have entropy (with a constant). They are placed in thermal contact with total energy . Find the equilibrium energy of each system and the common temperature.
Solution
Maximize . Setting :
The common inverse temperature is:
so . The energy splits equally because the two systems are identical and is concave.
From microstates to the partition function §
The microcanonical entropy counts states in a thin energy shell . The density of states is the number of states per unit energy, so . The canonical partition function is the Laplace transform of this density:
For a discrete spectrum this reduces to the sum over individual levels.
Details
Step 1 — from a shell to a density. The microcanonical count is only meaningful for a thin shell. The density of states strips off the arbitrary shell width and gives the number of states per unit energy. For a system with a discrete spectrum, is a comb of delta peaks at each level; for a macroscopic system the levels are so dense that is a smooth function.
Step 2 — why a Laplace transform. The canonical ensemble weights each energy by the Boltzmann factor (derived in CanonicalEnsemble). Summing (integrating) the weighted density of states over all energies gives the partition function:
This is exactly the Laplace transform of with transform variable . The Laplace transform is the tool that connects the two ensembles: the microcanonical ensemble is characterized by (a function of energy), and the canonical ensemble by (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 is a product of a growing function (, more states at higher energy) and a decaying function (, Boltzmann suppression). The product is a peaked function, and the peak location is the mean energy . At low temperature ( large) the peak sits near the ground state; at high temperature ( small) it moves to higher energy.
Worked example (single 3D harmonic oscillator). The energy levels are , so the density of states is a comb of delta peaks. The partition function is a geometric series:
At high temperature (), , and the mean energy — 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 (linear in energy, ). (a) Write the partition function as an integral. (b) Evaluate it and find the mean energy .
Solution
(a) .
(b) Using :
The linear density of states is that of a 2D harmonic oscillator, whose two oscillators each contribute (kinetic + potential) at high temperature, giving — consistent with the result above.
Canonical partition function §
For a system in contact with a heat bath at temperature (canonical ensemble):
All thermodynamic quantities follow from :
The Helmholtz free energy is the thermodynamic potential natural to the canonical ensemble; its role in equilibrium and stability is developed in Thermodynamic Potentials and Equilibrium.
Why works — the simplest non-trivial case. The two-level system (levels , ) is the minimal example that shows the machinery. Its partition function is . At low temperature the ground state dominates (, ); at high temperature both levels are equally populated (, ). The heat capacity 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 non-interacting, indistinguishable particles in volume :
where is the thermal de Broglie wavelength and the (Gibbs factor) corrects for indistinguishability. From this single expression: (ideal gas law), (monatomic), .
Quantum correction. When (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:
For a macroscopic system (), the relative fluctuation is:
Details
Why thermodynamics works. The energy distribution is a narrow peak around with width . In the thermodynamic limit (, , fixed), the relative width , so the peak becomes a delta function. This justifies treating as sharp, deterministic quantities: the first and second laws are not violated, they are the overwhelmingly probable behavior.
Small systems. For nanoparticles, molecular motors, or single-molecule experiments (–), the relative fluctuations are significant. The fluctuation-dissipation theorem and Jarzynski equality () 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:
Details
Statistical statement of the third law. In the canonical ensemble, the probability of a state of energy is . As (), the Boltzmann factor suppresses every state except the ground state. If the ground state is unique (non-degenerate, ), then and the system is certainly in that one state: , so .
Role of ground-state degeneracy. If the ground state is -fold degenerate, then and . The residual entropy is the statistical content of the third law’s “perfect crystal” caveat: a perfectly ordered crystal has a unique ground state (), 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, as (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 (), — already well below the high-temperature limit .
Authoritative sources
Example problem
A system has a non-degenerate ground state at and a single excited state at . (a) Find in the canonical ensemble. (b) Show that as and as .
Solution
(a) With :
(b) As (): , so and , giving . As (): and , giving . The low-temperature limit is the statistical third law for this non-degenerate two-level system.
Quizz §
Quizz
A three-dimensional harmonic oscillator has energy levels , . It is in contact with a heat bath at temperature .
(a) Write the partition function as a product of three identical 1D sums and evaluate it. (b) Find the mean energy . (c) Find the heat capacity and show that as and as .
Solution
(a) The 3D partition function factorizes into three independent 1D oscillators:
(b) The mean energy is three times the 1D result:
(c) The heat capacity is:
- High temperature (): expand , so . This is the classical equipartition result: three oscillators, each with a kinetic and a potential quadratic term, contribute .
- Low temperature (): , so . The oscillator is frozen in its ground state, consistent with the statistical third law.