faheem.

Statistical Mechanics

The Partition Function

Write down one sum over states. Differentiate it enough times and every thermodynamic quantity falls out.

Updated July 2026

Put a system in contact with a large reservoir at temperature and ask how likely you are to find it in a particular microstate of energy . The answer, worked from counting the reservoir's states, is the Boltzmann factor with . Higher-energy states are less likely, and the temperature sets how steeply.

To turn a set of relative weights into probabilities you have to normalise them. The sum that does the normalising turns out to carry, on its own, everything thermodynamics wants to know about the system.

One sum

is the partition function. The name is a translation of the German Zustandssumme, sum over states, which says exactly what it is. It looks like a bookkeeping device, a denominator you carry around to keep the probabilities adding to one.

It is much more than that, because the energies depend on the volume, the field, the particle number, and depends on temperature through . Differentiating it therefore reaches every thermodynamic quantity at once.

Everything by differentiation

The mean energy is a derivative of in :

The bridge to thermodynamics is a single further identification, the Helmholtz free energy:

Definition

The bridge equation

Every equilibrium property follows by differentiating : entropy as , pressure as , and so on. The partition function is the point where the microscopic sum meets the classical potential of the last set of notes.

The variance of the energy is a second derivative, and it is not just a curiosity:

The size of the energy fluctuations is fixed by the heat capacity. A system that stores heat easily is one whose energy wanders, which is the fluctuation-dissipation idea in its simplest dress.

Independence makes it multiply

If a system splits into parts that do not interact, its energy is a sum and its partition function is a product:

Because is a logarithm of , the free energies then simply add, which is what lets you build a gas of non-interacting particles out of one-particle sums.

Consequence

The two-level system

For a single object with just two states, energies and , . The mean energy rises from zero at low temperature toward at high, and its derivative, the heat capacity, peaks at a temperature of order . That peak, the Schottky anomaly, is a real signature of a gap in a material's spectrum.

So the recipe for a system in the canonical ensemble is short. Write down its energies, sum the Boltzmann factors, take the log, and differentiate. The physics is in the first step; the rest is calculus.