# Simple doubt regarding Gauss law

I read about the Gauss law of electrostatics which is given by

$$\oint \vec E \cdot \vec da =\frac{q_{enclosed}}{\epsilon_o}$$

I was told by my teachers that the term $$\vec E$$ in the above equation is the total electric field due to all the charges inside as well as outside the Gaussian surface. And this is where I am confused.

I think we can rewrite the above equation (on the basis of principle of superposition) as :

$$\oint (\vec E_{inside \; charge}+{\vec E_{outside \; charge}})\cdot \vec da =\frac{q_{enclosed}}{\epsilon_o}$$

So again we can rewrite it as

$$\oint \vec E_{inside \; charge}\cdot \vec da + \oint \vec E_{outside \; charge}\cdot \vec da =\frac{q_{enclosed}}{\epsilon_o}.$$

The second term in the above equation is essentially the electric flux of charges situated outside the Gaussian surface which is equal to $$0$$.

So from this result, we can notice that the electric field which we get using the Gauss law is the field of the charges inside the surface only which is in contradiction with what I read in my books and also with what I was taught by my teacher.

So Where am I wrong and what actually $$\vec E$$ represents? Also Why is so much emphasis given on the fact that $$\vec E$$ in the Gauss law is total electric field and not just the field of charge inside the body? Please forgive me if I am making a silly mistake.

Edit : Since the only flux which remains in the integral is the flux of the charge inside the Gaussian surface and if the surface is symmetrical, then we can take the $$\vec E$$ out and calculate this $$\vec E$$ by finding the area after solving the integral.

I read about the derivation of electric field of an infinitely long wire by assuming a coaxial Gaussian cylinder in my NCERT book.

And since we know that the net flux in the Gaussian surface is of the inside charge this suggests that the electric field $$\vec E$$ we will get after solving the integral (assuming symmetry) is the field of the charge inside the wire.

But this is what NCERT says • You analysis is correct, but does not contradict he statement that $E$ includes everything. Jul 16, 2021 at 18:50
• A surface integral being zero doesn't imply the integrand is zero. You may very well have pointwise contributions do the surface integral that aren't zero, but they'll average out over the whole surface. Jul 16, 2021 at 18:52
• @mike stone but then why is it emphasized that E is teh total electric field .. Jul 16, 2021 at 18:53
• Jul 16, 2021 at 20:23
• Related (to be careful): Using Gauss's law when point charges lie exactly on the Gaussian surface. Jul 16, 2021 at 20:31

I was told by my teachers that the term $$\vec E$$ in the above equation is the total electric field due to all the charges inside as well as outside the Gaussian surface.

If by "total electric field" your teacher means the vector sum of the contributions of the electric fields at the differential surface area dA due to contributions of charges both inside and outside the Gaussian surface, then that is correct.

The second term in the above equation is essentially the electric flux of charges situated outside the Gaussian surface which is equal to 0

That is correct because if you look at the electric field lines associated with charges outside the Gaussian surface you will find that every field line line that crosses a surface and enters the volume enclosed by the surface exits the volume at some other surface, for a net flux of zero due to external charges.

So from this result , we can notice that the electric field which we get using the Gauss law is the field of the charges inside the surface only which is in contradiction with what I read in my books and also with what I was taught by my teacher.

There is no contradiction as long as your teacher meant what I said above.

So Where am I wrong and what actually $$\vec E$$ represents ? Also Why is so much emphasis given on the fact that $$\vec E$$ in the Gauss law is total electric field and not just the field of charge inside the body ? Please forgive me if I am making a silly mistake.

I'm not sure why there would be an emphasis on the field contributions of charge outside the body, unless it is to demonstrate that even if you do account for them, the evaluation of the integral over the entire surface will show that there is no net flux due to the external charges, only due to the internal charges.

In any case, I don't see that you've made any mistake.

so the field which we will get after solving the integral is the field due to charges inside the Gaussian surface. Right ?

It's not the field we will get after solving the integral. It's the net electric flux, i.e., the integral of $$\vec E.d\vec A$$ over the entire surface. Net flux is positive if the volume encloses net positive charge and negative if the volume encloses net negative charge. It is zero for the fields produced by external charge because the flux entering/exiting the volume equals the flux exiting/entering the volume.

