Solution (source code)

= Solution

The <grand canonical partition function> is
$$
\mathcal Z(T,\mu)=\sum_i e^{-(E_i-\mu N_i)/(kT)}.
$$
The probabilities in part (i) and their logarithms give
$$
\boxed{k\log\mathcal Z=S-\frac ET+\frac{\mu N}{T}.}
$$
At fixed volume and fixed $\mu$, differentiate the partition sum:
$$
\partial_T\log\mathcal Z=\frac{E-\mu N}{kT^2}.
$$
Combining with the preceding identity yields
$$
\boxed{\left.\frac{\partial}{\partial T}(kT\log\mathcal Z)\right|_\mu=S.}
$$
The variable held fixed is essential; this is the grand canonical derivative.