In a forward biased pnjunction, electrons are injected into the pside as minority carriers and holes are injected into the nside as minority carriers. This establishes a concentration gradient of minority electrons on the pside and a concentration gradient of minority holes on the nside. A diffusion current flows because of the concentration gradients. As the minority carriers diffuse away from the junction, they recombine with the majority carriers. A diode is called long if all the excess minority carriers recombine before the minority carriers are able to diffuse to a metal contact. In this case the concentration of the minority carriers decays to the equilibrium minority carrier density: $n_{p0} = \frac{n^2_i}{N_a}$ for electrons $p_{n0} = \frac{n^2_i}{N_d}$ for holes. The minority carrier concentrations at the edges of the depletion region are,
$$ \label{eq:concentrations} n_p(x_p)=n_{p_0} \exp \left(\frac{eV}{k_BT}\right)\\ p_n(x_n)=p_{n_0} \exp \left(\frac{eV}{k_BT}\right). $$Here, $x_p$ is the edge of the depletion region on the pside, $x_n$ is the edge of the depletion region on the nside, $V$ is the bias voltage, $T$ the absolute temperature, $e$ the elementary charge and $k_B$ is Boltzmann's constant.
For holes and electrons in a semiconductor, the following continuity equations are valid:
$$\label{eq:continuity} \frac{\partial p}{\partial t} = p \mu_p \nabla \cdot \vec{E}  \nabla p \mu_p \vec{E} + D_p \nabla^2 p + G_p  R_p\\ \frac{\partial n}{\partial t} = n \mu_n \nabla \cdot \vec{E} + \nabla n \mu_n \vec{E} + D_n \nabla^2 n + G_n  R_n. $$In a long diode, the minority electron concentration on the p side and the minority hole concentration on the n side decay as further diffusion into the semiconductor increases recombination. Assuming a steady state situation ($\frac{\partial p}{\partial t} =0$) without an external electric field ($\vec{E} = 0$) and negligible generation of carriers inside the semiconductor ($G_p = 0$), the continuity equation for holes diffusing into the nregion simplifies to:
$$D_p \frac{\partial ^2 p_n}{\partial x^2}=\frac{p_np_{n_0}}{\tau _p}.$$
The lefthand side describes the change of the hole concentration due to diffusion with $D_p$ being the diffusion constant. The righthand side describes the recombination rate $R_p$ with the recombination time $\tau_p$.
For $x \ge x_n$, the general solution of the differential equation has the form:
$$p_n(x)= p_{n_0} + A\exp \left(\frac{x}{L_p}\right) + B\exp \left(\frac{x}{L_p}\right), $$with the diffusion length $L_p = \sqrt{D_p \tau_p}$ and $x$ the distance from the pnjunction. (Note that in this case, $x$ is negative on the pside and positive on the nside.) The first boundary condition demands that the minority concentration goes towards the equilibrium concentration as $x$ goes towards infinity. Therefore, $B$ has to be zero. The second boundary condition demands that the concentration of holes at $x = x_n$ equals $p_n(x_n)$. This results in: $$p_n(x)=p_{n_0} + \left(p_n(x_n)  p_{n_0}\right) \exp \left(\frac{(xx_n)}{L_p}\right).$$
The hole diffusion current density is,
$$J_{diff,p} =  e D_p \frac{dp}{dx} = \left (p_n(x_n)  p_{n_0} \right ) \frac{e D_p}{L_p} \exp \left(\frac{(xx_n)}{L_p} \right ).$$Similarly, the electron diffusion current density is,
$$J_{diff,n} = e D_n \frac{dn}{dx} = \left (n_p(x_p)  n_{p_0} \right ) \frac{e D_n}{L_n} \exp \left(\frac{xx_p}{L_n} \right ).$$Since a steady state is assumed, the total current has to be constant throughout the diode. The current that flows through the depletion region is carried by the injected electrons and holes which are then injected into the p and nside as minority carriers. Therefore, the total current equals the sum of the maximum electron current in the pregion, the maximum hole current in the nregion and the current due to recombination. If recombination inside the depletion region is neglected, one obtains:
$$J = \left (p_n(x_n)  p_{n_0} \right ) \frac{e D_p}{L_p} + \left (n_p(x_p)  n_{p_0} \right ) \frac{e D_n}{L_n}.$$Inserting the formulas for the minority carrier concentrations results in:
$$J = e \left ( \frac{p_{n_0} D_p}{L_p} + \frac{n_{p_0} D_n}{L_n} \right ) \left (\exp \left(\frac{eV}{k_BT}\right) 1 \right).$$By multiplying with the crosssection area $A$, one obtains the total current:
$$I =eA \left ( \frac{p_{n_0} D_p}{L_p} + \frac{n_{p_0} D_n}{L_n} \right ) \left (\exp \left(\frac{eV}{k_BT}\right) 1 \right).$$The usual form for the diode formula is obtained by defining a saturation current,
$$I_S=eA \left ( \frac{p_{n_0} D_p}{L_p} + \frac{n_{p_0} D_n}{L_n} \right ),$$so that the diode current can be written in the form,
$$I = I_s \left (\exp \left(\frac{eV}{k_BT}\right) 1 \right).$$$E_g=$ eV $W=$ μm $x_p=$ μm $x_n=$ μm $V_{bi}=$ V $C_j=$ nF/cm²
$D_p=$ cm²/s $D_n=$ cm²/s $L_p=$ μm $L_n=$ μm
Carrier Densities

log(Carrier Densities)
 
Current densities
$\vec{j}_{n,\text{drift}}= ne\mu_n\vec{E}$, $\vec{j}_{p,\text{drift}}= pe\mu_p\vec{E}$, 
CurrentVoltage Characteristics
