Reference: Device Electronics for Integrated Circuits 3rd Ed. Richard Muller
I am trying to understand how to calculate the maximum electric field. The answer given in the book is $$E_{max} = \frac{-q N_d x_d}{\epsilon_s}$$ But I am not so sure how to determine the maximum electric field based on the charge distribution alone. Here is what I tried. Using the Gauss's law, $$\int_{0}^{x}dE = \int_{0}^{x}\frac{\rho}{\epsilon_s}$$ $$ E(x) - E(0) = \frac{\rho}{\epsilon_s}x $$ $$ E(x) = \frac{\rho}{\epsilon_s}x + E(0) = \frac{q N_d x}{\epsilon_s} + E(0) $$
From here, since I know the electric field should be zero at the boundary of the depletion region (x_d), I concluded that $$ E(0) = \frac{-q N_d x_d}{\epsilon_s} $$
But this feels like cheating and I feel that I should be able to calculate the electric field at x = 0 without making the use of the knowledge that the electric field outside of the depletion region is zero.
I also tried calculating the electric field due to the sheet charge, assuming an infinite plane, $$ E_{sheet} = \frac{\sigma}{2 \epsilon_s} = \frac{-q N_d x_d}{2 \epsilon_s} $$ But I am not sure what to do with this.
What am I missing here?