# Calculation of Field That Creates a Spherecally Symmetrical Charge Distribution

## Gauss's Law

I am trying to do this calculation using Gauss's Law.

$$Φ_Ε = \int \vec E \cdot d \vec A = \frac{Q_{in}}{ε_0}$$

One of the ways to derive this law is to concider a spherical surface at the centre of which there is a point charge.

Because of the symmetry the field has the same value in every point of the Gaussian surface.

$$\int E\hat r \cdot dA \hat r= \int EdA =EA = \frac{q}{ε_0}$$

If i want to calculate it by solving the surface integral would I differentiate the surface of the sphere?

$$dA=d(4πr^2)=8πrdr$$

$$\int EA = \int \frac{k_eQ_{in}}{r^2} 8πrdr = \int \frac{2Q_{in}}{ε_0r}dr$$

But this is not the right outcome. Is it maybe because the $dr$ indicates a change only in radial direction?

## Calculation of the spherical distribution

Since the distribution is spherically symmetrical the charge density is $ρ=ρ(r)$, right? In case for example when we want to calculate the field at a point inside the sphere:

$$E= \frac{Qin}{4πr^2ε_0} = \frac{ \int^a_0 ρ(r)dV}{4πa^2}=\frac{ \int^a_0 ρ(r)4πr^2dr}{4πa^2}$$

Where $a \le R$

## End

So I guess what i am askind is can I solve these integrals by further differentiating the differentials?

i.e. $dA \to 8πrdr$ or $dV \to 4πr^2dr$

The short answer to your question about the manipulation $dA \to 8\pi r\,dr$ is that no, you cannot perform this manipulation to do the surface integral since the integral is being taken over a surface of constant radius, and this manipulation would have you integrate with respect to the radius. Note that the expression $8\pi r\,dr$ is a literal interpretation of how the surface area of the ball changes with small changes of the radius $dr$.
If you want to evaluate the integral $\iint_S d\vec A\cdot \vec E$, you will have to note that the differential area element $d\vec A$ is $( r^2\sin\theta \,d\theta\,d\phi)\,\hat r$, and that the integral is being taken over the range $\theta \in [0,\pi]$, $\phi \in [0,2\pi)$, not over $r$ since we are evaluating the integral at constant $r$. Formally, you are parametrizing the surface of the ball of radius $r$:
$$S(\phi, \theta) = (x(\phi,\theta),y(\phi,\theta),z(\phi,\theta)),$$ and computing the surface integral using the Jacobian factor $r^2\sin\theta\,d\theta\,d\phi$. Hence,
$$\iint_S d\vec A\cdot \vec E = \frac{Q_{\text{in}}}{\varepsilon_0}\iint_S d\phi\,d\theta\,\frac{r^2\sin\theta}{4\pi r^2} = \frac{Q_{\text{in}}}{\varepsilon_0}\frac{4\pi}{4\pi} = \frac{Q_{\text{in}}}{\varepsilon_0}.$$ Since $\iint_S d\phi\,d\theta\,\sin\theta = 4\pi$.
As for the electric field a distance $a$ from the center of a spherically-symmetric charge distribution $\rho(r)$, yes you still pull out Gauss's law: $$\iint_{S_a} d\vec A\cdot \vec E = \frac{1}{\varepsilon_0}\iiint_B dV\,\rho(r) \implies \vec E(a) = \hat r\frac{1}{4\pi\varepsilon_0 a^2} \iiint_B dV\,\rho( r).$$ In this second case, the volume $V$ of the ball is given by $4\pi r^3/3$, and the manipulation $dV = 4\pi r^2\,dr$ is valid since in this case, we are integrating over the volume of the ball, not just a surface of constant radius.