# Why energy fluctuates in canonical ensemble?

Canonical ensemble describes system that is in thermal equilibrium with the bath of the constant temperature T. If bath has this temperature which is constant then system should have the same constant temperature meaning the energy of the system should also be constant. How is then possible that energy of the system fluctuates?

It is also said (in my book) for canonical ensemble: "because system not isolated but rather in thermal contact with the bath of temperature T, the energy exchange is allowed and thus energy of the system can have arbitrary values". How is that possible if once system gets in thermal equilibrium it has constant temperature T?

Constant temperature does not imply system's energy is constant. Since the system is in contact with thermal reservoir, energy is being exchanged all the time. For macroscopic system, fluctuations in energy are negligible compared to total energy, but they are not zero either.

The answer in short: in statistical physics, thermal contact with environment is not necessary for fluctuations of the energy.

Now in detail: when we consider classical mechanical system, we can always (in every moment of time) ascribe some specific value of the energy $E$ to it.

When we work in the framework of statistical or quantum statistical physics, we allow the system to have some statistical distribution of microscopic states and hence a probability distribution of energies.

For example, suppose we have a quantum system with the Hamiltonian $H$, which has the eigenvalues and eigenvectors $H|\varphi_i\rangle=E_i|\varphi_i\rangle$. If the system has the density matrix $\rho$, then the probability to find the system in a state with the energy $E_i$ is $p(E_i)=\langle\varphi_i|\rho|\varphi_i\rangle$. Thus, we have a discrete probability distribution of energies, normalized to unity: $\sum_ip(E_i)=1$.

Another example: classical statistical system with the distribution function $\rho(p,q)$ [$p$ and $q$ are momenta and coordinates of all particles] and Hamiltonian $H(p,q)$. In this case, the probability distribution of the energy is $p(E)=\int dpdq\:\rho(p,q)\delta(E-H(p,q))$. It can be discrete or continuous, and is also normalized: $\int dE\:p(E)=1$.

Now consider the case of two interacting thermodynamic systems, being in thermal equilibrium with each other and having equal temperatures. Each of these systems has not a definite value of energy, but some probability distribution $p(E)$. In presence of intersystem interaction, the energy can flow back and forth between two systems. However, even if we suddenly switch off the interaction, each system (or, to be more precise, the corresponding statistical ensemble) will be left with its own distribution of energies.