Category:
$\newcommand{\pp}[2][]{\frac{\partial #1}{\partial #2}}\newcommand{\Zca}{\mathcal Z}$
Using occupation number representation for identical particles, the grand canonical partition function is expressed in terms of single particle partition function. This is then used to discuss cases of identical fermions and identical bosons. Mean occupation number for fermions and bosons is obtained.
Single Particle Partition Function
We start from the Gibbs distribution for an open system. The starting point is the probability of a micro state $r$ is given by
\begin{equation}
P(E, N) = \frac{1}{\Zca} e^{\beta(\mu N -E)}. \label{EQ01}
\end{equation}
Remember that a microstate {j} is specified by giving a sequence of the integers
$$\{j\}\equiv\{\nu_{j1},\nu_{j2},\nu_{j3},\cdots, \nu_{j\alpha}, \cdots\}$$
where $\nu_j\alpha$ is the number of particles occupying the single particle
energy level $\alpha$. The grand canonical partition function is the
normalization that the sum of probabilities of all micro states should add to
unity. Thus
\begin{equation}
\Zca = \sum_\text{micro states} P(E,N)
\end{equation}
For a micro state $j$ the total number of particles $n_j$ and the energy $E_j$ are given by
\begin{equation}
E_j = \sum_\alpha \nu_{j\alpha} \epsilon_{\alpha}, \qquad N_j =
\sum_{\alpha} \nu_{j\alpha}
\end{equation}
Therefore
\begin{equation}
\Zca = \sum_j e^{\beta(\mu N_j -E_j)}
\end{equation}
Now the total particle number $N_j$ and the total energy $E_j$ are given by
\begin{equation}
N_j= \sum_{\alpha} \nu_{j\alpha}, \qquad E =\sum_{\alpha} \nu_{j\alpha}
\epsilon_{\alpha}.
\end{equation}
Therefore we have
\begin{equation}
\exp[\beta(\mu N_j -E_j)] = \exp\Big( \beta \sum_{\alpha} \big(\mu
\nu_{j\alpha}-
\nu_{j\alpha} \epsilon_{\alpha}) \Big)
\end{equation}
\begin{eqnarray}
\Zca &=& \sum_j \exp[{\beta(\mu N_j -E_j)}]\\
&=& \sum_j \exp\Big[{\sum_{\alpha} \beta(\mu
\nu_{j\alpha}-\epsilon_{\alpha}\nu_{j\alpha})}\Big]\\
&=& \sum_j \prod_{\alpha} \exp \big(\beta(\mu \nu_{j\alpha} -
\nu_{j\alpha}\epsilon_{\alpha}\big)\label{EQ11} \\
&\bumpeq\!\bumpeq &\prod_{\alpha}\sum_j \exp \big(\beta(\mu
\nu_{j\alpha} - \nu_{j\alpha}\epsilon_{\alpha})\big)
\label{EQ12}
\end{eqnarray}
The last step requires some explanation. It is verified most conveniently by writing all the summations in \eqref{EQ12} explicitly and regrouping the terms again to get it back in the form \eqref{EQ11}. We now introduce
\begin{equation}
\Xi_\alpha =\sum_{\nu_\alpha} \exp \big(\beta(\mu \nu_\alpha -
\nu_\alpha\epsilon_\alpha)\big)\label{EQ13}
\end{equation}
so that
\begin{equation}
\Zca = \prod_\alpha \Xi_\alpha.
\end{equation}
Identical fermions
In case of fermions, only 0 and 1 are the allowed values of occupation numbers $\nu_\alpha$. Thus
\begin{eqnarray}
\Xi_\alpha
&=&\sum_{\nu_\alpha=0,1} \exp \big(\beta(\mu \nu_\alpha -
\nu_\alpha\epsilon_\alpha)\big) \\
&=& 1 + \exp\big(\beta(\mu - \epsilon_\alpha)\big)
\end{eqnarray}
Therefore we have
\begin{eqnarray}
\ln \Zca
&=& \sum_\alpha \ln \Xi_\alpha\\
&=& \sum_\alpha \big( 1 + \exp\big(\beta(\mu - \epsilon_\alpha)\big)
\label{EQ14}
\end{eqnarray}
Identical bosons
For bosons the occupation numbers can have all positive integers, $\nu_alpha=0,1,2,\ldots $. Therefore, the equation \eqref{EQ13} becomes \begin{equation}
\Xi_\alpha = 1 + e^{\beta(\mu-\epsilon_\alpha)} +
e^{2\beta(\mu-\epsilon_\alpha)} + e^{3\beta(\mu-\epsilon_\alpha)} + \ldots
\end{equation}
which is seen to be geometric series and is easily summed to give
\begin{equation}
\boxed{ \Xi_\alpha = \frac{1}{1- e^{\beta(\mu-\epsilon_\alpha)}}}
\end{equation}
Mean occupation number of a level
For later use we now compute the average number of particle occupying a particular single particle energy level $\epsilon_\alpha$.
The probability P(E,N) of microstate having $\{\nu_1,\nu_2,\ldots\}$ is given by \eqref{EQ01}. The average number of particles in a level $\alpha$ is then given by
\begin{eqnarray}
\langle n_\alpha\rangle
&=& \frac{1}{\Zca} \sum_\text{micro states}\nu_\alpha e^{\beta(\mu N -E)}\\
&=&\frac{1}{\Zca} \sum_\text{micro states}\nu_\alpha \exp\Big( \beta \sum_\alpha
\big(\mu \nu_\alpha-
\nu_\alpha \epsilon_\alpha) \Big)\\
&=& - kT \dd[\ln \Zca]{\epsilon_\alpha}\\
&=& -kT \left(\dd[\ln \Xi_\alpha]{\epsilon_\alpha} \right)
\end{eqnarray}
where we have used the expression \eqref{EQ14} for the partition function and used the fact that all terms $\Xi_{\beta}$ do not depend on $\nu_\alpha$ and hence their derivative becomes zero. Hence
\begin{equation}
\langle n_\alpha \rangle = -(\beta\, \Xi_\alpha)^{-1}
\left( \dd[\Xi_\alpha]{\epsilon_\alpha}\right)
\end{equation}
Using the expressions for $\Xi_\alpha$, given above, we can now easily get the mean number of particles in a level $\epsilon_\alpha$. for bosons and fermions.
\begin{eqnarray}
\langle n_\alpha \rangle =
\begin{cases}
\dfrac{1}{e^{-\beta(\mu-\epsilon_\alpha)}-1}, & \text{ For bososn} \\
\dfrac{1}{e^{-\beta(\mu-\epsilon_\alpha)}+1}, & \text{ For fermions}
\end{cases}
\end{eqnarray}
We close this discussion by quoting the result for photons. For photons the chemical potential is zero. This is primarily determined by experiments. Since the photons are bosons, the result for the mean number takes the form
\begin{equation}
\langle n_\alpha\rangle=\dfrac{1}{e^{\beta\epsilon_\alpha}+1},
\end{equation}
The above results will be used extensively in application of quantum statistics.