Gauss’ Law

Gauss’ law connects the electric field on a closed boundary to the net charge inside it. If we imagine field lines flowing out of or into an imaginary box: the net flow depends only on the enclosed charge.

Gauss’ law can be difficult to understand because it often (for an early physics student) requires two layers of abstraction away from what “feels intuitive”:

  • Rather than discussing the attractive/repulsive Coulomb interaction between charges, we are describing the effect of charges on an abstract vector field embedded in spacetime.

  • We are making statements about the structure of this field using imaginary surfaces.

Before continuing, build intuition for the first layer of abstraction. You should be comfortable representing the electric field as both a vector field (a vector giving the field at each point in space) and a field-line sketch (continuous curves whose tangents follow the field direction). Ideally, you can also compute the electric field for a finite collection of point charges.

Big Picture

A Gaussian surface is an imaginary closed boundary surrounding a volume of space, such as the surface of a sphere or all six faces of a box. It is purely a theoretical construction and has no effect on the electric field, charges, etc.

For now, read electric flux as a (signed) measure of how much field passes through a Gaussian surface. Although the electric field is not a flowing substance, like the water in a river, you may consider this analogy when applying Gauss’ Law. The total flux considers outward-flowing contributions as positive, which are shaded in red below. Likewise, inward-flowing flux is considered negative and shaded in blue.

To avoid clutter, the electric field vectors are only shown at points along the Gaussian surface. The vector arrows only shown direction, but the magnitude can be inferred by the shading.

Gauss’ Law Explorer

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

Try these comparisons, watching both the enclosed charge and total flux values:

  • Drag a charge across the boundary.
  • Compare Centered charge and Off-center charge. The field pattern and surface shading change, but the enclosed charge and total flux stay the same.
  • Change the surface’s shape and size while keeping the same charge enclosed. The boundary samples different parts of the field, yet its total flux stays fixed.
  • Compare External charge and Enclosed dipole. Both have zero net enclosed charge and zero total flux, even though the field is nonzero. Inward and outward contributions cancel.

The details under Inspect patches and edit charges are available when you are ready. First, let’s develop the mathematical language for computing the electric flux through each small piece of the surface.

Surface Normals

To measure how much field passes through a surface, we need its component perpendicular to that surface. A normal vector is an arrow perpendicular to a surface; a unit normal, n^\hat{\mathbf n}, has magnitude one and specifies its orientation. A flat surface has two possible normal directions. Choose one: field along that direction contributes positive flux, and field opposing it contributes negative flux.

For a flat surface in a uniform field,

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

where EE is the field magnitude, AA is the area, θ\theta is the angle between the field and the chosen normal, and ΦE\Phi_E denotes electric flux. Flux has units of N⋅m2/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=E⋅A.\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:

ΦE≈∑iEi⋅n^i ΔAi⟶ΦE=∫SE⋅dA.\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.

Here Ei\mathbf E_i is the field at patch ii, n^i\hat{\mathbf n}_i is its unit normal, and ΔAi\Delta A_i is its area. The integral over the surface SS is the limit of that sum as the patches become small, with dA=n^ dAd\mathbf A=\hat{\mathbf n}\,dA the infinitesimal area vector and E\mathbf E the field at that point.

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

Now that we have a mathematical definition of electric flux, we can state Gauss’ law:

∑surface(E⋅n^)ΔA=∮SE⋅dA=Qenclosedε0.\sum_\text{surface} (\mathbf E\cdot \mathbf{\hat{n}}) \Delta A = \oint_S \mathbf E\cdot d\mathbf A =\frac{Q_{\mathrm{enclosed}}}{\varepsilon_0}.

The sum is over the entire surface, chopped up into little pieces of area ΔA\Delta A. Note that the electric field and normal vector can be different at every point along the surface. More compactly, we write it as a closed surface integral. QenclosedQ_{\mathrm{enclosed}} is the net charge inside inside the surface, and ε0≈8.85×10−12 C2/(N⋅m2)\varepsilon_0\approx8.85\times10^{-12}\ \text{C}^2/(\text{N}\cdot\text{m}^2) is the electric constant. It is related to Coulomb’s constant by k=1/(4πε0)k=1/(4\pi\varepsilon_0).

This is the precise version of the relationship you explored above. Return to the explorer, and switch on outward normals and inspect patches. The shading and patch readout describe the signed normal component E⋅n^\mathbf E\cdot\hat{\mathbf n}. The corresponding flux of the patch is then scaled by its area.

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=kQr2 4π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.

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 +3 nC+3\,\text{nC} and −1 nC-1\,\text{nC}. A +5 nC+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=(3−1) nC=2×10−9 C,ΦE=2×10−98.85×10−12≈226 N⋅m2/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.20 mR=0.20\,\text{m} carries a uniformly distributed charge Q=8 nCQ=8\,\text{nC}. Find the field at r=0.10 mr=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=8 nC(0.100.20)3=1 nC,E≈(9×109)(1×10−9)(0.10)2=900 N/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 σ=4 nC/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×10−92(8.85×10−12)≈226 N/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 Checkpoint1 of 5

What happens when you draw a different Gaussian surface around the same fixed charges?