(Under equilibrium conditions, there is no disconnection of EF in pn junction.)

Under thermal equilibrium, there are no charge movements between two materials,

Fig. Junction of  two materials in equilibrium state. Actually, there is no electron movement, Fermi level should be fixed through the entire material.

The rate of electron movement from material 1 to material 2 is in proportion to

[eqn: N_{ 1 } (E)f_{ 1 } (E) CDOT N_{ 2 } (E)[1-f_{ 2 } (E)]]

Also, the rate of electron movement from material 2 to material 1 is in proportion to

[eqn: N_{ 2 } (E)f_{ 2 } (E) CDOT N_{ 1 } (E)[1-f_{ 1 } (E)]]

Under equilibrium condition, these terms are equal. So,

f1(E) = f2(E) and  EF1 = EF2

That is, dEF/dx = 0.