Gauss’ Law

When representing the electric field using a field line diagram, we can imagine the field lines “flowing out of” positive charges and “flowing into” negative charges. If you then enclose a region of space with a box, you can then begin counting the number of field lines flowing into/out of the box. It turns out this counting procedure is deeply connected to the charges within the box.

Gauss’ law makes this flowy analogy formal by connecting electric flux through a closed surface to the net charge inside the surface.

Electric flux measures how much electric field “passes through” a surface. The field itself is not a flowing substance; we are actually determining the field component perpendicular to the surface.

For a flat surface in a uniform field,

ΦE=EAcosθ,\Phi_E = EA\cos\theta,

where AA is the area and θ\theta is the angle between the electric field and the surface’s normal — an arrow perpendicular to the surface. Flux has units of Nm2/C\text{N}\cdot\text{m}^2/\text{C}.

normal n̂E →

θ = 30° · Field points through the surface

E = 100N/CΦ = EA cos θ = 173N·m²/C
Measure θ from the normal arrow, which is perpendicular to the surface.

When the normal points along the field, θ=0\theta=0 and ΦE=EA\Phi_E=EA. When the field runs along the surface, θ=90\theta=90^\circ and the flux is zero. Reversing the normal reverses the sign of the flux.

Why does the cosine appear?

Only the perpendicular component EcosθE\cos\theta contributes. Equivalently, the area presented to the field is the projected area AcosθA\cos\theta. Multiplying either way gives ΦE=EAcosθ\Phi_E=EA\cos\theta.

We can package the area and orientation into an area vector, A=An^\mathbf A=A\hat{\mathbf n}. The same relation is the dot product

ΦE=EA.\Phi_E=\mathbf E\cdot\mathbf A.

If the field varies or the surface curves, divide the surface into tiny patches, each with its own normal, and add their contributions:

ΦEiEin^iΔAiΦE=SEdA.\Phi_E\approx\sum_i \mathbf E_i\cdot\hat{\mathbf n}_i\,\Delta A_i \quad\longrightarrow\quad \Phi_E=\int_S \mathbf E\cdot d\mathbf A.

The integral is the limit of that sum as the patches become small.

Closing the Surface

A closed surface surrounds a volume completely, like the six faces of a box or the surface of a sphere. For a closed surface, we choose every normal to point outward. A field pointing out contributes positive flux; a field pointing in contributes negative flux.

In a uniform field, a box has just as much inward flux as outward flux. Inspect its faces below, then change the field’s direction.

normal

Each face has area 4 m² · E = 100 N/C

Right (+x) = 400N·m²/CNet flux = 0N·m²/C
Red: outward (+) Blue: inward (-).

The net flux is zero even though the field is nonzero on the surface and throughout the box. Zero net flux means the signed contributions cancel; it does not mean there is no field.

Charge Inside, Flux Outside

Gauss’ law states that

SEdA=Qenclosedε0.\oint_S \mathbf E\cdot d\mathbf A =\frac{Q_{\mathrm{enclosed}}}{\varepsilon_0}.

The circle on the integral reminds us to include the entire closed surface. QenclosedQ_{\mathrm{enclosed}} is the net charge inside, including both signs, and ε08.85×1012 C2/(Nm2)\varepsilon_0\approx8.85\times10^{-12}\ \text{C}^2/(\text{N}\cdot\text{m}^2) is the vacuum permittivity. It is related to Coulomb’s constant by k=1/(4πε0)k=1/(4\pi\varepsilon_0).

The Gaussian surface is an imaginary boundary used for this calculation. It is not a conducting shell, and drawing or resizing it does not change the field.

How does this agree with Coulomb’s law?

Place a point charge QQ at the center of a sphere of radius rr. Its field is radial, so the normal component everywhere on the sphere is kQ/r2kQ/r^2. The sphere has area 4πr24\pi r^2, giving

ΦE=kQr24πr2=4πkQ=Qε0.\Phi_E=\frac{kQ}{r^2}\,4\pi r^2 =4\pi kQ =\frac{Q}{\varepsilon_0}.

The inverse-square decrease in the field exactly balances the increase in area. A larger sphere has the same total flux. The sign of QQ determines whether the net flux is outward or inward.

This calculation shows the spherical case. The full law applies to any closed surface: changing its shape redistributes the local contributions without changing their sum, as long as no charge crosses the boundary.

What about charges outside the surface?

An external charge can produce a strong field on a Gaussian surface. Its contributions to the total flux nevertheless cancel: some point inward and others outward. The cancellation follows from the inverse-square field and the orientation and area of the surface patches; the field strengths at the entry and exit points need not be equal.

By superposition, every charge contributes to the field E\mathbf E on the left side of Gauss’ law. Only enclosed charges contribute to the net flux on the right side. Two equal and opposite enclosed charges also give zero net flux, despite producing a nonzero field.

Gauss’ Law Explorer

Start with a centered charge, then move it off-center. The field and surface shading change, but the total flux stays the same. Try an external charge, an enclosed dipole, and different surface shapes. A charge crossing the boundary changes the enclosed charge and the total flux.