Edit : Since the only flux which remains in the integral is the flux of the charge inside the Gaussian surface and if the surface is symmetrical, then we can take the $$\vec E$$ out and calculate this $$\vec E$$ by finding the area after solving the integral.

That is correct.

Gauss' law can be used for the calculation of electric fields when they originate from charge distributions of sufficient symmetry to apply it. In other words, the electric field $$\vec E$$ comes out of the integral. Examples of such applications (including an infinite line of charge) and the resulting value of the electric field can be found here:

http://hyperphysics.phy-astr.gsu.edu/hbase/electric/gaulaw.html

And since we know that the net flux in the Gaussian surface is of the inside charge this suggests that the electric field $$\vec E$$ we will get after solving the integral (assuming symmetry) is the field of the charge inside the wire.

That is correct, provided that the charge distribution is sufficiently symmetric.

But this is what NCERT says...This is very contradictory.

I don't see any contradiction between what NCERT says and the Hyperphysics treatment of an infinite line of charge shown in the link. Compare the two and see what you think.

Hope this helps.

• so the field which we will get after solving the integral is the field due to charges inside the Gaussian surface. Right ? Jul 17, 2021 at 3:53
• @Ankit I updated my answer to respond. Jul 17, 2021 at 10:52
• thanks for your answer .. but I guess you didn't get the comment in the way it was intended for.. but I have made an edit.. hope you respond... Jul 18, 2021 at 1:44
• @Ankit Just saw the edit. Check out the update to my answer. Hope it helps Jul 26, 2021 at 21:56

$$\displaystyle \oint \vec E_{\rm inside \; charge}\cdot d\vec a + \oint \vec E_{\rm outside \; charge}\cdot d\vec a =\dfrac{q_{\rm enclosed}}{\epsilon_o}$$

So you have to do two integrations.
The first integration is the one which is usually quoted and the second one often omitted because it is zero.

Without doing any actual integrations think of the integral as "counting" the field lines which pass through the Gaussian surface with lines going out from the enclosed volume counting as positive and lines entering into the enclosed volume as negative.
A field line produced by a charge inside the Gaussian surface will only pass though the surface once with positive charges producing a positive contribution to the first integral whereas negative charges producing a negative contribution.
From this you will get the idea that $$q_{\rm enclosed}$$ is the net charge within the Gaussian surface.

Now consider a charge which is outside the Gaussian surface.
Field lines from such charges will traverse the Gaussian twice either entering and then leaving the enclosed volume or vice versa.
So in terms of counting field lines through the Gaussian surface each field will have a net zero contribution to the second integral.

• so the field which we will get after solving the integral is the field due to charges inside the Gaussian surface . Right ?? Jul 17, 2021 at 3:51
• Yes, and that is why the second integral is rarely included in the equation. Jul 17, 2021 at 5:36
• thanks .. but I still have a doubt .. (sorry if I am violating the rules by discussing in the comments) ... I read the derivation of electric field of an infinitely long charged wire in which a cylindrical Gaussian surface was assumed coaxial with the wire.. and then we find the electric field after solving the integral... But this electric field should be the field due to the portion of the wire inside the surface (right ?) But my book says that the electric field we get is due to the whole wire.... Jul 17, 2021 at 6:11
• Any field line which starts from a charge outside the Gaussian surface will either miss the Gaussian surface completely or enter the Gaussian surface and then leave the Gaussian surface and so overall not contribute to the integral. Jul 17, 2021 at 9:45
• I have added the picture about which I commented.. Jul 18, 2021 at 1:43

Since the only flux which remains in the integral is the flux of the charge inside the Gaussian surface and if the surface is symmetrical, then we can take the 𝐸⃗ out and calculate this 𝐸⃗ by finding the area after solving the integral.

This is not true in general. In the example of an infinitely long charged wire, the correct Gaussian surface to use is a cylinder which is coaxial with the wire, as you have said. However, if you only consider only the field $$\vec E_{in}$$ generated by the charge enclosed by this Gaussian surface, it will not have cylindrical symmetry. Gauss' law will still apply, of course. You could in principle compute the total flux through the Gaussian cylinder by only considering the charges inside. However, since the field due to the charges varies both in magnitude and direction over the surface of the cylinder, there is insufficient symmetry for this approach to be helpful in computing what $$\vec E_{in}$$ actually is at any specific point.

