If you wish, your question(s) may be better reformulated in several manners, as follows:
1- Why the exp[-Eg/2kT] term appears in the intrinsic carrier of concentration of semiconductors?
2- 1- Why the exp[-(Ec-EF)/kT] or exp[-(EF-Ev)/kT] terms appear sometimes in the expression of density of carriers (electrons and holes, respectively) in semiconductors?
Well, when we have an intrinsic semiconductor or an extrinsic semiconductor (n-type or p-type), which we don't know tits density of ionized impurities we usually express the density of electrons and holes from the basic integral definitions:
n = Integral [ f(E).DOS(E) dE] over the conduction band,
where f(E) is the electron distribution function (Fermi-Dirac in case of equilibrium)
After some approximations for non-degenerate semiconductors, we get the famous expression for density of electrons in the conduction band:
n = Nc exp[-(Ec-EF)/kT] ,
where Nc is a temperature dependent constant, called the Effective density of states in the conduction band of the semiconductor. Note that Ec is the edge of conduction band Energy and EF is the Fermi energy level (which appears in the Fermi-Dirac distribution function)
Similarly, the expression for density of holes in the valence band: is given by:
p = Nv exp[-(EF-Ev)/kT] ,
where Nv is a temperature dependent constant, called the Effective density of states in the valence band of the semiconductor. Also Ev is the edge of the valenceband
As we don't know a priori, the location of Fermi level position (EF) in extrinsic semiconductors, we don't use the above expressions to determine n and p, unless we know where EF is located. In this case we use the mass action law together with the neutrality condition, to deduce n and p in terms of the density of ionized impurities (Unfortunately the density ionized impurities also depends on EF, but at room temperature it is usually taken approximately as the doping density in non degenerate semiconductors) . Therefore you maysee
n = ND (doping density of donors in n-type semiconductors) and
p = NA (doping density of acceptors in p-type semiconductors)
Note that the semiconductor may be compensated (with donors and acceptors. Then you replace n by ND-NA or p=NA-ND. Note also that, according to the mass action law: n.p = ni2 in equilibrium (the intrinsic carrier concentration)
In the case of intrinsic semiconductors, n = p = ni = sqrt ( n.p)
Using the initial definitions of n and p (the results of initial integrals over conduction and valence bands) we get the following expression for ni (which is free of EF):
ni = sqrt (Nc.Nv) . exp [-Eg/2kT)
Of course if you performed the integral, you can get the expression of Nc and Nv and hence a closed form of ni.
For instance Si at 300K, we have Nc=2.8x10^19 cm^-3, Nv=1.04x10^19 cm^-3.
thank you sir, what i mean is electron or hole concentration usually defined by number electrons in conduction band per unit volume or number holes in valence band per unit volume. Why this exp term comes into picture which is outside the valence or conduction band.
Carrier Density = DOS * Probability of states being occupied
Probability term depends on carrier statistics, you are using. It might be approximate Boltzmann or more accurate Fermi-Dirac.
Expontential term comes from this probability of states being occupied. Without this exponential, carrier density would be representing total states available in conduction or valence band (Effective DOS).