# Helmholtz free energy

Since we have just shown that the microcanonical and the canonical ensembles are equivalent we expect that the thermodynamics of a system can be derived also from the canonical ensemble, but how? What we now want to show is that the Helmholtz free energy of a system (see Thermodynamic potentials) finds a natural place in the canonical ensemble. In particular we want to show that $Z=e^{-\beta F}$ , where $F$ is the free energy of the system. This way, once the canonical partition function $Z$ has been computed we can obtain the Helmholtz free energy as $F=-k_{B}T\ln Z$ , and with appropriate derivatives we can obtain all the thermodynamics of the system (seeThermodynamic potentials).

The first thing we can note is that the canonical partition function $Z$ can be written in terms of the microcanonical phase space volume $\Omega (E)$ :

{\begin{aligned}Z=\int e^{-\beta {\mathcal {H}}}d\Gamma =\int d\Gamma \int dE\delta ({\mathcal {H}}-E)e^{-\beta {\mathcal {H}}}=\\=\int dEe^{-\beta E}\underbrace {\int d\Gamma \delta (E-{\mathcal {H}})} _{\Omega (E)}=\int dEe^{-\beta E}\Omega (E)\end{aligned}} (where we have only inserted a ${\textstyle \int dE\delta ({\mathcal {H}}-E)=1}$ ). This means that the canonical ensemble can be thought of as an ensemble of microcanonical systems each weighted with $e^{-\beta E}$ . Furthermore, if the Hamiltonian ${\mathcal {H}}$ is bounded below then we can always shift it by a constant amount so that ${\mathcal {H}}\geq 0$ , and thus:
$Z=\int _{0}^{\infty }e^{-\beta E}\Omega (E)dE$ which is a Laplace transform! In other words $Z$ is the Laplace transform of $\Omega (E)$ , and $\beta$ is the variable conjugated to $E$ . From the microcanonical definition of entropy we have $\Omega (E)=e^{S(E)/k_{B}}=e^{\beta TS(E)}$ , so that can be rewritten as:
$Z=\int dEe^{-\beta (E-TS)}$ Now, both $E$ and $S$ are extensive so we can use the saddle point approximation (see the appendix The saddle point approximation) to compute the integral. In particular, in order to do so we need to determine the value ${\overline {E}}$ of the energy that maximizes $-(E-TS)$ , namely minimizes $E-TS$ . Therefore:
${\frac {\partial }{\partial E}}(E-TS)_{|{\overline {E}}}=0\quad \Rightarrow \quad 1-T{\frac {\partial S}{\partial E}}_{|{\overline {E}}}=0\quad \Rightarrow \quad {\frac {\partial S}{\partial E}}_{|{\overline {E}}}={\frac {1}{T}}$ and:
${\frac {\partial ^{2}}{\partial E^{2}}}(E-TS)_{|{\overline {E}}}=-T{\frac {\partial ^{2}S}{\partial E^{2}}}_{|{\overline {E}}}={\frac {1}{TC_{V}}}$ Thus, if $C_{V}>0$ (which is always the case since it means that giving heat to a system its temperature will increase) then ${\overline {E}}$ is indeed a minimum. If we now expand the integrand of $Z$ around ${\overline {E}}$ :
$Z=\int dEe^{-\beta ({\overline {E}}-TS({\overline {E}}))-{\frac {\beta }{2TC_{V}}}(E-{\overline {E}})^{2}+\cdots }$ and the values of $E$ that contribute significantly to $Z$ are those such that $(E-{\overline {E}})^{2}/C_{V}\lesssim 1$ , namely $|E-{\overline {E}}|\lesssim {\sqrt {C_{V}}}\propto {\sqrt {N}}$ : for this reason in the thermodynamic limit we can integrate $E$ on the whole real axis (even if $E$ does not span $\mathbb {R}$ ), since in this way we introduce a perfectly negligible error. Therefore:
{\begin{aligned}Z=\left(2\pi T^{2}C_{V}k_{B}\right)^{1/2}e^{-\beta ({\overline {E}}-TS({\overline {E}}))}\quad \Rightarrow \\\Rightarrow \quad \ln Z=-\beta ({\overline {E}}-TS({\overline {E}}))+{\frac {1}{2}}\ln \left(2\pi T^{2}k_{B}C_{V}\right)\end{aligned}} The first term of $\ln Z$ is extensive, while the second is proportional to $\ln N$ ; in the thermodynamic limit this last contribution vanishes and so:
$-{\frac {1}{\beta }}\ln Z={\overline {E}}-TS({\overline {E}})$ This is indeed the free energy $F$ of the system if we have ${\overline {E}}=\left\langle {\mathcal {H}}\right\rangle$ . However:
{\begin{aligned}\left\langle {\mathcal {H}}\right\rangle ={\frac {1}{Z}}\int Ee^{-\beta (E-TS(E))}dE=-{\frac {\partial }{\partial \beta }}\ln Z=\\={\frac {\partial }{\partial \beta }}\left[\beta ({\overline {E}}-TS({\overline {E}}))\right]={\overline {E}}+\beta {\frac {\partial }{\partial \beta }}\left({\overline {E}}-TS({\overline {E}})\right)\end{aligned}} and:
$\beta {\frac {\partial }{\partial \beta }}\left({\overline {E}}-TS({\overline {E}})\right)=\beta {\frac {\partial {\overline {E}}}{\partial \beta }}{\frac {\partial }{\partial E}}\left(E-TS(E)\right)_{|{\overline {E}}}=0$ because by definition ${\overline {E}}$ is the value of $E$ that extremizes $E-TS(E)$ . Therefore $\left\langle {\mathcal {H}}\right\rangle ={\overline {E}}$ , and the expression in $\ln Z$ is indeed the free energy $F$ of the system:
$Z=e^{-\beta F}$ We also see that although the partition function formally allows the system to have any value of energy, it is largely "dominated" by the configurations in which the system has energy $\left\langle {\mathcal {H}}\right\rangle$ .