Skip to content

4.2 — Gauss's Law

Chapter 4.1 ended with an observation that looked like a drawing convention: field lines from a point charge spread over a sphere of area 4\pi r^2, and the field falls off as 1/r^2, so the number of lines crossing any sphere around the charge is the same no matter how big the sphere is.

That is not a convention. It is a conservation statement, and Carl Friedrich Gauss turned it into one of the four equations that contain all of electromagnetism. Used well, it replaces a page of integration with three lines of algebra.

Flux: counting what crosses a surface

The word flux comes from the Latin for flow, and the mental picture is water. Hold a hoop in a river. How much water passes through it per second? It depends on three things: how fast the water moves, how big the hoop is, and how the hoop is tilted. Hold it face-on and you catch the maximum; turn it edge-on and you catch nothing.

Electric flux is the same count applied to field lines. For a flat area A in a uniform field \vec{E}:

\Phi_E = EA\cos\theta

where \theta is the angle between the field and the normal to the surface — the direction sticking straight out of it. Face-on means the field is along the normal, \theta = 0, \cos\theta = 1, maximum flux. Edge-on means \theta = 90° and zero flux, because the lines skim past without crossing.

Written as a dot product, and then generalised to a curved surface in a varying field by chopping it into small flat patches:

\Phi_E = \int \vec{E}\cdot d\vec{A}

Read aloud: the integral of E dot dee-A — add up, over the whole surface, the component of the field perpendicular to each small patch times that patch's area.

The units are N m²/C. Flux is not itself a physical thing you can measure with an instrument; it is a bookkeeping quantity that turns out to obey a beautifully simple rule.

The law

Take a closed surface — one with a definite inside and outside, like a balloon, not an open sheet. Then:

\boxed{\oint\vec{E}\cdot d\vec{A} = \frac{Q_{\text{enclosed}}}{\varepsilon_0}}

Read aloud: the closed surface integral of E dot dee-A equals Q-enclosed over epsilon-nought. The circle on the integral sign means the surface is closed. The convention is that d\vec{A} points outwards, so flux leaving is positive and flux entering is negative.

In words: the total electric flux out of any closed surface depends only on the charge inside it, and on nothing else at all. Not on the shape of the surface, not on where inside the charge sits, not on what other charges are outside.

The imaginary closed surface you choose is traditionally called a Gaussian surface. It is not a physical object; it is a boundary you draw in space to do the accounting.

Deriving it from Coulomb's law

Start with the simplest case: one point charge Q, and a sphere of radius r centred on it.

By symmetry the field has the same magnitude everywhere on the sphere, and it points radially outwards, which is exactly the direction of d\vec{A} at every point. So \cos\theta = 1 everywhere and E comes out of the integral:

\oint\vec{E}\cdot d\vec{A} = E\oint dA = E\cdot 4\pi r^2

Substitute Coulomb's field, E = Q/4\pi\varepsilon_0r^2:

\Phi_E = \frac{Q}{4\pi\varepsilon_0 r^2}\cdot 4\pi r^2 = \frac{Q}{\varepsilon_0}

The r^2 cancels. That cancellation is the entire content of Gauss's law, and it happens only because the field goes as 1/r^2 and area goes as r^2. If the force law were 1/r^3 or 1/r^{2.001}, there would be no Gauss's law. Experiments looking for a deviation from the exponent 2 have constrained it to within about 10^{-16}, which is one of the most precisely tested statements in physics — and it matters because in quantum field theory the exponent is exactly 2 if and only if the photon has exactly zero mass.

Now for any surface, not just a sphere. Deform the sphere into any shape you like. Where you push the surface further out, the field is weaker by 1/r^2 but the area is larger by r^2, so the flux through that patch is unchanged. Every field line that left through the sphere still leaves through the deformed surface, exactly once. The flux is the same.

Now for a charge outside the surface. Every field line that enters the surface must leave it again, because the line has to continue until it reaches a negative charge, and there is none inside. Entering counts negative, leaving counts positive, and they cancel exactly. Net flux zero.

