It has been stressed out in the books that I've consulted that, for an intrinsic semiconductor, $n=p$.
However, with this in mind, they also derivate the following equation: $$E_{F_i}=\frac{E_c+E_v}{2}+\frac{3}{4}k_BT\ln\left(\frac{m^*_h}{m^*_e}\right) \quad\quad\quad\quad (1)$$ Which would be the Fermi energy level of an intrinsic semiconductor, depending on temperature. Meaning that for an intrinsic semiconductor, $E_F$ would be a little bit shifted from the center if the masses of the holes and electrons are different (in general they are).
This has implications if we want to calculate $n$ and $p$, which wouldn't be equal, because they have a dependance on this energy level. I guess that this is a contradiction, because you start with the assumption of $n=p$ but if you want to calculate them using (1), you end up with them being $n \neq p$. Why is that? Which one is correct?
Skip the following derivation if you already know the dependance of $n$ and $p$ on $E_F$.
$$n=2\int^{\infty}_{E_c} \frac{g_c(E)}{1+e^{\frac{E-E_F}{k_BT}}} \ \mathrm{d}E= 2\int^{\infty}_{E_c} \frac{g_c(E)}{1+e^{\frac{E-E_c+E_c-E_F}{k_BT}}} \ \mathrm{d}E$$ Change of variables: $x=\frac{E-E_c}{k_BT}$ and $\xi_n =\frac{E_c-E_F}{k_BT}$; and supposing that for a 2D semiconductor $g_{2D}$ is independent of E: $$n=2g_{2D}k_BT\int^{\infty}_{0} \frac{1}{1+e^{x}e^{\xi_n}} \ \mathrm{d}x$$ Same goes for p, using the same arguments, and with $\xi_p =\frac{E_F-E_v}{k_BT}$: $$p=2\int^{E_v}_{-\infty} \frac{g_c(E)}{1+e^{\frac{E_F-E}{k_BT}}} \ \mathrm{d}E =2g_{2D}k_BT\int^{\infty}_{0} \frac{1}{1+e^{x}e^{\xi_p}} \ \mathrm{d}x$$ So in the end we have $$n=F_0(\xi_n) \quad \mathrm{and} \quad p=F_0(\xi_p), \quad \xi_n \neq \xi_p$$ where $F_j(-\xi)$ is the Complete Fermi–Dirac integral