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. This diffusion current is calculated on the page Long/Short diodes. The long diode limit is when the metal contacts are much further from the junction than the diffusion lengths so that the minority carriers decay to the equilibrium concentration before they reach metal contacts. In this case the minority carrier concentrations are,
$$n_p(x)=n_{p_0} + n_{p_0}\left(\exp\left(\frac{eV}{k_BT}\right)1\right) \exp \left(\frac{(xx_p)}{L_p}\right), \quad \text{for} \quad d_p < x < x_p$$ $$p_n(x)=p_{n_0} + p_{n_0}\left(\exp\left(\frac{eV}{k_BT}\right)1\right) \exp \left(\frac{(xx_n)}{L_p}\right), \quad \text{for} \quad x_n < x < d_n$$Here $d_p$ is the position of the metalsemiconductor interface on the pside, $x_p$ is the edge of the depletion region on the pside, $(d_p < x_p < 0)$, $x_n$ is the edge of the depletion region on the nside, and $d_n$ is the position of the metalsemiconductor interface on the nside $(0 < x_n < d_n)$. The junction between n and p is located at $x = 0$. The diffusion lengths are related to the diffusion constants and the minority carrier lifetimes by $L_p = \sqrt{D_p \tau_p}$ and $L_n = \sqrt{D_n \tau_n}$. To calculate the minority carrier densities at the edges of the depletion zone, substitute $x = x_p$ in the equation for minority electrons and $x= x_n$ for minority holes. The results are the concentrations we expect at the edges of the depletion region,
$$n_p(x_p) = n_{p_0}\exp\left(\frac{eV}{k_BT}\right),\qquad p_n(x_n) = p_{n_0}\exp\left(\frac{eV}{k_BT}\right).$$Far from the junction the minority carrier concentrations approach the equlibrium concentrations $n_p(x\rightarrow \infty) = n_{p_0}$, $p_n(x\rightarrow \infty) = p_{n_0}$.
The electron and hole diffusion current densities are,
$$j_{diff,n} = e D_n \frac{dn}{dx} = \frac{e D_n}{L_n} n_{p_0}\left(\exp\left(\frac{eV}{k_BT}\right)1\right)\exp \left(\frac{xx_p}{L_n} \right ), \quad \text{for} \quad d_p < x < x_p$$ $$j_{diff,p} =  e D_p \frac{dp}{dx} = \frac{e D_p}{L_p} p_{n_0}\left(\exp\left(\frac{eV}{k_BT}\right)1\right)\exp \left(\frac{(xx_n)}{L_p} \right ), \quad \text{for} \quad x_n < x < d_n$$The hole current that passes through the depletion region is the hole diffusion current at $x_n$ and the electron current that passes through the depletion zone is the electron diffusion current at $x_p$ so the total current density is,
$$j = j_{diff,n}(x_p) + j_{diff,p}(x_n)= 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 crosssectional area of the diode $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
