In Sections 20-10 and 20-14, we develop the relationship between the system entropy and the probabilities of a microstate, \(\rho \left({\epsilon }_i\right)\), and an energy level, \(P_i=g_i\rho \left({\epsilon }_i\right)\), in our microscopic model. We find
\[\begin{align*} S &=-Nk\sum^{\infty }_{i=1}{P_i}{ \ln \rho \left({\epsilon }_i\right)\ } \\[4pt] &=-Nk\sum^{\infty }_{i=1}{g_i\rho \left({\epsilon }_i\right)}{ \ln \rho \left({\epsilon }_i\right)\ } \end{align*} \]
For an isolated system at equilibrium, the entropy must be a maximum, and hence
\[-\sum^{\infty }_{i=1}{g_i\rho \left({\epsilon }_i\right)}{ \ln \rho \left({\epsilon }_i\right)} \label{maxentropy} \]
must be a maximum. We can use Lagrange’s method to find the dependence of the quantum-state probability on its energy. The \(\rho \left({\epsilon }_i\right)\) must be such as to maximize entropy (Equation \ref{maxentropy}) subject to the constraints
\[1=\sum^{\infty }_{i=1}{P_i}=\sum^{\infty }_{i=1}{g_i\rho \left({\epsilon }_i\right)} \nonumber \]
and
\[\left\langle \epsilon \right\rangle =\sum^{\infty }_{i=1}{P_i{\epsilon }_i}=\sum^{\infty }_{i=1}{g_i{\varepsilon }_i\rho \left({\epsilon }_i\right)} \nonumber \]
where \(\left\langle \epsilon \right\rangle\) is the expected value of the energy of one molecule. The mnemonic function becomes
\[F_{mn}=-\sum^{\infty }_{i=1}{g_i\rho \left({\epsilon }_i\right)}{ \ln \rho \left({\epsilon }_i\right)\ }+{\alpha }^*\left(1-\sum^{\infty }_{i=1}{g_i\rho \left({\epsilon }_i\right)}\right)+\beta \left(\left\langle \epsilon \right\rangle -\sum^{\infty }_{i=1}{g_i{\varepsilon }_i\rho \left({\epsilon }_i\right)}\right) \nonumber \]
Equating the partial derivative with respect to \(\rho \left({\epsilon }_i\right)\) to zero, \[\frac{\partial F_{mn}}{\partial \rho \left({\epsilon }_i\right)}=-g_i{ \ln \rho \left({\epsilon }_i\right)\ }-g_i-{\alpha }^*g_i-\beta g_i{\epsilon }_i=0 \nonumber \]
so that
\[\rho \left({\epsilon }_i\right)={\mathrm{exp} \left(-{\alpha }^*-1\right)\ }{\mathrm{exp} \left(-\beta {\epsilon }_i\right)\ } \nonumber \]
From
\[1=\sum^{\infty }_{i=1}{P_i}=\sum^{\infty }_{i=1}{g_i\rho \left({\epsilon }_i\right)} \nonumber \]
the argument we use in Section 21.1 again leads to the partition function, \(z\), and the Boltzmann equation
\[P_i=g_i\rho \left({\epsilon }_i\right)=z^{-1}g_i\ \mathrm{exp}\left(-\beta {\epsilon }_i\right) \nonumber \]