Semi conductors (holes and electrons) The following relation is mentioned in my text book for semiconductors in thermal equilibrium.
$$n_e ×n_h = n_i^2$$
$n_e$ stands for the number of electrons.
$n_h$ stands for the number of holes.
1) Does anyone know what $n_i$ stands for?
2) Can anyone give me intuition behind this formula, or explain how it came? 
(I've already guessed that $n_i$ might stand for total current carriers.
But then would have to be $n_h$+ $n_e$, right? So I think that's wrong.)
 A: Answering this question properly would be just copy-pasting text book, so I'll be brief.
$n_i$ is the intrinsic carrier density. Intrinsic means without doping. In an intrinsic semiconductor, concentration of holes equals to concentration of electrons due to charge conservation.
The equation is called mass action law. The top of the valence band and the bottom of the conduction band is expanded to second order in k (Taylor series), which gives $\sqrt(E)$ like density of states. Each of these states is occupied according to the Fermi-Dirac-distribution. It turns out, that this can be described by effective density of states $N_v$ or $N_c$. (valence and conduction band).
For electrons
$$n_e=N_c\text{ exp}\left[-\frac{(E_c-E_F)}{kT}\right]$$
and for holes
$$n_h=N_v\text{ exp}\left[-\frac{(E_F-E_v)}{kT}\right]$$
The doping of the semiconductor alters the fermi level $E_f$. One can see, that if $n_e$ increases due to doping, $n_h$ decreases because of the opposite sign in $E_f$. If you multiply these to equations together, you find that $E_f$ cancels, and what is left is $-E_g=-(E_c-E_v)$, the band gap.
One way to interpret the mass action law, is that the 'the product of carrier consentrations is conserved upon doping'. So, 
$$n_e n_h = n^i_e n^i_h ( = n_i^2 )$$.
That is because, as I mentioned in the beginning, charge must be conserved with intrinsic semiconductor resulting $n_i = n^i_e = n^i_h$.
A: For an intrinsic semiconductor the mechanism for conduction is the thermal excitation of valence band electrons:
$$ v \rightarrow e + h \tag{1} $$
So the number of conduction electrons and holes must be the same:
$$ n_e = n_h = n_i $$
where the symbol $n_i$ is just the number density of carriers in each band i.e. the number of electrons in the conduction band and the number of holes in the valence band. So for an intrinsic semiconductor the following identity follows trivially:
$$ n_e n_h = n_i^2 $$
The argument is that this equation also applies to a doped semiconductor where $n_e \ne n_h$. If we take equation (1) we can write an equilibrium constant for it:
$$ \frac{n_v}{n_e n_h} = R(T) $$
where $R(T)$ is the recombination rate (which is a function of temperature). If we take the case of an intrinsic semiconductor where $n_e = n_h = n_i$ we can substitute for $n_e$ and $n_h$:
$$ R(T) = \frac{n_v}{n_i^2} $$
For a doped semiconductor we still have:
$$ R(T) = \frac{n_v}{n_e n_h} $$
where now $n_e \ne n_h \ne n_i$
But we expect the recombination rate $R$ and the valence electron number $n_v$ to be (approximately) unchanged by doping, and that implies that even for a doped semiconductor we still have the relationship:
$$ n_e n_h = n_i^2 $$
