# Charge Density as a function of the Electric Field

A ball with radius $$R$$ has a non-uniform charge density $$\rho(r)$$. The electric field of the ball as a function of position $$E(r)$$ is known. How would you then find $$\rho(r)$$? I was thinking that, by using Gauss' law to find the charge enclosed by concentric spherical surfaces: $$\Phi_E(r)=E(r)\cdot4\pi r^2=\frac{q_{enc}(r)}{\varepsilon_0}\implies q_{enc}(r)=\frac{E(r)}{k_e}{r^2}$$ And then differentiating that would yield $$\rho(r)\cdot 4\pi r^2$$, but I wasn't really sure since it would make more sense if $$\rho(r)$$ was a surface charge density $$\sigma(r)$$.

You might want to start by using the differential form: $$\nabla \cdot \vec{E} = \frac{\rho(r)}{\epsilon_0}.$$ Since you don't know the actual distribution, the charge enclosed is unknown and you can't calculate $$\vec{E}$$ using the integral version which relies on symmetries and knowing the enclosed charge to be useful. Therefore you would need $$\vec{E} = - \nabla \phi$$ and have to solve Poisson's equation altogether: $$\nabla^2 \phi = -\frac{\rho(r)}{\epsilon_0}.$$ More info on $$\rho(r)$$ could help you integrate this more easily (symmetries, for example).
• In that case (spherical symmetry and only a dependence of $r,$) you can leave the charge enclosed as a function of the integral inside a certain circle, for example $$q_{enc}(R) \equiv 4\pi \int_o^{R} \mathrm{d}r \; r^2 \rho(r).$$ And then use Gauss' law as you suggested in your question, without knowing the form of $\rho(r)$ the exact value of $q_{enc}$ can't be calculated but you still have some idea of the way the field behaves, although not exact. – Nelson Vanegas A. May 6 '20 at 1:16