# Gauss' Law Applied to a Charged Sphere

If I were to apply Gauss' law $$\nabla \cdot \vec{E} = \frac{\rho}{\varepsilon_0}$$ to a charged sphere of radius $R$, which I believe should have an (exterior) electric field given by: $$\vec{E}(r) = \frac{Q}{4 \pi \varepsilon_0 r^2}\hat{r}, \qquad r> R.$$ As is predictable, I would reach $$\nabla \cdot \vec{E}=0, \qquad r> R.$$ This is a fairly well-documented result and I think I understand the reasons for it (outside the sphere the charge density is $0$ and so the divergence will be $0$ too).

Is there a way of applying Gauss' law here such that I don't get a non-zero answer (I think it will be something along the lines of taking the divergence inside the sphere, where I believe the $\vec{E}$-field is defined slightly differently), and to what charge density would the answer correspond (the surface charge density of the sphere, or the total charge divided by the volume of the sphere, or some other quantity)?

Inside the sphere the field is given by the same expression as in the outside, except that you need to replace Q by $\frac{4 \pi r^3}{3} \rho$. If you calculate the divergence of this new expression for the field, that will give you indeed $\frac{\rho}{\varepsilon_0}$. (Beware: you are using the same letter r for the radius of the sphere and for the variable r.)