Category:
$\newcommand{\pp}[2][]{\frac {\partial #1}{\partial #2}}$For a system in contact with heat bath, the energy is not well defined. The system being in a micro state with energy value \(E_k\) is given by Boltzmann distribution. We compute average energy and show that the average energy it in terms of the canonical partition function is given by \[ U = -k \pp[\ln Z]{\beta}.\] It is shown that for macroscopic systems the variance of energy is negligible compared to the energy, but not for microscopic systems. Hence \(\bar E\) can be identified with the thermodynamic internal energy.
Internal Energy
We will obtain an expression for the internal energy of a system in terms of the partition function. The average energy of a system in contact with a heat reservoir at temperature \(T\) is \begin{align*} U = \bar{E}=& \sum_k E_kP(E_k)=Z^{-1}\sum_{\text{micro states}\ k} E_k e^{-\beta E_k} \end{align*} where \(Z\) is the partition function \begin{equation}Z=\sum_ke^{-\beta E_k}\end{equation} Differentiating w.r.t. \(\beta\) gives \begin{align*} \frac{\partial Z}{\partial\beta} =& - \sum_k E_k e^{-\beta E_k}\\ \therefore \quad U=&-\frac{\partial}{\partial\beta} \log Z. \end{align*} where $\beta=$ depends on temperature and is independent of the system.
Variance of energy
When a system is in interaction with a thermal reservoir, its energy is not constant but changes continuously with time. Average value of $E$ is the thermodynamic internal energy $U$ and in terms of the partition function we have the expression
\[U=-Z^{-1}\frac{\partial Z}{\partial\beta}.\] Therefore we can now compute the variance in energy as follows.
\begin{align*} \text{var} (E) =& \overline{E^2}-\overline{E}^2\\ \bar{E}^2=&\frac{1}{Z}\sum E_k^2\exp(-\beta E_k)\\ =&\frac{1}{Z}\frac{\partial^2}{\partial\beta^2} \sum \exp(-\beta E_k) = Z^{-1} \frac{\partial^2}{\partial\beta^2} Z .\end{align*}
Therefore \begin{align*} {\rm var}(E)=&\bar{E}^2-(\bar{E})^2=Z^{-1}\frac{\partial^2Z}{\partial\beta^2}-\left( Z^{-1}\frac{\partial Z}{\partial \beta}\right)^2\\ =&\frac{\partial}{\partial\beta}\left(Z^{-1}\frac{\partial Z}{\partial\beta}\right) =-\frac{\partial U}{\partial\beta} \end{align*} We will now express the variance in terms of the specific heat \(C_v\). \begin{align*} {\rm var}(E) =& -\frac{\partial U}{\partial\beta}=-\frac{\partial U}{\partial T}\frac{\partial T}{\partial\beta}\\ = &kT^2\frac{\partial U}{\partial T}\biggr|_{V} =kT^2C_v. \end{align*} Thus we get the result that the dispersion in energy is given by \begin{align*} \boxed{\sigma(E) = (kT^2C_v)^{1/2}} \end{align*} For a perfect gas (mono atomic) \begin{align*} U=&\frac{3}{2}NkT\qquad C_V=\frac{3}{2}Nk\qquad k=1.38\times10^{-16}{\rm erg/deg} \end{align*} This gives the ratio of fluctuation of energy to the energy as \begin{align*} \frac{\sigma(E)}{\bar{E}} = &\frac{1}{(3N/2)^{1/2}}. \end{align*} For \(N=10^{18}\) we get \(\frac{\sigma(E)}{\bar{E}}\simeq 10^{-9}\). This shows that $E$ is likely to be found near $\bar{E}$ to a good accuracy. If $N$ is small, the standard deviation is not small, and probability that $E$ deviates from the average energy is not small. So for example, for \(N=10\) $$ \sigma(E)\simeq \frac{1}{4}\bar{E}. $$ For a system containing only a few atoms, the fluctuation in energy is as large as energy itself. Thus the average energy cannot represent the state of a system. The system must be macroscopic if average energy is to be a thermodynamic property.