Semiconductors/insulators: Why is the fermi energy between the valence and conduction band? Ive asking myself a question on the fermi-energy.
The fermi-energy is defined as the maximum energy which an electron, following the Pauli-rule, can have at T=0.
In semiconductors and insulators the valence band is full while the conduction band is empty (at T=0). Thus the maximum energy is the upper edge of the valence band.
Then why is the fermi-energy not this upper edge of the valence band and instead in the middle of valence and conduction band?
Thank you very much!
 A: Consider an intrinsic semiconductor, which means that there are valence and conduction bands that are energetically separated by a band gap of forbidden electronic energy levels of width $E_g$.
In groundstate, so $T=0 \mathrm{K}$, you correctly said that the valence band edge is the highest occupied energetic state. The electron distribution function takes the look of a heaviside function with values $1$ for the valence band and $0$ for the conduction band. Here the position of the Fermi energy, which is basically the point where the heavyside function has it's step, is ambigously positioned somewhere in the band gap region.
If we now consider a more realistic environment for the semiconductor, like room temperature at $300$ K, we have to closer look at the electron distribution function. As electrons are fermions they follow Fermi-Dirac statistics and the electron distribution function is thus given by
$f(E,\mu, T) = \frac{1}{\exp^{\left[\frac{E-\mu}{k_\mathrm{B} T}\right]} + 1}$
, where $k_\mathrm{B}$ is the Boltzmann constant and $\mu$ the Fermi energy. For finite temperatures this function is not step-like, but a rather smoothly varying from $1$ to zero if energy increases with a turning point at $\mu$. Furthermore this function is asymmetric with respect to $\mu$.
The position of the Fermi energy is now determined by the underlying bandstructure. In the simplest case, so two parabolic bands with same effective mass (e.g. curvature), the position of the Fermi energy lies exactly in the middle of the bandgap. This is due to the fact that the room-temperature Fermi-Dirac function depopulates the valence band (VB) edge states and populates conduction band (CB) edge states. As the number of particles must be conserved, the depopulated valence electrons must be equal to the populated conduction band electrons. For the same effective mass of these bands (same density of states for the VB and CB) this scenario is valid, if $\mu$ lies directly in the middle of the gap.
If the valence and conduction bands show different effective masses, they also have a different density of states and thus we need to change the Fermi energy in such a way that the particle states that are thermally depopulated and populated are equal.
This is ensured by the following equation:
$E_{\mathrm{F}} = \mu = \frac{E_{\mathrm{CB}} - E_{\mathrm{VB}}}{2} + \frac{3}{4} k_\mathrm{B} T \ln(\frac{m_{\mathrm{CB}}^*}{m_{\mathrm{VB}}^*})$.
The choice of the Fermi energy in the middle of the bandgap at $T=0$ K is, as far as I know, ambigious but it kind of makes sense, if you follow the formula from above to $T \rightarrow 0$.
A: In addition to the conduction band and valence band states, you also have to consider any trap states present due to impurities in the material. At 0 K, all donor states will be occupied, and all acceptor states will be unoccupied. This implies the Fermi level must be somewhere between the highest acceptor state level and the lowest donor state level. 
But, indeed, if there is some range between those levels, then we don't really know where the Fermi level is within that range. But since we never encounter a semiconductor sample at 0 K, it is rather a moot point.
As soon as the temperature rises above 0 K, then we can determine the Fermi level by considering that the overall charge of the material remains neutral, and any electron excited from the valence band or a donor impurity must find a home in either the conduction band or an acceptor state. In principle, if we knew the density of states in the two bands, and of the donor and acceptor states, there would be only one choice Fermi energy level that leads to a neutrally charged material (i.e. same total number of electrons present as were there at 0 K).
