# Grand potential

Similarly to what we have done for the canonical ensemble in Helmholtz free energy, we now want to show how we can derive the thermodynamics of the system from the grand canonical ensemble. In particular we want to show that ${\displaystyle {\mathcal {Z}}}$ can be expressed in terms of the grand potential ${\displaystyle \Phi }$ (see Thermodynamic potentials), i.e. ${\displaystyle {\mathcal {Z}}=e^{-\beta \Phi }}$.

From the definition of the grand partition function, using the "trick" of inserting a ${\displaystyle \int dE\delta ({\mathcal {H}}-E)}$, which is of course equal to one, we get:

${\displaystyle {\mathcal {Z}}=\sum _{N}\int d\Gamma dEe^{-\beta ({\mathcal {H}}-\mu N)}\delta ({\mathcal {H}}-E)=\sum _{N}\int dEe^{-\beta (E-\mu N)}\Omega (E,V,N)}$
and using the fundamental postulate of statistical mechanics:
${\displaystyle {\mathcal {Z}}=\sum _{N}\int dEe^{-\beta (E-TS-\mu N)}=\sum _{N}\int dEe^{-\beta (F-\mu N)}}$
where ${\displaystyle F=E-TS}$ is the free energy of the system. Now, ${\displaystyle F}$ is extensive and so we can use the saddle point approximation (see the appendix The saddle point approximation) in order to compute the integral; we therefore must find when the integrand is maximized, i.e. when ${\displaystyle F-\mu N}$ is minimized. Since for macroscopic systems ${\displaystyle N}$ is extremely large we can treat it as a continuous function, and so the minima of the exponent are determined by the conditions[1]:
${\displaystyle {\frac {\partial }{\partial E}}(E-TS-\mu N)_{|{\overline {E}},{\overline {N}}}=0\quad \qquad {\frac {\partial }{\partial N}}(E-TS-\mu N)_{|{\overline {E}},{\overline {N}}}=0}$
where ${\displaystyle {\overline {E}}}$ and ${\displaystyle {\overline {N}}}$ are the values of ${\displaystyle E}$ and ${\displaystyle N}$ that extremize ${\displaystyle F-\mu N}$. We therefore have:
${\displaystyle 1-T{\frac {\partial S}{\partial E}}_{|{\overline {E}},{\overline {N}}}=0\quad \qquad \left(-T{\frac {\partial S}{\partial N}}-\mu \right)_{|{\overline {E}},{\overline {N}}}=0}$
namely:
${\displaystyle {\frac {\partial S}{\partial E}}_{|{\overline {E}},{\overline {N}}}={\frac {1}{T}}\quad \qquad {\frac {\partial S}{\partial N}}_{|{\overline {E}},{\overline {N}}}=-{\frac {\mu }{T}}}$
These two equations allow us to determine ${\displaystyle {\overline {E}}}$ and ${\displaystyle {\overline {N}}}$ once ${\displaystyle T}$ and ${\displaystyle \mu }$ are known. Therefore, we can approximate:
${\displaystyle {\mathcal {Z}}=e^{-\beta ({\overline {E}}-TS({\overline {E}},V,{\overline {N}})-\mu {\overline {N}})}}$
since, similarly to what seen in Helmholtz free energy, all the other terms in the exponential vanish in the thermodynamic limit. Therefore we see that:
${\displaystyle -k_{B}T\ln {\mathcal {Z}}={\overline {E}}-TS({\overline {E}},V,{\overline {N}})-\mu {\overline {N}}}$
namely the exponent of the grand partition function is a Legendre transformation of the same exponent of the partition function in the canonical ensemble with respect to the number of particles ${\displaystyle N}$; furthermore, we have that this exponent is really the grand potential ${\displaystyle \Phi }$ if ${\displaystyle {\overline {E}}=\left\langle {\mathcal {H}}\right\rangle }$ and ${\displaystyle {\overline {N}}=\left\langle N\right\rangle }$. We now want to show that this is indeed the case.

From the definition of the grand partition function (${\textstyle {\mathcal {Z}}=\sum _{N}\int d\Gamma e^{-\beta ({\mathcal {H}}(\mathbb {Q} ,\mathbb {P} )-\mu N)}}$), we have:

{\displaystyle {\begin{aligned}\left\langle N\right\rangle ={\frac {1}{\beta }}{\frac {\partial \ln {\mathcal {Z}}}{\partial \mu }}={\frac {\partial }{\partial \mu }}\left(k_{B}T\ln {\mathcal {Z}}\right)=-{\frac {\partial }{\partial \mu }}\left({\overline {E}}-TS({\overline {E}},V,{\overline {N}})-\mu {\overline {N}}\right)=\\{}\\={\overline {N}}+{\frac {\partial {\overline {E}}}{\partial \mu }}\underbrace {{\frac {\partial }{\partial E}}(E-TS(E,V,N)-\mu N)_{|{\overline {E}},{\overline {N}}}} _{=0}+\\+{\frac {\partial {\overline {N}}}{\partial \mu }}\underbrace {{\frac {\partial }{\partial N}}(E-TS(E,V,N)-\mu N)_{|{\overline {E}},{\overline {N}}}} _{=0}\end{aligned}}}
However, the two derivatives are null because ${\displaystyle {\overline {E}}}$ and ${\displaystyle {\overline {N}}}$ are by definition minima of ${\displaystyle F-\mu N}$. Therefore:
${\displaystyle \left\langle N\right\rangle ={\overline {N}}}$

Now, again from the definition of ${\displaystyle {\mathcal {Z}}}$ we have:

{\displaystyle {\begin{aligned}\left\langle {\mathcal {H}}-\mu N\right\rangle =-{\frac {\partial \ln {\mathcal {Z}}}{\partial \beta }}={\frac {\partial }{\partial \beta }}\left[\beta ({\overline {E}}-TS({\overline {E}},V,{\overline {N}})-\mu {\overline {N}})\right]=\\={\overline {E}}-\mu {\overline {N}}+{\frac {\partial {\overline {E}}}{\partial \beta }}\underbrace {{\frac {\partial }{\partial E}}(E-TS(E,V,N)-\mu N)_{|{\overline {E}},{\overline {N}}}} _{=0}+\\+{\frac {\partial {\overline {N}}}{\partial \beta }}\underbrace {{\frac {\partial }{\partial N}}(E-TS(E,V,N)-\mu N)_{|{\overline {E}},{\overline {N}}}} _{=0}\end{aligned}}}
where the derivatives vanish again for the same reason. Therefore:
${\displaystyle \left\langle {\mathcal {H}}-\mu N\right\rangle ={\overline {E}}-\mu {\overline {N}}}$
and since ${\displaystyle {\overline {N}}=\left\langle N\right\rangle }$ and of course ${\displaystyle \left\langle {\mathcal {H}}-\mu N\right\rangle =\left\langle {\mathcal {H}}\right\rangle -\mu \left\langle N\right\rangle }$, we have:
${\displaystyle \left\langle {\mathcal {H}}\right\rangle ={\overline {E}}}$
Therefore, we indeed have:
${\displaystyle {\mathcal {Z}}=e^{-\beta \Phi }}$

and we see that also in the grand canonical ensemble the partition function is largely dominated by the configurations of the system where the energy is ${\displaystyle \left\langle {\mathcal {H}}\right\rangle }$ and the number of particles is ${\displaystyle \left\langle N\right\rangle }$.
1. We don't verify that the Hessian is definite positive in the extrema that we have found because the computations are long and tedious.