# Canonical ensemble

Let us assume that the reservoir temperature ${\displaystyle T}$ does not change. The probability that the system has a given energy ${\displaystyle E}$ is given by[1] :

${\displaystyle P(E)={\frac {1}{Z}}g(E)e^{-{\frac {E}{kT}}}}$

The above is called Bolzmann distribution. The quantity ${\displaystyle Z}$ is called partition function and it's given by:

${\displaystyle Z_{Can}=\sum _{E}g(E)e^{-\beta E}}$

Thus, the mean value of the energy in such an ensemble is given by:

${\displaystyle \left\langle E\right\rangle =-{\frac {1}{Z}}{\frac {\partial Z}{\partial \beta }}=-{\frac {\partial \log Z}{\partial \beta }}}$

In such an ensemble the Helmoltz free energy takes the role of a thermodynamic potential:

${\displaystyle F=E-TS=-kT\log Z_{Can}}$

We do present here some useful relations that involve ${\displaystyle F}$ and its differential form:

• ${\displaystyle dF=-pdV-SdT}$
• ${\displaystyle dF={\frac {\partial F}{\partial T}}dT+{\frac {\partial F}{\partial V}}dV}$
• ${\displaystyle p=-{\frac {\partial F}{\partial V}}}$
• ${\displaystyle S=-{\frac {\partial F}{\partial T}}}$

Using and ${\displaystyle p=-{\frac {\partial F}{\partial V}}}$ it can be proved that

${\displaystyle pV=kNT}$

That is the equation of state for ideal gases. The partition function of a single particle can be written as[2]:

${\displaystyle Z_{1}=\sum _{\epsilon _{n}}e^{-\beta \epsilon _{n}}={\frac {L^{3}}{2\pi ^{2}}}\left({\frac {2m}{\beta \hbar ^{2}}}\right)^{2}{\frac {\sqrt {\pi }}{4}}=Vn_{Q}}$

The value ${\displaystyle n_{Q}}$ is called quantum density, i.e. the total number of accessible states per unit of volume. We do define the DeBroglie thermal wavelength as the ${\displaystyle \lambda }$ of a free particle with kinetic energy given by ${\displaystyle \pi k_{B}T}$: ${\displaystyle \lambda _{Th}\colon \pi k_{B}T={\frac {\hbar ^{2}}{2m}}\left({\frac {2\pi }{\lambda _{Th}}}\right)^{2}}$. Hence we can rewrite ${\displaystyle Z_{1}}$ as: ${\displaystyle Z_{1}={\frac {V}{\lambda _{Th}^{3}}}}$. Using we can find the expression of the Sackur-Tetrode entropy:

${\displaystyle S=kN\log \left({\frac {n_{Q}}{n}}\right)+{\frac {5}{2}}kN}$

All these considerations hold for non-degenerate system, that is for systems where ${\displaystyle {\frac {n}{n_{Q}}}\ll 1}$: meaning that we do assume that the number of particles is way smaller than the number of allowed energy states.

## Gibbs free energy

This quantity is defined as the Legendre transformation of ${\displaystyle F}$ within respect to ${\displaystyle V}$. Hence:

${\displaystyle G=F-{\frac {\partial F}{\partial V}}V=F+pV=E-TS+pV}$

Some important relations involving ${\displaystyle G}$ and its differential form:

• ${\displaystyle dG={\frac {\partial G}{\partial T}}dT+{\frac {\partial G}{\partial p}}dp}$
• ${\displaystyle dG=-SdT+Vdp}$
• ${\displaystyle S=-{\frac {\partial G}{\partial T}}}$
• ${\displaystyle V={\frac {\partial G}{\partial p}}}$
1. Usually the term ${\displaystyle {\frac {1}{kT}}}$ is called ${\displaystyle \beta }$, and so
${\displaystyle P(E)={\frac {1}{Z}}g(E)e^{-\beta E}}$
2. In the derivation of this relation, ${\displaystyle L}$ is the dimension of the discrete element of space where the w.f. is constrained.