Skip to content
Tutorials Center
My learning

Topics

Lesson 8 of 49 · Vector Calculus and Electrostatics

Gauss's law

Understand electric flux and Gauss's law, derive it from Coulomb's law, and use symmetry to find fields of spheres, lines and planes, with numeric checks.

Gauss's law is one of the most elegant statements in physics. It says that if you draw an imaginary closed surface anywhere in space and add up how much electric field pokes out through it, the answer depends only on the charge inside. Not on its position, not on the charges outside, not on the shape of the surface. In situations with enough symmetry this turns a hard integral into one line of algebra.

Three panels: sphere with a spherical Gaussian surface, a line charge with a cylinder, and a plane with a pillbox, each with the resulting field formula
Caption: Pick the Gaussian surface that matches the symmetry and the field falls out of a one-line calculation.

What you will learn

  • The definition of electric flux and the statement of Gauss's law in integral and differential form.
  • Why Gauss's law follows from the 1/r² form of Coulomb's law.
  • A procedure for using Gauss's law with spherical, cylindrical and planar symmetry.
  • When Gauss's law does not help, and what to do instead.

Key terms

  • Electric flux Φ: Φ = ∮ E · dA, the field passing outward through a surface (N·m²/C).
  • Gaussian surface: an imaginary closed surface you choose for convenience.
  • Enclosed charge Q_enc: the total charge inside the surface.
  • Solid angle: the 3D analogue of an angle; the full sphere has 4π steradians.
  • Symmetry: the field looks the same after a rotation or translation of the source.

Flux and the law

The flux through a small piece of surface of area dA with outward normal n̂ is E · n̂ dA. Adding over a closed surface gives the total outward flux. Gauss's law states:

∮ E · dA = Q_enc / ε₀

Apply the divergence theorem to the left side and write Q_enc = ∫ ρ dV on the right. Since this holds for every volume, the integrands must agree:

∇·E = ρ / ε₀

That is the differential form, the first Maxwell equation. It tells you every charge is a source of field with strength ρ/ε₀ per unit volume.

Why it works

For a point charge Q at the center of a sphere of radius r, the field is radial and has constant magnitude on the sphere, so the flux is E · 4πr² = (kQ/r²)(4πr²) = 4πkQ = Q/ε₀. The r cancels: that is exactly because Coulomb's law is 1/r². (An exponent of 2.0001 would break Gauss's law, which is why it is a precision test of the inverse-square law.)

For a surface of any shape around Q, each small area dA subtends a solid angle dΩ = dA cosθ / r², and the flux through it is (kQ/r²) dA cosθ = kQ dΩ. Summing over all directions gives kQ · 4π = Q/ε₀ again. Lines leaving through any surface are the same lines that would leave a sphere. If the charge is outside, every line that enters also leaves, so the flux is zero. By superposition, the law holds for any collection of charges.

Using Gauss's law with symmetry

Gauss's law is always true but only useful for finding E when symmetry lets you pull E out of the integral. The method:

  1. Decide the direction of E from the symmetry (radial for a sphere, perpendicular to the axis for a line, perpendicular to the sheet for a plane).
  2. Choose a Gaussian surface on which E is either constant and parallel to dA, or perpendicular to dA (no flux).
  3. Compute Q_enc.
  4. Solve E · (area) = Q_enc / ε₀.

Spherical symmetry: a uniform sphere

A solid insulating sphere of radius R and total charge Q has uniform density ρ = 3Q / (4πR³).

  • Outside (r > R): enclosed charge is Q, so E = kQ / r², exactly as if all the charge were at the center. (Newton's shell theorem has the same form.)
  • Inside (r < R): enclosed charge is Q (r/R)³, so E · 4πr² = Q r³/(ε₀ R³) and E = kQ r / R³, growing linearly with r.

For Q = 2 nC and R = 10 cm: at r = 5 cm, E ≈ 899 N/C; at the surface, E ≈ 1798 N/C. For a thin spherical shell of charge, E is zero inside (no enclosed charge) and kQ/r² outside; a jump of σ/ε₀ occurs across the surface.

Cylindrical symmetry: an infinite line

Take a coaxial can of radius s and length L. Flux goes only through the curved side, area 2πsL; enclosed charge is λL, so E · 2πsL = λL/ε₀ and E = λ / (2πε₀ s) = 2kλ/s. It matches the finite-rod integral of the last lesson as L → ∞, but now without any integration.

Planar symmetry: an infinite plane

A pillbox of face area A straddling a sheet with charge density σ has flux 2EA (through the two faces; the sides have none), enclosed charge σA, so E = σ / (2ε₀), pointing away from the plane on both sides. For σ = 1 nC/m², E is about 56 N/C. Two parallel sheets of opposite charge give zero field outside and σ/ε₀ between them: this is the ideal parallel-plate capacitor.

When Gauss's law does not help

For a finite rod, a ring, a cube, or a dipole there is not enough symmetry to find a surface where E is constant. Gauss's law is still true there, it just does not reveal E by itself. You would use the direct integral from the previous lesson, or the potential in the next.

Common misconceptions

  • "The field on the Gaussian surface comes only from the enclosed charge." The field at each point includes contributions from all charges, inside and outside. Only the flux depends on the enclosed charge alone; outside charges contribute zero net flux.
  • "Gauss's law only works for spheres." It holds for any closed surface; we only choose spheres, cylinders and pillboxes because they match the symmetry.
  • "Zero flux means zero field." A uniform field passes through a closed surface with equal in and out flux, so the net is zero while E is nonzero.

Try it

The first example numerically integrates the flux of a point-charge field over a cube, with the charge inside and then outside. The second plots the field of a uniformly charged sphere and a thin shell.

Python Numeric check of Gauss's law with an off-center charge

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Python Field of a uniform sphere and a thin shell

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 6 questions

of 6 answered You scored / 6 · perfect!

  1. 1. A closed surface encloses charges +3 nC and −1 nC. What is the net flux through it?

    Gauss's law uses the net enclosed charge: 3 − 1 = 2 nC.
  2. 2. A thin spherical shell carries charge Q. What is the field inside?

    A Gaussian sphere inside encloses no charge, so by symmetry E = 0.
  3. 3. The field of an infinite plane of charge, with density σ, at distance d is

    The pillbox calculation has no d dependence.
  4. 4. Which Gaussian surface is best for a long straight charged wire?

    The field is radial from the axis, so a coaxial cylinder has constant E on its side and zero flux through the ends.
  5. 5. For a uniform sphere, the field inside at radius r is proportional to

    Enclosed charge grows as r³ and the area as r², so E grows as r.
  6. 6. Gauss's law relies on which feature of Coulomb's law?

    With an exponent other than 2 the r would not cancel and the flux would depend on the surface.

Summary

  • Gauss's law: ∮E·dA = Q_enc/ε₀, or ∇·E = ρ/ε₀ locally.
  • It follows from the inverse-square law via solid angles, and holds for any closed surface.
  • With symmetry, choose a surface with constant E: point/sphere kQ/r², line 2kλ/s, plane σ/2ε₀.
  • Uniform sphere: E = kQr/R³ inside and kQ/r² outside; a shell has zero field inside.
  • Gauss's law always holds but only solves for E when symmetry is high.

Next: Electric potential