Electric Potential from Spherical Symmetric Charge Density

electric-fieldselectrostaticsgauss-lawpotentialsymmetry

I know this question is pretty basic but I found a supposedly wrong formula in my notes and I'm trying to understand where this is coming from. Suppose we have a spherically symmetric charge density $\rho({\boldsymbol{r}})=\rho(r)$, then the formula I was given for the potential is
$$\phi(r)=\frac{1}{r}\int_0^r4\pi\rho(r')r'^2dr'\tag{1}$$
But using Gauss law for electric field one gets
$$\int\boldsymbol{E}\cdot d\boldsymbol{S}=4\pi\underbrace{\int\rho(\boldsymbol{r'})d^3\boldsymbol{r'}}_{Q(r)}\implies \boldsymbol{E}(\boldsymbol{r})=\frac{Q(r)}{r^2}\hat{\boldsymbol{r}}=\frac{\int_0^r4\pi\rho(r')r'^2dr'}{r^2}\hat{\boldsymbol{r}}\tag{2}$$
Taking the gradient of $(1)$
$$\boldsymbol{E}(\boldsymbol{r})=-\nabla\phi=\left[\frac{\int_0^r4\pi\rho(r')r'^2dr'}{r^2}-\frac{4\pi\rho(r)r^2}{r}\right]\hat{\boldsymbol{r}}=\left[\frac{Q(r)}{r^2}-\frac{dQ(r)/dr}{r}\right]\hat{\boldsymbol{r}}$$
That is off by a term from what I got from Gauss Law, so I concluded $(1)$ is wrong.
Is this correct?

Best Answer

The formula $$\phi(r)= \frac{1}{r}\int_0^r 4\pi\rho(r')r'^2dr' \tag{1}$$ for the potential is indeed wrong, as you have already proven by checking $\mathbf{E}(\mathbf{r})=-\nabla\phi$. It misses the contribution of charges outside of radius $r$ to the potential $\phi(r)$. While these outside charges have no effect on the inside field strength $\mathbf{E}$, they do have an effect on the inside potential $\phi$.

A correct formula would be $$\phi(r)= \frac{1}{r}\int_0^r 4\pi\rho(r')r'^2dr' +\int_r^\infty \frac{1}{r'}4\pi\rho(r')r'^2 dr' \tag{a}$$

Equivalently, you may write this as $$\phi(r)= \int_0^\infty \frac{1}{\text{max}(r,r')}4\pi\rho(r')r'^2 dr'$$

It is easy to verify that (a) satisfies $$\mathbf{E}(\mathbf{r})=-\nabla\phi(r) =\frac{Q(r)}{r^2}\hat{\mathbf{r}}$$

Related Question