More to the point, our goal here is not to find $$\vec E_{in}$$ but rather to find the total field $$\vec E_{tot}$$ due to the charges along the entire wire, not just inside the Gaussian cylinder. $$\vec E_{tot}$$ does have cylindrical symmetry, which is why we can use Gauss' law to compute it without doing any difficult integrals.

And since we know that the net flux in the Gaussian surface is of the inside charge this suggests that the electric field 𝐸⃗ we will get after solving the integral (assuming symmetry) is the field of the charge inside the wire.

This is not true either. If a charge is sitting outside your Gaussian surface, then it's true that the field it generates does not contribute to the net flux through your surface. However, it most certainly does contribute to the total electric field at every point; it's just that when you integrate its contributions to the total flux over the full surface, it contributes positive flux in some areas and negative flux in others such that overall it sums to zero. The total external flux $$\iint \color{green}{\vec E_{out}} \cdot d\vec A = 0$$, but that doesn't mean that $$\color{green}{\vec E_{out}}$$ doesn't contribute to the total field $$\color{purple}{\vec E_{tot}}$$ at every point. Since $$\color{purple}{\vec E_{tot}}$$ is what has the cylindrical symmetry, it is the field we are able to pull out of the integral and solve for using Gauss' law.

In other words, it is true that $$\iint \color{red}{\vec E_{in}}\cdot d\vec A = q_{in}/\epsilon_0$$ and it is true that $$\iint \color{purple}{\vec E_{tot}} \cdot d\vec A = q_{in}/\epsilon_0$$, but it is only in the latter case that we have sufficient symmetry to actually solve for the field. The first equation remains true, but is not very helpful for what we're attempting to do here.

Since the other answers have cleared your doubts on earlier questions, I will attempt to address the problem about the infinitely long wire. The assumption of the wire being infinitely long ensures that the electric field by the wire is solely dependent on the radial distance, that is $$\vec{E}(r,\theta,\phi)=E(r)\vec{r}.$$ Employing such symmetry and using a cylindrical Gaussian surface of radius $$a$$ and height $$l$$, we will get $$2\pi a\cdot l\cdot E=\frac{\lambda l}{\varepsilon_0}$$. As you can see, the parameter $$l$$ is canceled off on both side so it has no effect to the calculation of the field due to the whole wire. That means every finite height cylindrical Gaussian surface is sufficient to determine the electric field due to the whole wire. However, if the wire is finitely long, then its electric field no longer exhibits such symmetry.

The field $$\vec{E}$$ that appears in Gauss' law is the total field, however you can sometimes simplify situations by using the superposition principle. This is made clearer with 2 examples:

Example 1 - Two point charges

Obviously in this case we want to be able to just sum the Coulomb electric fields from the two charges. How do we go about doing that with Gauss' law? Well the easiest way is clearly to use superposition and to first compute the field $$\vec{E}_1$$ that would be there if only charge $$1$$ were there, and then the field $$\vec{E}_2$$ if only charge $$E_2$$ were there.

This option is easier because the total field has low symmetry but the individual contributions have high symmetry, thus letting us calculate them using Gauss' law.

Example 2 - An Infinite Line of Charge

Now the situation is the other way around - if you want to find the total field by calculating it for lots of finite segments of wire and then adding them up you find that a finite length wire has a very strange shaped electric field and Gauss' law isn't much use.

Fortunately we don't need superposition since the total field $$\vec{E}$$ has high symmetry. In particular, it must always point radially outwards from the wire - it can't have a component along the wire because what direction along the wire would this component point? This argument fails for the finite wire because (unless you are exactly at the centre) this component along the wire can point to the nearer end.

(Aside: of course, you can use superposition if you break the line into infinitely many point charges, then use Coulomb's formula for each of them. The point is this is more effort.)

Summary

In the cases where Gauss' law is useful - it tends to be because the total $$\vec{E}$$ is highly symmetric. The choice of Gaussian surface normally only encloses a fraction of the total charge however, and that charge would produce a low symmetry electric field. Thus whilst superposition renders both versions of Gauss' law in integral form correct, the one the OP proposes seems not very useful.