The energy band diagram of a p-type semiconductor bar of length L under equilibrium condition (i.e ., the Fermi energy EF is constant) is shown in the figure.The valence band Ev is sloped since doping is non-uniform along the bar. The difference between the energy levels of the valence band at the two edges of the bar is Δ.
If the charge of an electron is q then the magnitude of the electric field developed inside this semiconductor bar is