Welcome to the first lesson of our fourth module. In the previous module, we established the foundations of statistical mechanics within the microcanonical ensemble, where a system is completely isolated with fixed energy , volume , and particle number . We saw how this framework gives rise to statistical definitions of temperature, pressure, and chemical potential. While fundamentally important, the constraint of fixed energy and the task of calculating the number of microstates can be exceptionally challenging for many systems.
In this lesson, we shift our perspective to a more common and often more tractable physical situation: a system in thermal contact with a large heat reservoir. This setup fixes the system's temperature, not its energy, leading us to the canonical ensemble. Our primary goal is to derive the probability distribution for the microstates of such a system. This celebrated result, the Boltzmann distribution, is arguably the most important formula in statistical mechanics and will be the workhorse for much of our future study.
1. From Isolated Systems to Systems at Constant Temperature
The conceptual leap from the microcanonical to the canonical ensemble involves replacing the strict constraint of energy conservation for our system of interest with the condition of thermal equilibrium. We imagine our system, , is small compared to a very large heat reservoir, . They can exchange energy, but not particles or volume. The combined entity is an isolated system with a fixed total energy, .
Because energy can flow between and , the energy of our system, , is no longer fixed but can fluctuate. However, since the reservoir is vast, it imposes its temperature on the system. Our task is to determine the probability of finding the system in a particular microstate which has energy .

The key insight is to apply the fundamental postulate of equal a priori probabilities to the total isolated system . The probability of system being in microstate must be proportional to the number of microstates available to the reservoir, , when its energy is .
Since the reservoir is enormous, any energy taken by the system is a minuscule fraction of the total energy, i.e., . This allows for a decisive mathematical simplification. The following reading provides a crisp and direct derivation.
In his lecture notes on ensembles, Matthew Schwartz presents a very clear derivation of the Boltzmann distribution by considering a system coupled to a heat reservoir. This approach is standard and demonstrates the power of the canonical approach.
Please read Section 2, "Canonical ensemble," from the beginning of the section until the end of the derivation of the Boltzmann distribution (pages 2-3). As you read, focus on these steps: The initial setup, which establishes that the probability of the system being in microstate k is proportional to the number of states available to the reservoir. The Taylor expansion of the logarithm of the reservoir's state count, \ln \Omega_R. Note how the assumption E_k \ll E_{total} is crucial for truncating the series. The use of the microcanonical definition of temperature, \beta = \partial \ln \Omega / \partial E, which you are familiar with from the previous lesson. The final result, which shows that the probability is proportional to e^{-\beta E_k}. Notice how the properties of the reservoir (except for its temperature T) are absorbed into the normalization constant.
As the reading shows, this argument leads directly to the Boltzmann distribution:
where and is a normalization constant that ensures . This constant, called the canonical partition function, is defined as:
The sum is over all accessible microstates of the system. If multiple states have the same energy , we can group them using the degeneracy , writing the partition function as a sum over energy levels:
The term is known as the Boltzmann factor. It dictates that microstates with higher energy are exponentially less likely to be occupied at a given temperature.
2. An Alternative View: Maximizing Entropy
Your familiarity with the principle of maximum entropy (MaxEnt) from our first module provides another powerful route to this same result. This perspective, championed by E.T. Jaynes, views statistical mechanics as a form of statistical inference. We seek the probability distribution that is most unbiased, i.e., maximizes the Gibbs entropy , subject to what we know about the system.
In the canonical ensemble, we don't know the exact energy , but we know the system is in equilibrium with a bath at temperature . This fixes the average energy . The derivation thus becomes a constrained optimization problem: maximize subject to (normalization) and (fixed average energy).
The following resource carries out this derivation formally, framing it as finding the most probable distribution for a large number of identical systems.
The canonical and grand canonical distributions.
This lecture note by Anthony Leggett provides a rigorous derivation based on maximizing the entropy of a collection of subsystems, which is mathematically equivalent to the MaxEnt approach.
Begin by reading from the top of page 2 to the end of the page. This section derives the fundamental formula for the entropy of a distribution, S = -k_B \sum p_i \ln p_i, starting from counting the ways to arrange a large number of subsystems among different microstates. Continue on page 4, starting from the heading "Now let’s turn to the problem of determining..." and read until the end of the page. This is the core of the derivation. Pay close attention to how the method of Lagrange multipliers is used to maximize S subject to the two constraints (normalization and fixed average energy). Observe how this procedure naturally yields the exponential form p_j \propto e^{-\lambda E_j}. Finally, note the argument used to identify the Lagrange multiplier \lambda with \beta = 1/k_B T by examining the relationship ∂S/∂E = 1/T.
This alternative derivation highlights a profound point: the Boltzmann distribution is the least biased estimate of the probabilities of microstates, given a fixed average energy. The two derivations, one based on a physical model of a system and reservoir and the other on abstract statistical inference, lead to the identical, fundamental result.
The following video provides an excellent animated summary of the first derivation method.
Teach Yourself Statistical Mechanics In One Video | New & Improved
This video from the channel Physics Daemon offers a well-paced visual walkthrough of the derivation for a system in a heat bath.
Watch the segment from Derivation and Partition Function. This covers the same logical steps as our first reading from Schwartz: setting up the system and reservoir, Taylor expanding the logarithm of the number of reservoir states, identifying the temperature, and defining the partition function Z as the normalization constant.
3. Significance and What's Next
The canonical formalism is often more convenient than the microcanonical one for two primary reasons:
- Experimental Relevance: Most experiments are conducted at constant temperature and pressure, not constant energy. The canonical ensemble is a more natural description of such conditions.
- Mathematical Simplicity: The partition function involves an unconstrained sum over all microstates. In the microcanonical ensemble, we had to count states within a very narrow energy shell , which is a much harder combinatorial problem. As you've seen in your work with numerical simulations, summing over all states (even if weighted) is often more straightforward than enforcing a hard constraint.
We have now defined the canonical distribution and its central component, the partition function . But what is the physical meaning of , and how do we use it? The next lesson will answer this question comprehensively.
Conclusion
In this lesson, we have moved beyond the isolated systems of the microcanonical ensemble to describe systems in thermal equilibrium with their surroundings. This led us to one of the cornerstones of statistical physics.
Key Takeaways:
- A system in thermal contact with a heat reservoir at temperature is described by the canonical ensemble ( fixed). Its energy is not fixed and can fluctuate.
- The probability of finding the system in a microstate with energy is given by the Boltzmann distribution: .
- The Boltzmann factor, , shows that higher energy states are exponentially suppressed.
- The canonical partition function, , is the normalization constant. It is a sum over all possible microstates of the system, and as we will see, it contains all the information needed to calculate the system's thermodynamic properties.
In our next lesson, we will unlock the full power of the partition function by relating it to a thermodynamic potential: the Helmholtz free energy. This connection will provide the master equation from which we can derive all macroscopic observables, such as average energy, entropy, and pressure, for a system at constant temperature.