There are a lot of books on this topic.
Instead of focusing on:
\begin{equation}
n=n_i \exp\left(-\frac{E_{Fi}-E_F}{k_BT}\right),
\end{equation}
I would focus on a derivation using:
\begin{equation}
n=N_C \exp\left(\frac{E_{F}-E_C}{k_BT}\right),
\end{equation}
where $N_C$ is the electron density of states and $E_C$ is the conduction band edge. In equilibrium, $E_F$ is constant and $E_C$ depends on the electrostatic potential, and electron affinity. The $N_C$ is a material property that can be considered constant for a homogeneous material.
The definition of $n_i$ would require the consideration of holes and the mass action law. I consider it a mistake that the authors you refer to would involve the intrinsic carrier density. If you now include holes:
\begin{equation}
p=N_V \exp\left(\frac{E_{V}-E_F}{k_BT}\right),
\end{equation}
and define:
\begin{equation}
n p=n_i^2,
\end{equation}
and recognize the $E_F$ is the same for both $n$ and $p$ at equilibrium, you will get the definitions for $n_i$ and $E_{Fi}$. If you consider the case where the energy gap is constant
\begin{equation}
E_G=E_C-E_V,
\end{equation}
and that:
\begin{equation}
E_C=\chi -q\psi,
\end{equation}
where $\chi$ is the electron affinity, and $\psi$ is the electrostatic potential, you will see that $n_i$ is constant.
An excellent reference would be "Device Electronics for Integrated Circuits", by Muller and Kamins.
An excellent online reference is http://ecee.colorado.edu/~bart/book/book/chapter2/ch2_7.htm
In my opinion, each type of semiconductor has its own fix Fermi Energy level. At absolute zero temperature of -273 C (0 K), it is located in the middle way of energy gap between Valance Band and Conduction Band. One can shift it either closer to the conduction Band or to the valence Band by adding the impurity atoms to the intrinsic semiconductor;by adding the impurity to the lattice we create P or N type semiconductor.
Best Answer
Sze's book 'Physics of Semiconductor Devices' has a derivation in section 1.4 (of the second edition). One finds the effective density of states in the conduction band, the effective density of states near the top of the valence band, use those to get the carrier concentrations $n$ and $p$, solve for the Fermi level by equating the two, and then use $np = n^{2}_{i}$ to relate $n_{i}$ back to the density of states (conduction and valence) and the Fermi level. The $T^{3/2}$ you are probably wondering about comes from the effective density of states in the valence band.