Does fixed $N$ constraint reduce grand canonical ensemble to canonical ensemble? In condensed matter we were studying the Sommerfeld model where we had these expressions for a gas of fixed N electrons in a metal, where V is also constant but temperatre T is allowed to vary.
We had:
$$ E_{total} = V \int_0^\infty d\epsilon \space\epsilon g(\epsilon) \space n_F(\beta(\epsilon-\mu)) $$
where the chemical potential was treated as being defined implicitly by:
$$ N= V \int_0^\infty d\epsilon \space g(\epsilon) \space n_F(\beta(\epsilon-\mu)) $$
It was said that we can use these too formulae to numerically evaluate the variance of $E_{total}$ with $T$and thus differentiate to obtain the heat capacity.
My question is, since we have essentially enforced a 'fixed N' constraint onto what was a grand canonical ensemble, will the resulting variance $E_{total}(T)$ being completely equivalent to that if we just treated this as a canonical ensemble?
If so, is it possible to show this equivalent just in the maths, or is it too difficult to show due to the nature of these integrals?
 A: The correct starting point to answer this question is to recall that the definition of canonical and grand-canonical ensembles is fixed.
In the grand-canonical ensemble for a simple system, the independent variables are $T$, $V$, and $\mu$ (temperature, volume, and chemical potential), or any equivalent choice (in many cases the activity $z=\exp \left(\frac{\mu}{k_B T} \right) $ is a more convenient choice). In the canonical ensemble, the independent variables are $T$, $V$, and $N$.
The two ensembles provide the same thermodynamic information only at the thermodynamic limit, in practice, for macroscopic systems. At any finite size, the results are not the same. More important for the present question, if in a gran-canonical ensemble we select a subset of the microscopic states, according to the criterion of a fixed number of particles, we are using only part of the microscopic states. The resulting ensemble cannot describe an equilibrium thermodynamic system anymore at fixed $T$, $V$, and $\mu$ but it may be interpreted as a constrained system, where, in addition to fixing the thermodynamic variables, also the number of particles in the volume $V$ is fixed. In general, this constrained system will not provide the same thermodynamics as the unconstrained, where the average number of particles is not fixed arbitrarily but is the outcome of averaging over all the microscopic states.
The second of your formulas is not fully correct. The $N$ on the left-hand side of the equation should be intended as $\langle N \rangle$, the average number of particles. This should be clear once one recalls that the Fermi distribution $n_F$ represents the average occupation of a single state. Therefore, it is not correct to say that we fix $N$. The formula provides the average number of particles in the volume $V$ at fixed $T$ and $\mu$.
The reason for introducing the expression for $\langle N \rangle$ is that the object we want to extract, the constant-volume specific heat, is usually given as a function of the density and not of the chemical potential. For that, the canonical ensemble would be more appropriate. Still, due to the constraints induced by Pauli's principle, calculations for an ideal Fermi gas are easier in the grand-canonical ensemble.
A: In the grand canonical ensemble, the total number of particles N in the system+bath is constant. When you apply statistical mechanics to electron gases in a solid, you can define a grand canonical partition function for one particular single-particle state, which can exchange particles with all other single-particle states. You can then use this statistics to evaluate the average occupation $\langle n_i\rangle$ of the state $i$. The sum of the average occupation for all single-particle states gives $N$, and this fixes the values of the chemical potential. This explains your puzzle.
From the grand canonical partition function for a certain state you can almost trivially derive the Fermi-Dirac occupation function for this state if you assume that the occupation is limited to either 0 or 1 particle and you assume that the energy is linear in the number of particles.
Electrons in a solid are in bands. If the number of electrons in a band remains fixed, what you have is a a so-called quasi-chemical-potential (called quasi-Fermi level) for each band. If the bands can exchange electrons, then all quasi-Fermi levels merge into a single Fermi level.