A closed surface with field lines from an external charge passing right through it, entering on one side and leaving on the other
A charge outside the surface. Every line that enters also leaves, so the inward and outward contributions cancel exactly and the net flux is zero — even though the field is nowhere zero on the surface. Image: Wikimedia Commons.

This is worth dwelling on, because it is the most commonly misread part of the law. Zero net flux does not mean zero field. The field on that surface is large and varying. What is zero is the sum of the crossings, and Gauss's law only ever tells you about the sum.

Finally, many charges. Fields add (superposition, Chapter 4.1), so fluxes add, so the total flux is the sum of what each charge contributes: Q_{\text{in}}/\varepsilon_0 from the ones inside and zero from the ones outside.

That completes the derivation. Gauss's law is not new physics — it is Coulomb's law plus the geometry of three-dimensional space, rewritten in a form that is far more useful.

Using it: the symmetry recipe

Gauss's law is always true and only sometimes useful. It is useful when you can find a surface on which E is constant and either parallel or perpendicular to the surface everywhere, because then E pulls out of the integral and the problem collapses.

That happens in exactly three geometries:

  • Spherical symmetry — use a sphere.
  • Cylindrical symmetry (a long line or cylinder) — use a coaxial cylinder.
  • Planar symmetry (a large flat sheet) — use a box or cylinder straddling the sheet.

The recipe is always: identify the symmetry, draw the matching surface, evaluate the flux as E times an area, set it equal to Q_{\text{in}}/\varepsilon_0, solve for E.

Case 1: a charged conducting sphere

A metal sphere of radius R carries total charge Q. Find the field inside and outside.

Inside a conductor in equilibrium, E = 0 everywhere. This is worth proving rather than asserting: if there were a field inside a conductor, it would push the free electrons, and they would move. They do move — for a few picoseconds — and they keep moving until they have rearranged themselves into the configuration where the field they produce exactly cancels the applied field. Equilibrium means "the charges have stopped moving", which means "there is no field left to push them".

Now take a Gaussian sphere of radius r < R, inside the metal. The flux is zero because E is zero, so Q_{\text{in}} = 0. All the charge sits on the surface, which follows from Gauss's law alone with no further argument. It is also why like charges spreading out to the surface is not merely intuitive — it is forced.

Outside, take a sphere of radius r > R:

E\cdot 4\pi r^2 = \frac{Q}{\varepsilon_0} \quad\Longrightarrow\quad E = \frac{Q}{4\pi\varepsilon_0r^2} = \frac{kQ}{r^2}

A charged sphere looks exactly like a point charge from outside. This is the electrical version of the shell theorem that Chapter 1.9 proved for gravity with a page of calculus. Gauss's law does it in two lines, and the reason it is so much easier is that the hard geometric work has already been done once, in the derivation above.

Case 2: an infinite line of charge

A very long straight wire carries charge \lambda per unit length (lambda, the linear charge density, in C/m). Find the field at distance r.

The symmetry: the field must point straight out from the wire, radially, and its magnitude can depend only on r. It cannot have a component along the wire — the wire looks the same in both directions, so there is nothing to break the tie. It cannot depend on where along the wire you are, for the same reason.

Draw a cylinder of radius r and length L, coaxial with the wire. It has three surfaces:

  • The curved side. \vec{E} is radial and d\vec{A} is radial, so they are parallel, and E is constant over the whole surface. Flux = E(2\pi rL).
  • The two flat ends. \vec{E} is radial, which is along the end caps, so it is perpendicular to their normals. Flux = 0.

Charge enclosed: \lambda L.

E(2\pi rL) = \frac{\lambda L}{\varepsilon_0}

The L cancels — it had to, since the answer cannot depend on how much wire we arbitrarily chose to enclose:

\boxed{E = \frac{\lambda}{2\pi\varepsilon_0 r}}

