Section 3.2 · Topic 3 of 7

3.2.3 Gauss's law

Interactive: Gaussian Surface Lab

We have found that the outward flux through a closed surface enclosing a point charge is equal to the charge itself, and that a charge outside contributes nothing. Two more steps take us to the general law: (1) many point charges, by superposition, and (2) continuous charge distributions, by turning the sum into an integral. A third step then gives the law at a single point.

Several point charges

Consider arbitrarily distributed point charges , some inside and some outside it (Figure 3.2.6). By the superposition principle of Section 3.1 the total field is the sum of the individual fields, , and the flux, being an integral, is additive too:

By Eq. (3.2.8) each term equals if is inside and zero otherwise. Hence

Charges outside (in the figure , and ) contribute nothing to the flux: every field line of theirs that enters also leaves it. They do, of course, contribute to the field at the points of . It is only the net flux of their field that vanishes.

Point charges inside and outside a closed surface S. Only q_2, q_3 and q_5 are inside, so \oint_S\vec D\cdot d\vec S=q_2+q_3+q_5. The outside charges change \vec D on S, but not the net flux.
Figure 3.2.6. Point charges inside and outside a closed surface . Only , and are inside, so . The outside charges change on , but not the net flux.

Figure 3.2.7 shows the same bookkeeping on computed field lines. Two charges, and , are drawn with lines that each carry the same amount of flux, , so that sends out 12 lines. Six of them end on and six escape to infinity. Counting the crossings of four closed surfaces reproduces Gauss's law line by line.

Gauss's law by counting (computed field lines of +2q and -q in a plane through both charges. The field is symmetric about the line joining them, and the lines were started from +2q so that each carries the same flux q/6). Every closed surface reports exactly the charge it encloses: the lines from +2q that end on -q never leave S_3 for good, and the empty surface S_4 is crossed once inward and once outward.
Figure 3.2.7. Gauss's law by counting (computed field lines of and in a plane through both charges. The field is symmetric about the line joining them, and the lines were started from so that each carries the same flux ). Every closed surface reports exactly the charge it encloses: the lines from that end on never leave for good, and the empty surface is crossed once inward and once outward.
surfaceencloseslines outlines innet flux
120
06
and 60
nothing11
Common mistake · Total charge instead of enclosed charge

Writing with the total charge of the problem. The right-hand side is the charge inside only. In Figure 3.2.7, using the total charge for the surface would give the wrong flux instead of .

Continuous charge distributions: the integral form

Next, consider charge distributed continuously in a volume with volume charge density (Figure 3.2.8). An element carries the charge , which acts as a point charge, and summing Eq. (3.2.9) over all elements turns the sum into an integral:

where is the closed surface bounding . If line or surface charges are present inside , their contributions and are added to the right-hand side. In every case the right-hand side is simply the total charge enclosed by , which we shall often write as .

A volume V, bounded by the closed surface S, containing a volume charge density \rho_v. Each element dV is a point charge \rho_v\,dV, and adding their fluxes gives \int_V\rho_v\,dV.
Figure 3.2.8. A volume , bounded by the closed surface , containing a volume charge density . Each element is a point charge , and adding their fluxes gives .
Quick check

A closed surface contains a and a point charge, and a charge sits just outside it. What is the outward flux of ? Does the charge change on the surface?

(net flux into the surface). The charge does change at every point of the surface, but its lines enter and leave, so it does not change the net flux.

The differential form

The integral form (3.2.10) is a statement about a whole region. We now shrink the region to a point, in two steps: (1) convert the surface integral into a volume integral with the divergence theorem, and (2) argue that two volume integrals that agree for every volume must have equal integrands.

Step 1

Gauss's theorem (the divergence theorem) of Section 2.4, which holds for any continuously differentiable vector field, states

Using it on the left-hand side of Eq. (3.2.10) and moving everything to one side,

Step 2

This must hold for every volume , however small and wherever it is placed. If the integrand were different from zero at some point, say positive, then by continuity it would be positive in a small ball around that point, and the integral over that ball would be positive, a contradiction. The integrand therefore vanishes everywhere, and we obtain Gauss's law in differential form, .

The same conclusion follows directly from the definition of the divergence as flux per unit volume (Section 2.2), : applying Eq. (3.2.10) to a small volume gives a flux , and the limit is .

Gauss's law

In free space , so equivalently and .

Move and resize the Gaussian surface below: the numerically integrated flux changes only when a charge crosses the surface, never when the surface is merely deformed or moved with the same charges inside.

InteractiveLoading simulation…
In plain words

Integral form: the flux out of any closed surface equals the charge inside it. Differential form: at every point, field lines are created where there is positive charge (), absorbed where there is negative charge (), and simply pass through where there is none (). In the river picture of Section 2.2, charges are the springs (sources) and the drains (sinks) of the field.

Equation (3.2.12) is the second fundamental equation of electrostatics. The first, (or ), will be derived in Section 3.3 together with the electrostatic potential. The two together determine the electrostatic field. Gauss's law alone fixes only the divergence of , which is why it can compute a field only when symmetry supplies the missing information (Section 3.2.4).

Quick check

At a point P in empty space . Does that mean at P?

No. only says that no field lines begin or end at P. Lines may still pass through P. Next to a point charge, for example, but for every .

Gauss's theorem is mathematics, Gauss's law is physics

It is worth pausing on the difference between the two "Gauss" statements we have used. In Section 2.4 we verified for a given vector field on a cube (Example 2.4.2) and on a sphere (Example 2.4.3): the divergence theorem is a mathematical identity, true for any sufficiently smooth vector field. Gauss's law adds the physical statement that the only sources of are charges, : the flux out of any closed surface counts the charge inside it, and nothing else. Figure 3.2.9 summarises the content of the law.

(a) A charge inside a cube.
(a) A charge inside a cube.
(b) Three closed surfaces around (and beside) one charge. The picture of Gauss's law. (a) The flux of \vec D out of a cube containing a charge q is q. (b) Every closed surface enclosing the charge (S_1, S_2) carries the same outward flux q, while a surface that does not enclose it (S_3) has zero net flux.
Figure 3.2.9. (b) Three closed surfaces around (and beside) one charge. The picture of Gauss's law. (a) The flux of out of a cube containing a charge is . (b) Every closed surface enclosing the charge (, ) carries the same outward flux , while a surface that does not enclose it () has zero net flux.
  • counts the field lines crossing : outward crossings count , inward crossings .
  • Charge inside: all the lines of leave the surface, and the flux is , whatever the shape or size of (, in the figure).
  • Charge outside (): every line that enters also leaves, and the flux is zero.
  • Where there is no charge, : field lines are neither created nor destroyed. They begin on positive charges and end on negative charges (or at infinity).

← Back to Section 3.2 contents

Electromagnetic Fields and Waves · Prof. Gökhan Çınar© 2026 Gökhan Çınar. All rights reserved. Copyright