Gauss’ Law Explorer

Move charges and change the Gaussian surface. Compare enclosed charge with total electric flux.

The surface shading represents the signed normal component En^\mathbf E\cdot\hat{\mathbf n}. Hover over a patch to inspect it. A point charge exactly on the boundary makes the ordinary surface integral singular, so move it clearly inside or outside before reading the total.

Using Symmetry

Gauss’ law is true for every closed surface. It becomes a shortcut for finding EE when symmetry tells us the field’s direction and where its magnitude is constant. The trick is in identifying the symmetry of the charge distribution and then choosing a surface that matches this symmetry.

This isn’t always possible. But when it is: identify where the field is normal or tangent to the surface, simplify the flux integral, calculate the enclosed charge, and find the field.

Spherical symmetry: a charged sphere

+Q r E radial

For a spherically symmetric charge distribution, choose a concentric Gaussian sphere. The field is radial and has constant magnitude on that sphere. For positive enclosed charge,

E(4πr2)=Qenclosedε0.E(4\pi r^2)=\frac{Q_{\mathrm{enclosed}}}{\varepsilon_0}.

Outside a sphere of radius RR and total charge QQ, all its charge is enclosed, so E=kQ/r2E=kQ/r^2.

Inside a uniformly charged solid insulating sphere, only the fraction r3/R3r^3/R^3 of the charge is enclosed:

Qenclosed=Qr3R3,E=kQrR3(r<R).Q_{\mathrm{enclosed}}=Q\frac{r^3}{R^3}, \qquad E=\frac{kQr}{R^3}\quad(r<R).

The field rises linearly from zero at the center, then falls as 1/r21/r^2 outside. This differs from a conductor in electrostatic equilibrium, whose field inside the conducting material is zero.

Cylindrical symmetry: an infinite line of charge

λlength L r E outward

For an infinite straight line with uniform charge per length λ\lambda, use a coaxial cylinder of radius rr and length LL. The field is radial and constant on the curved side. It is tangent to both end caps, which contribute zero flux.

E(2πrL)=λLε0,E=λ2πε0r.E(2\pi rL)=\frac{\lambda L}{\varepsilon_0}, \qquad E=\frac{\lambda}{2\pi\varepsilon_0r}.

For positive λ\lambda, the field points away from the line; for negative λ\lambda, it points toward it. A long finite wire approximates this result near its middle when rr is small compared with its length.

Problem Solving

Net Charge and Total Flux

Problem

A closed surface encloses +3nC+3\,\text{nC} and 1nC-1\,\text{nC}. A +5nC+5\,\text{nC} charge lies outside. What is the net electric flux?

Use

ΦE=Qenclosed/ε0\Phi_E=Q_{\mathrm{enclosed}}/\varepsilon_0.

Solve

Qenclosed=(31)nC=2×109C,ΦE=2×1098.85×1012226 Nm2/C.Q_{\mathrm{enclosed}}=(3-1)\,\text{nC}=2\times10^{-9}\,\text{C}, \qquad\Phi_E=\frac{2\times10^{-9}}{8.85\times10^{-12}} \approx226\ \text{N}\cdot\text{m}^2/\text{C}.

Check

Positive net enclosed charge gives positive outward flux; the external charge affects the field but adds no net flux.

Inside a Uniformly Charged Sphere

Problem

A solid insulating sphere of radius R=0.20mR=0.20\,\text{m} carries a uniformly distributed charge Q=8nCQ=8\,\text{nC}. Find the field at r=0.10mr=0.10\,\text{m}.

Use

Qenclosed=Q(r/R)3Q_{\mathrm{enclosed}}=Q(r/R)^3 and E=kQenclosed/r2E=kQ_{\mathrm{enclosed}}/r^2.

Solve

Qenclosed=8nC(0.100.20)3=1nC,E(9×109)(1×109)(0.10)2=900N/C,Q_{\mathrm{enclosed}}=8\,\text{nC}\left(\frac{0.10}{0.20}\right)^3=1\,\text{nC}, \qquad E\approx\frac{(9\times10^9)(1\times10^{-9})}{(0.10)^2} =900\,\text{N/C},

directed radially outward.

Check

At half the sphere’s radius, the field is half its surface value, consistent with the linear dependence inside.

Field of an Infinite Sheet

Problem

An isolated infinite sheet has uniform charge density σ=4nC/m2\sigma=4\,\text{nC/m}^2. Find the field magnitude on either side.

Use

A pillbox has flux through two end caps: 2EA=σA/ε02EA=\sigma A/\varepsilon_0.

Solve

E=σ2ε0=4×1092(8.85×1012)226N/C.E=\frac{\sigma}{2\varepsilon_0} =\frac{4\times10^{-9}}{2(8.85\times10^{-12})} \approx226\,\text{N/C}.

The field points away from the positively charged sheet on each side.

Check

The arbitrary cap area cancels, and both sides contribute equally to the outward flux.

Gauss’ Law Checkpoint

A uniform electric field lies parallel to a flat surface. What is the flux through it?