# Determining charge distribution from electric field (Griffiths 4th)

By | July 12, 2018

I am trying to teach myself Electrodynamics by following Griffiths' book. This is probably what's considered a "homework question", but as I don't have an instructor to ask for help, I'm hoping someone here can do so. If this is really not permitted here, please close this with my apologies

Griffiths Introduction to Electrodynamics 4th Ed Problem 2.50 asks to compute the electric field and then the charge distribution based on a potential $V(r)=A \frac{e^{-\lambda r}}{r}$.

I found the electric field: $$E=\frac{Ae^{-\lambda r}(1+\lambda r)}{r^2}\hat r$$ without too much trouble. To get the charge distribution from the electric field one applies Gauss' law in differential form:

$$\rho=\epsilon _0 \nabla \cdot E$$ $$=\epsilon _0 \nabla \cdot \Biggl(\frac{Ae^{-\lambda r}(1+\lambda r)}{r^2}\hat r\Biggl)$$

Since $\nabla\cdot E$ in spherical coordinates is $\frac{1}{r^2}\frac{\partial}{\partial r}r^2E_r + ... E_\theta + ... E_\phi$, and since E doesn't have theta or phi terms, I simply applied the formula, getting:

$$=\epsilon _0 \frac{1}{r^2}\frac{\partial}{\partial r}\Biggl(r^2 \frac{Ae^{-\lambda r}(1+\lambda r)}{r^2}\Biggl)$$

The $r^2$ cancels and moving A outside the dericvative, I get: $$=\frac{A\epsilon _0}{r^2}\frac{\partial}{\partial r}(e^{-\lambda r})(1+\lambda r)$$ Running the derivative through Wolfram Alpha and rearranging gives: $$\rho=-\frac{A\epsilon _0}{r}(e^{-\lambda r})\lambda ^2$$

However, this isn't what the solution manual (or Chegg) had. Rather, instead of taking the divergence of E, they applied a product rule: $$=\epsilon _0 \Biggl(Ae^{-\lambda r}(1+\lambda r)\nabla \cdot \biggl( \frac{\hat r}{r^2}\biggl)+ \biggl( \frac{\hat r}{r^2}\biggl) \nabla \cdot (Ae^{-\lambda r}(1+\lambda r)) \Biggl)$$ and proceeded from there to get $$\rho=A \epsilon_0 \Biggl(4 \pi \delta^3(r)-\frac{\lambda^2}{r}e^{-\lambda r} \Biggl)$$

I can see what they did, and can follow the computation, but I don't understand why my method was incorrect. Can anyone explain where I erred?

Thank you!