# Electric field in center of non-conducting sphere with non-uniform charge distribution from Gauss's law

I'm currently reviewing electricity for the AP Physics C exam, and came across a problem or general topic I don't really understand that has to do with Gauss's law.

The general form of Gauss's law we learn in AP Physics C is $$\int E \;\mathrm{dA} = q_{enclosed}/ε_0$$

So when the enclosed charge is 0, as in the case of a hollow spherical shell with uniform charge distribution, it follows that the electric field is zero in the sphere.

However, when the charge distribution becomes non-uniform, the enclosed charge is still zero, implying that the electric field is still zero. However, if all the charge on the sphere is moved to one side, there should be an electric field directed from one hemisphere to the other. I'm wondering how this application of Gauss's law here is wrong and why.

When writing up this question I found this link: Gauss' Law- Hollow Sphere with Non-Uniform Charge Distribution where someone answered a similar question. However, I still don't understand why if flux is zero it does not mean the electric field is zero. Please keep in mind that I only have taken Calculus up to AP Calculus BC, which I think roughly corresponds to Calculus II.

However, I still don't understand why if flux is zero it does not mean the electric field is zero.

Let's look at a simple example. What is the value of the following integral? $$\int_0^1 (3x^2-1)\text d x$$ If you do the work (help you with your AP calculus) you will find that the integral is $$0$$. Yet the integrand is not $$0$$ along the entire interval we are integrating over.

Therefore, an integral being $$0$$ doesn't tell us anything about the integrand in general. In terms of Gauss's law in integral form, it's really only useful in determining the field in very specific scenarios with appropriate symmetry. In general Gauss's law in integral form cannot be used to determine $$E$$.

To drive it a little further, imagine I told you I'm thinking of 10 numbers that add up to 100, and I asked you to tell me what the 10 numbers are. You would have no way to know. However, if I give you some more information, like that the numbers are all equal, then you could determine the numbers. The integral is essentially an infinite sum, and if all I told you was the value of this sum then you would have no idea what the terms were that I used to get that sum.

Generally, at some points of the surface over which you integrate $$\vec E \cdot \vec A$$ is positive and at others it is negative. In the case that no charge is included that is $$\vec \nabla \cdot \vec E =0$$, it can be mathematically proven that it is zero on average.

In essence you question boils down to the following one.
Given a point charge $$q$$ which is located outside a spherical Gaussian surface what is the electric field inside the Gaussian surface and what is the net electric flux through the Gaussian surface?

The electric field bit is easy.

$$\vec E = \dfrac {1}{4\pi \epsilon_0} \dfrac {q}{r^2} \hat r$$ where $$r$$ is the distance between the charge and the point where the electric field is to be found and $$\hat r$$ is the unit vector point out from the position of the charge.

What is more difficult is to show that the net electric flux through the Gaussian surface, which is a sphere, is zero. Electric flux in through surface $$S_1$$ is equal to the electric flux out through surface $$S_2$$, ie $$\int_{S_1} \vec E \cdot d\vec {A'} + \int_{S_2} \vec E \cdot d\vec {A'} =0$$.
I have seen this done mathematically (I think for a gravitational field - any offers?) but cannot find the derivation so I will have to hand wave.

In terms of of electric field lines one could say that the "number" of electric field lines (electric flux) entering surface $$S_1$$ is the same as the number of electric field lines leaving surface $$S_2$$ which makes the net number of electric field lines starting or finishing within the Gaussian surface as zero.

A Gaussian surface I can deal with mathematically is shown below as in read $$ABCD$$.

It consists of two spherical caps $$S_1$$ and $$S_2$$ of radius $$r_1$$ and $$r_2$$ and a surface $$S_3$$ which joins the two caps and which is along (parallel to) the electric field lines originating from the charge.

The reason for choosing the caps is that because the electric field is radial and so will be at right angles to the surface of the cap and the areas of the caps $$A'$$ is proportional to the square of the distance of a cap from the point charge $$r^2$$ ie $$A' \propto r^2$$.

There is no electric flux through surface $$S_3$$ as the electric field is along the surface.

The electric flux through a cap is $$\vec E \cdot d\vec{A'} = E\,A'$$ where $$E = \dfrac {kq}{r^2}$$ and A'=k'r^2 where $$k$$ and $$k'$$ are constants.
This means that the flux through a cap $$E\,A'= \dfrac {kq}{r^2} \times k'r^2 = kk'q$$ is independent of the distance of a cap from the point charge.

So the electric flux into surface $$S_1$$ must equal the electric flux leaving surface $$S_2$$ and the net electric flux through the whole Gaussian surface is zero even though there is an electric field inside the Gaussian surface.