Falls off as 1/r, not 1/r^2. A line charge's field dies away more slowly than a point charge's, because as you move away you are still "seeing" more of the line. This is exactly the same reason an infinite sheet's field did not fall off at all in Chapter 4.1, and the pattern is: a point gives 1/r^2, a line gives 1/r, a plane gives r^0. Each extra dimension of charge costs one power of r.

How hard was this by direct integration? Chapter 4.1's method would need you to integrate \frac{k\lambda\,dz}{(r^2+z^2)}\cdot\frac{r}{\sqrt{r^2+z^2}} from -\infty to +\infty, which requires a trigonometric substitution. Gauss's law did it without an integral sign appearing anywhere.

Case 3: an infinite sheet, and then two of them

For a sheet with surface charge \sigma, draw a small cylinder poking through it, with flat faces of area A on each side, parallel to the sheet.

By symmetry the field points straight away from the sheet on both sides, with the same magnitude. So:

  • The curved side of the cylinder contributes nothing — the field skims along it.
  • Each flat face contributes EA, and there are two of them.

Charge enclosed: \sigma A.

2EA = \frac{\sigma A}{\varepsilon_0} \quad\Longrightarrow\quad \boxed{E = \frac{\sigma}{2\varepsilon_0}}

The same answer Chapter 4.1 obtained by summing rings and doing a substitution, now in four lines. The factor of 2 in the denominator is the two faces, and forgetting it is the most common error with this problem.

Now put two sheets face to face, one carrying +\sigma and one -\sigma. This is a parallel-plate capacitor, and it is the single most useful geometry in electronics.

Between the plates, the positive sheet pushes a test charge away from itself and the negative sheet pulls it towards itself — both fields point the same way, so they add:

E = \frac{\sigma}{2\varepsilon_0} + \frac{\sigma}{2\varepsilon_0} = \frac{\sigma}{\varepsilon_0}

Outside the plates, on either side, the two fields point opposite ways and cancel exactly:

E = \frac{\sigma}{2\varepsilon_0} - \frac{\sigma}{2\varepsilon_0} = 0

\boxed{E = \frac{\sigma}{\varepsilon_0}\ \text{between},\qquad E = 0\ \text{outside}}

A uniform field in a controlled region, and nothing outside it. That is what makes the capacitor useful, and Chapter 4.3 turns it into a device that stores energy.

Two parallel charged plates with uniform field lines running straight from the positive plate to the negative plate, bulging only at the edges
The field of a parallel-plate capacitor: uniform and straight in the middle, essentially zero outside, and bulging outwards only near the edges where the infinite-sheet approximation fails. Image: Wikimedia Commons.

The curving at the edges in the figure is called fringing, and it is the price of the plates being finite. As long as the plates are much wider than their separation, fringing affects only a thin strip and the uniform-field result holds across nearly the whole area.

Case 4: a uniformly charged insulating sphere

Now a sphere of radius R made of an insulator, with charge Q spread evenly through the volume. The charge cannot move, so it does not run to the surface.

Outside, r > R: enclosed charge is all of Q, and the answer is the same as before, E = kQ/r^2.

Inside, r < R: the Gaussian sphere encloses only the fraction of the charge within radius r. Since the charge is spread evenly, that fraction is the volume ratio:

Q_{\text{in}} = Q\frac{\frac{4}{3}\pi r^3}{\frac{4}{3}\pi R^3} = Q\frac{r^3}{R^3}

E\cdot4\pi r^2 = \frac{Q r^3}{\varepsilon_0 R^3} \quad\Longrightarrow\quad E = \frac{Qr}{4\pi\varepsilon_0R^3}

\boxed{E = \frac{kQr}{R^3}\ (r<R), \qquad E = \frac{kQ}{r^2}\ (r>R)}

Inside, the field grows linearly from zero at the centre. Outside, it falls as the inverse square. The two expressions agree at r = R, where both give kQ/R^2, as they must — the field cannot jump at the surface of a continuous charge distribution.

This exact shape is what makes a charge oscillate harmonically if you drill a tunnel through a uniformly charged sphere: the restoring force is proportional to displacement, which is Hooke's law, which is simple harmonic motion (Chapter 2.1). The identical calculation for gravity gives the famous result that a tunnel through the Earth would give a 42-minute one-way trip.

