Quote by turin
I think you accidently used the cylindrical version of the divergence.
Why are you integrating?

I have used the cylindrical version, though this problem only depends on r so maybe use spherical? I integrated the partial differential with respect to r.
if I assume that Er is not a function of r but a constant then,
[tex] \frac{\partial (r E_{r})}{\partial r} = E_{r} [/tex]
or if i use a radial divergence from the beginning:
[tex] \nabla . E = \frac{\partial (E)}{\partial r} [/tex]
but by using that I get:
[tex] E = \frac{\rho r}{\epsilon_0} [/tex]
i.e missing a factor of 3