# Gauss's Law for Non-Uniform Electric Fields enclosed within Gaussian Surfaces

The textbook definition of Gauss' Law is the following:

$$\Phi_{E} = \oint \vec{E} \bullet d\vec{A} = \frac{Q_{encl}}{\epsilon_{0}} \ \ (1)$$

But in all the examples in the book, the following diagram is used to illustrate a hypothetical Gaussian surface:

Now in all of these diagrams, the charge $q$ enclosed in the Gaussian Surface, is always as the center of it. Thus the electric field is uniform throughout the inside of this Gaussian Sphere. But what if the field is non-uniform on the inside of the Guassian Sphere (in other words if the point charge is not at the center of the Gaussian Sphere? Does $(1)$ still hold in that case?

Is $\Phi_{E} = \oint \vec{E} \bullet d\vec{A} = \frac{Q_{encl}}{\epsilon_{0}} \ \$ still valid for non-uniform electric fields enclosed within Gaussian Surfaces?

Take the following example:

Example: A point charge $q_1 = 3.80nC$ is located on the $x$-axis at $x = 2.1m$ and a second point charge $q_2 = -6.2nC$ is on the $y$-axis at $y=1.15m$. What is the total electric flux due to these two point charges through a spherical surface centered at the origin and with radius $r = 1.55m$?

Would the total electric flux through the Gaussian Surface just be

\begin{align} \Phi_{E} &= \frac{Q_{encl}}{\epsilon_{0}} \\ &= \frac{-6.2nC}{\epsilon_{0}}? \end{align}

As even though $q_2$ is contained within the Gaussian Surface, it does not lie at it's center

Yes, for any closed Gaussian surface (including irregular surfaces), this law holds.

But we consider only symmetrical surfaces (sphere, cylinder, etc.) in academics as it is easy for performing the integration.

Let us consider the example which you have given:

## Black dot represents a point charge.

Here, in order to find the net flux through the surface you must integrate each E.dA, which is not so easy. The advantage with symmetry is that E is always constant, and dA is always perpendicular to the surface so that you may integrate easily. Even in this case, if you integrate E.dA, you will end up with the same result.

Gauss law even applies for irregular surfaces :

The only problem is to integrate. You would have the same result.

How to think without mathematics :

As we know, flux is the measure of number of lines of electric field passing through the Gaussian surface. Even if you move the charge anywhere within the surface, the number of field lines won't change, right?

All the Gauss laws(of electrostatics, magnetism, gravitation), field vectors, inverse square laws can be derived from the GAUSS LAW OF DIVERGENCE. It's so exciting!!!

The formula is valid for ANY surface. You usually choose the easiest one to calculate the flux with. If you only have a charge, you choose a sphere since the field will be perpendicular to the surface everywhere.