Conductors, shielding and the Faraday cage

Gauss's law gives three facts about conductors in equilibrium, and together they explain a great deal of practical engineering.

1. The field inside the conducting material is zero. Proved above: charges move until it is.

2. All excess charge lies on the surface. Any Gaussian surface drawn entirely inside the metal has zero flux, so zero enclosed charge.

3. The field just outside the surface is perpendicular to it, with magnitude \sigma/\varepsilon_0. It must be perpendicular, because any component along the surface would push the surface charges sideways and they would move. For the magnitude, use a tiny cylinder with one face just inside the metal (where E = 0, contributing nothing) and one just outside (contributing EA):

EA = \frac{\sigma A}{\varepsilon_0} \quad\Longrightarrow\quad E = \frac{\sigma}{\varepsilon_0}

Note this is twice the field of an isolated sheet of the same \sigma, and the reason is that here all the flux comes out of one side instead of being shared between two.

Now the cavity result. Hollow out the conductor. Draw a Gaussian surface in the metal, surrounding the cavity. Zero flux, so zero net charge enclosed, so the cavity wall carries no net charge — and a stronger argument shows the field inside the cavity is exactly zero everywhere, not merely on average, provided the cavity itself contains no charge.

This is the Faraday cage. A conducting shell shields its interior from any external electric field, however strong. Faraday demonstrated it in 1836 by building a room lined with metal foil, sitting inside it, and having enormous discharges played over the outside while his electroscopes inside registered nothing.

The applications are everywhere. A car is a reasonable Faraday cage, which is why it is a safe place in a lightning storm — the charge flows over the metal skin, and the rubber tyres have nothing to do with it. A microwave oven's door has a metal mesh with holes a few millimetres across, which is opaque to 12 cm microwaves and transparent to 500 nm light, so you can see in while the radiation stays put. Coaxial cable has a braided shield for the same reason. Sensitive laboratory measurements are made inside screened rooms. And your phone loses signal in a lift for exactly this reason, which is the one time the effect is a nuisance.

Note the asymmetry: a cage shields against fields from outside, and it does not shield the outside from charge placed inside the cavity. Put a charge in the hole and it induces an equal and opposite charge on the cavity wall, which leaves a matching charge on the outer surface, and the field outside is exactly what it would be without the shell.

Where this shows up in your life

Lightning rods work through fact 3 above. Field lines crowd where a conductor is sharply curved, so \sigma and therefore E is largest at a point. Air breaks down at about 3\times10^6 V/m, so the air near a sharp point ionises first, providing a conducting path that guides the strike into a heavy cable and safely to earth rather than through the building. Franklin proposed this in 1750 and it is still the standard method.

Aircraft are flown into thunderstorms deliberately for certification testing, and a lightning strike to an aluminium airliner is a non-event for the passengers: the current runs over the skin and departs from a wingtip. Carbon-fibre aircraft, being far worse conductors, have conductive mesh built into the composite specifically to restore the cage.

The mesh in your microwave door and the braid in your headphone cable are both Faraday cages, and so is the metal foil bag that a new graphics card ships in.

High-voltage engineers work on live power lines from helicopters while wearing conducting suits, having first bonded themselves to the line. Once bonded, they are inside a conductor at the line's potential and there is no field across them, so hundreds of thousands of volts pass by without effect. The dangerous moment is the instant of connection, which is made with a wand at a distance.

What the next chapter fixes

Gauss's law gives fields, and fields give forces. What is missing is energy. To move a charge from one place to another against a field takes work, and that work is recoverable — which means there is a potential energy stored in a configuration of charges, exactly as there is for gravity. Chapter 4.3 defines electric potential, shows why it is measured in volts and why "voltage" is the quantity every practical circuit is actually built around, derives the capacitance of real geometries including the parallel plates just constructed, and works out how much energy a capacitor holds and where in space that energy actually sits.