Energy Fluctuations in the Canonical Ensemble
Fix a bottle of gas in contact with a thermostat and its temperature is pinned, but its energy is not. Energy leaks back and forth across the wall to the reservoir, so at any instant the system holds a little more or a little less than its average. The natural object is therefore not a single number but a whole distribution — and the width of that distribution turns out to be one of the most consequential quantities in statistical mechanics. The central result is : the variance of the spontaneous energy fluctuations equals the heat capacity, up to a factor of . On the left is a purely statistical quantity — how much the energy jitters. On the right is a thermodynamic response you can measure with a calorimeter — how much heat the system soaks up per degree. That a silent, spontaneous fluctuation should equal a driven, measurable response is the first and cleanest instance of a fluctuation–response relation, an idea that reappears everywhere from electrical Johnson noise to Brownian motion to critical opalescence. The whole structure is hiding inside a single function. Treating as a cumulant-generating function in the variable , the first -derivative gives (minus) the mean energy and the second gives the variance — so the fluctuation formula is a two-line consequence of differentiating twice. This article proves that owned result, then reads off its payoffs: because and are both extensive, the relative fluctuation shrinks as and the energy becomes effectively sharp for macroscopic matter (why the canonical and microcanonical ensembles agree); positivity of a variance forces (thermodynamic stability from statistics); and a diverging means macroscopic energy fluctuations — the fingerprint of a phase transition. Every number here is python-verified.
- In the canonical ensemble the system exchanges energy with a heat bath at fixed , so is not fixed — it fluctuates about with a variance .
- That variance is governed exactly by the heat capacity: — the paradigmatic fluctuation–response relation.
- Both and are derivatives of in : mean from the first, variance from the second (a cumulant-generating structure).
- The relative energy fluctuation scales as for an extensive system, so the energy becomes sharply defined per particle in the thermodynamic limit and the canonical and microcanonical ensembles become equivalent.
- A diverging means macroscopic energy fluctuations — the hallmark of a continuous phase transition; positivity of the variance forces (stability).
- Key idea: differentiating twice in generates the energy cumulants — and : statistical variance equals thermal response.
Differentiating with respect to generates the energy cumulants: and . Thus the heat capacity is directly proportional to the equilibrium energy variance. The variance of the spontaneous energy fluctuations is the heat capacity — one identity read two ways: statistical fluctuation on the left, thermodynamic response on the right.
Where this lives today
Energy fluctuations are the everyday workhorse of computational statistical mechanics. In Monte Carlo and molecular-dynamics simulations one almost never measures the heat capacity by numerically differentiating with respect to — that requires two noisy runs and a fragile subtraction. Instead one measures from a single run by sampling the energy variance, , which is statistically far cleaner and needs no finite-difference. The same trick finds phase transitions: a sharp peak (a would-be divergence, rounded by finite size) in the sampled energy variance flags a critical temperature, and finite-size scaling of that peak extracts critical exponents. Every modern lattice-model and biomolecular simulation uses this fluctuation estimator. The relation is also the ancestor of a whole family of noise formulas that engineers cannot ignore. The Johnson–Nyquist thermal noise of a resistor, the temperature noise floor of a cryogenic bolometer or a superconducting single-photon detector, and the irreducible energy resolution of a calorimeter are all set by fluctuation–dissipation identities of exactly this shape — the mean-square fluctuation of a variable equals times a susceptibility. When astronomers push X-ray microcalorimeters to resolve individual photon energies, or when quantum-computing groups fight the thermal noise of a qubit's environment, they are budgeting against . Einstein's 1904 insight — that a spontaneous fluctuation is a measurable, quantitative thing — remains, more than a century later, the design constraint on the most sensitive detectors ever built.
The physical picture
Picture the system as a sponge dipped in a vast thermal ocean. Energy sloshes in and out across the contact, and the question is: how big are the slosh events? If the system can absorb a large amount of energy for a small temperature change, corresponding to a large , then the canonical ensemble also predicts larger equilibrium energy fluctuations through . A "stiff" system with few available modes (small ) barely fluctuates; a "soft" system near a transition fluctuates wildly. The heat capacity literally measures how easily the energy is jostled, so it is no accident that it also sets the fluctuation width.
Think of as a cumulant-generating function: differentiating with respect to successively produces the mean energy, the energy variance, and higher energy cumulants such as the skewness. This is precisely a cumulant-generating function in probability, with as the source variable. The thermodynamics you measure is nothing but the low-order cumulants of an underlying microscopic probability distribution over energy. The key thermodynamic result is therefore the law for relative energy fluctuations. For weakly correlated subsystems the energies add, so the mean energy is extensive and grows as ; the independent variances also add, so the standard deviation grows only like . The ratio . The plot below shows the same energy distribution for growing : it does not stop fluctuating, but relative to its mean it collapses to a needle. This is the law of large numbers wearing thermodynamic clothes, and it is exactly why a single sharp internal energy emerges from a jittering microscopic world.
The core equations
In the canonical ensemble each microstate carries the Boltzmann weight, and the partition function normalizes them. Everything downstream is a derivative of this one object. The starting point:
where: — probability of microstate ; — its energy; — inverse temperature; — canonical partition function. The mean energy is the weighted average ; the whole article is about the spread around it. The mean energy is the first -derivative of — differentiating brings a factor down inside the sum, and dividing by makes it an average:
where: — ensemble-average (internal) energy, also written . Read it as: cooling the system (raising ) lowers the mean energy, and the rate at which it does so is the next quantity we need. The variance of the energy is the second -derivative of — this is the article's owned structural result, the statement that is a cumulant generator:
where: — the instantaneous fluctuation; — second moment. The two forms are equal because the second log-derivative is (second moment) minus (first moment squared) — exactly a variance. It is manifestly non-negative, a fact we will cash in below. Converting the -derivative to a temperature-derivative turns the statistical variance into a thermodynamic response, the fluctuation–response relation:
where: — heat capacity at constant volume and particle number; — Boltzmann constant. The factor is not decoration — it comes from the chain rule and must never be dropped. Because the left side is a variance (), the relation forces . For an ordinary macroscopic system with short-range interactions, . Hence , while , so the relative fluctuation vanishes as :
where: — RMS energy fluctuation; — number of particles or degrees of freedom. For this ratio is : microscopically the energy never stops fluctuating, macroscopically it is a fixed number. The generating-function viewpoint makes the pattern explicit: every cumulant of the energy is a derivative of in the source variable :
where: — -th cumulant of the energy distribution. The mean () and variance () are just the first two members; the third measures skewness, which is why the near-Gaussian shape of is itself a consequence of the extensivity of .
This is the article's owned structural result, and it deserves a careful proof because the sign chain is where students lose marks. The goal is to show that the same object that generates the mean energy also generates its variance as the next derivative, and that this variance equals the measurable heat capacity with the correct positive sign. The strategy is to differentiate twice with respect to , recognize the result as a variance (the second cumulant), rewrite it as minus the -derivative of the mean, and then carry the derivative from inverse temperature to temperature using — tracking both minus signs so they cancel.
Step 1. Differentiate once. . Why: the derivative pulls a factor into each term; the extra minus makes it , and division by turns the weighted sum into the ensemble average.
Step 2. Differentiate again, using the quotient rule on . . Why: the double derivative of delivers , and the square of the first log-derivative delivers ; their difference is exactly the variance — the second cumulant.
Step 3. Rewrite the variance as a derivative of the mean. Since , we have . Why: the variance is minus the rate at which the mean energy changes with inverse temperature — a response of the mean disguised as a fluctuation.
Step 4. Change variable from to . With , the chain rule gives (the derivative is negative). Why: this is the single step where the factor enters; forgetting it, or dropping the minus sign, is the classic error that wrecks the dimensions.
Step 5. Combine. . The two minus signs cancel and completes the relation. Why: the variance is necessarily non-negative, and . Therefore an ordinary canonical ensemble satisfies . Thus canonical statistical mechanics directly encodes the corresponding stability condition. *On the two-level system, holds identically (confirmed symbolically), the chain-rule sign is correct, and the trap "variance " (dropping ) is false.*
Go deeper · Derivation B · 1 minWhy the energy is sharp: a monatomic ideal gas has relative fluctuation
The goal here is to turn the abstract scaling into a concrete, checkable number for the monatomic ideal gas, and to see why the canonical ensemble (with its fluctuating energy) reproduces the microcanonical ensemble (with its fixed energy) for any macroscopic sample. The strategy is to feed the equipartition values of and into the fluctuation relation, take the square root for , and form the ratio — watching the 's to see the suppression appear.
Step 1. Mean energy from equipartition. A monatomic atom has three quadratic translational degrees of freedom, each contributing , so . Why: equipartition gives per quadratic degree of freedom, and the three momentum components contribute three such terms for each particle.
Step 2. Heat capacity. , independent of temperature for the classical gas. Why: is linear in , so its temperature-derivative is a constant — the flat classical heat capacity.
Step 3. Variance. Insert into the fluctuation relation: , so . Why: the variance is proportional to , so the absolute RMS fluctuation grows as . The fluctuations therefore do not disappear; only their size relative to the extensive mean energy decreases.
Step 4. Form the ratio. . For this is ; for it is , an single-particle fluctuation. Why: the mean grows as but the spread only as , so the relative width collapses as — the microscopic canonical energy is indistinguishable from the fixed microcanonical energy once is macroscopic, which is the whole justification for ensemble equivalence. *These results hold symbolically: and ; numerically the ratio equals at and at .*
Limiting cases
How the fluctuation relation behaves in the regimes that matter:
| Case | Result | Meaning |
|---|---|---|
| Macroscopic limit | Relative fluctuations vanish; canonical and microcanonical ensembles agree; is effectively sharp. | |
| Classical ideal gas | With gives — the textbook check. | |
| Near a critical point | Energy fluctuations become anomalously large and critical correlations can make non-Gaussian near a continuous phase transition. | |
| Stability bound | Variance positivity forces non-negative heat capacity — stability from statistics. | |
| Low- quantum limit | Third law: the system freezes into its ground state and energy fluctuations are quenched. |
Worked examples
1 · The energy jitter of a mole of gas (a real number)
One mole of a monatomic ideal gas (argon, helium — the species does not matter) sits in a thermostat at . Compute its internal energy , the RMS energy fluctuation in joules, and the relative fluctuation . Is the energy "sharp"?
Step 1. Enumerate the inputs: , , .
Step 2. Internal energy. .
Step 3. Heat capacity and variance. ; the variance is , so .
Step 4. The boundary number. The relative fluctuation is , which matches exactly. So the energy of a mole of gas fluctuates by only about four nanojoules — one part in of its total. The energy is sharp to twelve decimal places; this is precisely why we can speak of "the" internal energy of a macroscopic system and why the canonical and microcanonical ensembles give identical thermodynamics.
2 · A two-level paramagnet: fluctuations of a finite-gap system (exam level)
non-interacting two-level systems (a paramagnetic salt) each have a ground state at and an excited state at . At the temperature where (i.e. ), find the per-system energy variance, the total RMS fluctuation, and the relative fluctuation. Compare its size to Example 1.
Step 1. Per-system variance from the closed form. For a two-level system, . At with : .
Step 2. Total variance and RMS. Independent systems add variances: , so .
Step 3. Mean energy and ratio. Each system has , so and .
Step 4. The boundary check. The closed form of the ratio is at — the law again, with an prefactor set by the spectrum. It is larger than Example 1's only because is a thousand times smaller ( vs ); the relative fluctuation is still utterly negligible. Change the level gap or the temperature and the prefactor moves, but the suppression is universal — the reason any macroscopic system has a well-defined energy.
Origins · 1 minalbert einstein and how this was discovered
Between 1902 and 1904 Albert Einstein, working alone and largely unaware of Gibbs's contemporaneous Elementary Principles (1902), rebuilt the foundations of statistical mechanics in three Annalen der Physik papers. In the third, published in 1904, he derived the mean-square energy fluctuation of a system in thermal contact with a reservoir and obtained exactly the relation of this article, (he wrote it as ). For Einstein this was not a technical footnote but a weapon: fluctuations are observable consequences of the atomic hypothesis, a way to make molecules leave fingerprints on macroscopic measurements. He turned the same idea loose on radiation and on suspended particles — the 1905 theory of Brownian motion computes the fluctuations of a colloidal grain and predicts a measurable mean-square displacement, later confirmed by Perrin and used to pin down Avogadro's number. In 1910, with Smoluchowski, he applied density fluctuations to explain critical opalescence, the milky scattering of light near a liquid–gas critical point where the compressibility (and hence the fluctuations) diverge. The through-line of Einstein's statistical work is this article's thesis: a spontaneous fluctuation is not noise to be averaged away but a direct, quantitative window onto the microscopic world.
Going further
References. Pathria & Beale, Statistical Mechanics, 3rd ed., §3.6 (Energy fluctuations in the canonical ensemble) · Kardar, Statistical Physics of Particles, Ch. 4 · Reif, Fundamentals of Statistical and Thermal Physics, §6.5 · Sethna, Statistical Mechanics: Entropy, Order Parameters, and Complexity, Ch. 6 · Landau & Lifshitz, Statistical Physics Part 1, §112 · Einstein, Ann. Phys. 14 (1904) 354 (fluctuation theory). The two generating-function relations and follow by direct differentiation of ; the conversion uses . Key checkpoints: the two-level identity (symbolic); the ideal-gas results , , ; and the worked-example figures (, , for a mole at 300 K; for two-level systems at ). , (CODATA).
Builds on: Canonical Ensemble · Boltzmann Factor · Canonical Partition Function · Thermodynamic Quantities from the Partition Function. Leads to: Heat Capacity and Fluctuation-Response Relation · Grand Canonical Ensemble · Helmholtz Free Energy from the Partition Function.
Where exactly does the factor of k_BT² come from — I keep losing it?
It comes from one place and one place only: the change of variable from inverse temperature to temperature . The variance is naturally an object in , namely . But the heat capacity is defined as a -derivative, . To connect them you use the chain rule with , so , which means . Substituting gives . The two minus signs cancel. A quick way never to lose it: check units. A variance is ; is ; the only way to make into is to multiply by something with units , and has exactly those units (). If your answer's units don't come out as energy-squared, you dropped the factor.
The absolute fluctuation grows with N but the relative one shrinks — how can both be true?
Both are true and there is no contradiction — they are answering different questions. The absolute fluctuation is . Since the variance is extensive (, because independent subsystems add their variances), — it grows without bound as you add particles. The relative fluctuation is . Since the mean energy is also extensive (), the ratio is — it shrinks toward zero. So a bigger system jitters by a larger number of joules, but that jitter is a smaller and smaller fraction of its total energy. When we say "the energy of a macroscopic system is sharp," we mean the fraction is negligible ( for a mole), not that the absolute fluctuation is zero. This is the law of large numbers: sums of many independent variables have means that grow like and spreads that grow like .
Why does a diverging heat capacity signal a phase transition?
Through the fluctuation relation directly. If , then as well — the energy fluctuations, instead of being a tiny fraction of the mean, become macroscopic. Physically this means the system can no longer decide on an energy: it wanders over an extensive range, which is exactly what happens when two phases (say liquid and gas) coexist or when a system is poised at a critical point where correlations extend across the whole sample. At a continuous (second-order) transition typically diverges as a power law , and the near-Gaussian broadens and develops non-negligible higher cumulants (the skewness and beyond stop being small). At a first-order transition becomes bimodal — two peaks for the two coexisting phases with different energies. So the innocuous-looking equation is precisely the bridge that lets a calorimeter detect a phase transition, and lets a simulation locate by watching the energy variance spike.
Is ⟨(ΔE)²⟩ = k_BT²C_V exact, or only an approximation?
It is exact — no assumption of a Gaussian distribution, no thermodynamic limit required. It follows from just two things: the canonical probability and the definitions of mean and variance. Differentiating twice gives identically, and the chain rule gives identically. It holds for a single particle, a two-level system, or a strongly interacting fluid at a critical point — anywhere the canonical ensemble applies. What is approximate is the separate claim that is Gaussian: that shape (with width ) is the leading term of an expansion valid when higher cumulants are small, i.e. large away from criticality. Keep the two ideas distinct: the variance formula is exact, while the Gaussian shape of the energy distribution is the large- approximation.
How is this the “fluctuation–response” or “fluctuation–dissipation” relation people talk about?
Because it has the universal form of that whole family: a spontaneous fluctuation of a quantity equals times a susceptibility describing how that quantity responds to its conjugate field. Here the fluctuating quantity is the energy , the conjugate "field" is (inverse) temperature , and the susceptibility is the heat capacity. The same skeleton appears everywhere: magnetization fluctuations equal times the magnetic susceptibility (); density fluctuations equal times the compressibility; the current noise in a resistor equals times its conductance (Johnson–Nyquist noise); a Brownian particle's velocity fluctuations relate to its friction (the Einstein relation). All are instances of the fluctuation–dissipation theorem, and the energy–heat-capacity relation of this article is the simplest and historically first member — the one Einstein derived in 1904. It says the jitter of a system in equilibrium and its response to a perturbation are two faces of the same microscopic physics.
Does this formula still work in the grand canonical ensemble or with volume changes?
Not unchanged — you have to be careful about what is held fixed. The relation is derived for the canonical ensemble, where volume and particle number are fixed and only energy is exchanged with the bath; that is why the heat capacity is the constant-volume, constant-N one, . If the system can also exchange particles with a reservoir (the grand canonical ensemble), then fluctuates too, the energy fluctuations pick up an additional contribution correlated with the particle-number fluctuations, and the simple formula is replaced by a more elaborate one involving both and the number-fluctuation susceptibility. Likewise, if the volume is allowed to fluctuate (an isobaric ensemble), enthalpy rather than energy is the natural variable and replaces . The lesson is that each fluctuation formula is tied to a specific ensemble and a specific set of fixed variables; the canonical energy-variance relation is the cleanest because only one quantity (energy) fluctuates. The particle-number version is the subject of the companion article on grand-canonical fluctuations.