According to Mass-action Law: nenh=ni2 For intrinsic semiconductors, ne=nh For n-type semiconductors, ne≈ND For p-type semiconductors, nh≈NA
For extrinsic semiconductors where approximation is not valid, electrical neutrality must be used along with mass action law. nenh=ni2 & ND+nh=NA+ne We have two equations and two variables and hence, the problems can be solved.