Gauss's Law in Integral Form

Everything this chapter has built — fields, superposition, lines, flux — snaps together on this page into the first of Maxwell's equations. Gauss's law says that the total electric flux streaming out through any closed surface equals the net charge trapped inside, divided by ε0\varepsilon_0. Nothing else matters: not the surface's size, not its shape, not how the interior charge is arranged, not the herd of charges sitting just outside. Draw a bag around part of the universe, integrate E⋅da\mathbf{E}\cdot\mathrm{d}\mathbf{a} over the bag, and you have weighed the charge inside — a charge-meter you can deploy anywhere, made of pure geometry. The law earns its keep twice over. As a truth, it is deeper than Coulomb's law: it remains exactly valid for moving charges, for radiating fields, inside materials — regimes where the static Coulomb formula has long since failed — which is why it, and not Coulomb's law, is carved into Maxwell's equations. As a tool, it is the great labor-saver of electrostatics: for sources with enough symmetry, the flux integral collapses into "field times area," and problems that cost half a page of superposition integrals in the last article fall in two lines. The uniformly charged sphere — solved completely here, inside and out — is the flagship: outside, the sphere impersonates a point charge exactly; inside, the field grows linearly from zero. That single result powers planetary gravity calculations, nuclear models, and half of the exam problems you will ever meet. The fine print — exactly which symmetries permit the two-line magic, and the full catalog of applications — gets its own article next. Here we forge the law and swing it once.

Key takeaways
  • Gauss's law: ∮SE⋅da=Qenc/ε0\oint_S\mathbf{E}\cdot\mathrm{d}\mathbf{a} = Q_{\text{enc}}/\varepsilon_0 for every closed surface SS — net outward flux counts enclosed charge, and nothing else.
  • It follows from two ingredients already proven: the point-charge flux q/ε0q/\varepsilon_0 (shape-independent, zero if outside) and superposition — fluxes add charge by charge.
  • The E\mathbf{E} in the integral is the total field, external charges included; their flux contributions cancel, but their fields are present on the surface.
  • As a tool it needs symmetry: on a well-chosen Gaussian surface the field must be constant in magnitude and known in direction, so ∮E⋅da→E⋅A\oint\mathbf{E}\cdot\mathrm{d}\mathbf{a}\to E\cdot A.
  • Flagship result: a uniformly charged sphere gives E=Qr/4πε0R3E = Q r/4\pi\varepsilon_0R^3 inside (linear in rr) and E=Q/4πε0r2E=Q/4\pi\varepsilon_0r^2 outside — a perfect point-charge impostor beyond its surface.
  • The law is exact in full electrodynamics — it is Maxwell's first equation — while Coulomb's law is only the static special case.
  • Key idea: flux through any closed surface = enclosed charge over ε0\varepsilon_0 — geometry weighs charge, and symmetry turns the weighing into a two-line field solver.
The core insight

The net electric flux through any closed surface equals the enclosed charge divided by ε0\varepsilon_0: ∮SE⋅da=Qenc/ε0\oint_S\mathbf{E}\cdot\mathrm{d}\mathbf{a}=Q_{\mathrm{enc}}/\varepsilon_0 — exact for any surface and any charge configuration, and a two-line field solver whenever symmetry fixes the field's pattern in advance.

Where this lives today

Gauss's law runs as live machinery at every scale physics touches. Astronomers weigh the invisible with its gravitational twin: the rotation speed of stars circling a galaxy reads out the enclosed mass through exactly this article's logic, and the mismatch with visible matter — enclosed mass rising linearly while starlight runs out — is the dark-matter problem stated as a Gaussian-surface audit. Plasma and semiconductor device physicists solve for space-charge fields by imposing the law on every cell of a mesh; the "field solver" at the heart of chip-design TCAD and tokamak edge codes is Gauss's law discretized a billionfold. Metrologically, the law is the precision frontier of electromagnetism: the modern Cavendish-descended null experiments — no field inside a charged shell — hold the inverse-square exponent to within 10−1610^{-16} and cap the photon mass near 10−18 eV/c210^{-18}\ \mathrm{eV}/c^2, making Maxwell's first equation one of the most stringently verified statements in science. And every Faraday cage — the shielded room protecting an MRI scanner, the mesh in your microwave door — is the hollow-shell corollary cast in metal.

The physical picture

Think of every positive charge as a little factory extruding a fixed quota of field lines, every negative charge as a shredder consuming its quota, and empty space as strictly neutral territory where lines neither start nor stop. Now draw an imaginary closed bag — any bag — and audit the lines crossing its skin. Lines from factories inside must exit (they have nowhere else to go); lines from outside factories enter and leave in pairs, netting zero. The audit therefore reports exactly the factories-minus-shredders inside the bag, no matter how you crumple it. That audit is Gauss's law; the previous article priced each line in volt·metres, and this one signs the theorem.

Figure
One charge-meter, any bag — every closed surface around the same charges reads the same flux, and outsiders net zero
+3 −5 sphere: Φ = −2/ε₀... crumpled bag: same Φ = −2/ε₀ +7 outside: counts ZERO its lines enter… …and leave: net 0 the meter reads ONLY the inside: Qₖₙₓ = +3 − 5 = −2 (nC) ⇒ Φ = −226 V·m through both bags size, shape, interior arrangement, outside charges — all invisible to the audit

Why is this useful and not merely beautiful? Because sometimes the audit can be run in reverse. The law always tells you the flux; usually it cannot tell you the field, since infinitely many field patterns share one flux. But when symmetry dictates the field's pattern in advance — radial and equal-magnitude on a concentric sphere, say — then the one number the audit reports is enough to solve for the one unknown magnitude. That is the whole trick: the law supplies one equation, and symmetry must first reduce the field to one unknown. Sphere, infinite cylinder, infinite plane — the three symmetry families where this works — turn superposition marathons into arithmetic. Everywhere else, Gauss's law remains true and silently unhelpful, and the honest integrals of the earlier articles keep their jobs. One subtlety guards the exam gates: the E\mathbf{E} inside the integral is the total field, made by all charges in the universe — including the outsiders. The outsiders' flux cancels; their field does not. The law's magic is that the cancellation happens in the integral, not on the surface.

The law, forged and swung

The forging takes one paragraph, because the previous articles did the heavy lifting. For a single point charge, the flux through any closed surface is q/ε0q/\varepsilon_0 if the charge is inside and 00 if outside — the shape-independent result of the flux article. For many charges, the total field is the superposition E=∑iEi\mathbf{E}=\sum_i\mathbf{E}_i, and the flux integral, being linear, splits into per-charge fluxes. Add the verdicts: insiders contribute their qi/ε0q_i/\varepsilon_0, outsiders contribute nothing, and

∮SE⋅da  =  Qencε0(1)\oint_S \mathbf{E}\cdot\mathrm{d}\mathbf{a} \;=\; \frac{Q_{\text{enc}}}{\varepsilon_0} \tag{1}

where: SS is any closed surface (a Gaussian surface — imaginary, yours to choose), da\mathrm{d}\mathbf{a} points outward, and Qenc=∑insideqi=∫Vρ dτQ_{\text{enc}} = \sum_{\text{inside}}q_i = \int_{V}\rho\,\mathrm{d}\tau is the net charge in the enclosed volume. Equation (1) is exact — not a symmetric-case approximation — and it is the integral form of Maxwell's first equation. The first derivation below walks the assembly with full care, because the one-paragraph version hides two logical beats worth savoring. When symmetry cooperates, (1) becomes a solver. The working pattern, spelled once here and industrialized in the next article:

E ⋅(area where the field pierces)=Qencε0⇒E=Qencε0 A(2)E\,\cdot(\text{area where the field pierces}) = \frac{Q_{\text{enc}}}{\varepsilon_0} \quad\Rightarrow\quad E = \frac{Q_{\text{enc}}}{\varepsilon_0\,A} \tag{2}

where: the collapse from (1) to (2) is legal only after symmetry certifies, before any calculation, that on your chosen surface the field (i) points along the normal (or lies parallel to the surface, contributing zero), and (ii) has one constant magnitude wherever it pierces. Spherical symmetry delivers this on concentric spheres; infinite cylindrical symmetry on coaxial cylinders; infinite planar symmetry on straddling pillboxes. The promised one-line payoff from the continuous-distributions article: for an infinite line charge, a coaxial cylinder of radius ss and length ℓ\ell has pierced area 2πsℓ2\pi s\ell and encloses λℓ\lambda\ell, so E=λ/2πε0sE = \lambda/2\pi\varepsilon_0 s — the half-page integral of that article, reproduced by arithmetic. The full symmetry taxonomy, the pillbox, and the catalog of standard results belong to the applications article next door.

what you knowwhat Gauss's law gives youcaveat
the field everywhere on a closed SSQencQ_{\text{enc}}, exactlyalways works — the charge-meter
QencQ_{\text{enc}} + spherical symmetryE(r)E(r) in two linesfield radial, constant on concentric spheres
QencQ_{\text{enc}} + cylinder/plane symmetryEE in two linesinfinite idealizations required
QencQ_{\text{enc}}, no symmetryonly the total fluxinfinitely many fields share one flux
Derivation AAssembling Gauss's law from point-charge flux and superposition

We prove equation (1) for an arbitrary closed surface and an arbitrary collection of charges. Everything needed is already on the shelf: the flux of a single point charge through a closed surface (q/ε0q/\varepsilon_0 inside, 00 outside — the solid-angle results of the flux article), and the superposition principle (the total field is the sum of the individual fields). The strategy is to let linearity of the flux integral do all the work. The care points: making explicit that the integrand contains the total field, and extending from point charges to continuous distributions without hand-waving. Short as it is, this argument is the actual logical birth of Maxwell's first equation.

Step 1. Write the total field on the surface as a superposition. At every point of SS,

E=∑iEi\mathbf{E} = \sum_{i}\mathbf{E}_i

where the sum runs over all charges — inside and outside alike — and Ei\mathbf{E}_i is the lone-universe Coulomb field of charge ii. This is the experimentally certified linearity of the superposition article.

Step 2. Split the flux by linearity of the integral:

∮SE⋅da=∑i∮SEi⋅da\oint_S\mathbf{E}\cdot\mathrm{d}\mathbf{a} = \sum_i \oint_S\mathbf{E}_i\cdot\mathrm{d}\mathbf{a}

Why is this legal? The integral of a sum is the sum of integrals — calculus, not physics. Note what it buys: the flux of a complicated many-charge field reduces to single-charge fluxes, each of which we have already computed for arbitrary surfaces.

Step 3. Evaluate each term by the point-charge verdicts. For charge ii inside SS: ∮Ei⋅da=qi/ε0\oint\mathbf{E}_i\cdot\mathrm{d}\mathbf{a} = q_i/\varepsilon_0 (full sky, shape-independent). For charge ii outside: 00 (paired piercings cancel). Hence

∮SE⋅da=∑i ∈ insideqiε0=Qencε0\oint_S\mathbf{E}\cdot\mathrm{d}\mathbf{a} = \sum_{i\,\in\,\text{inside}}\frac{q_i}{\varepsilon_0} = \frac{Q_{\text{enc}}}{\varepsilon_0}

Why do outsiders vanish from the answer but not from the problem? Their fluxes cancel; their fields remain in the integrand at every point of SS. The law is a statement about a cancellation inside an integral — which is why it cannot, by itself, tell you the field at any point.

Step 4. Pass to the continuum. A continuous distribution is the limit of many small charges (the continuous-distributions article); each infinitesimal dq=ρ dτ\mathrm{d}q = \rho\,\mathrm{d}\tau inside contributes ρ dτ/ε0\rho\,\mathrm{d}\tau/\varepsilon_0, so Qenc=∫Vρ dτQ_{\text{enc}} = \int_V\rho\,\mathrm{d}\tau — the form used with volume charge. No step depended on the surface's shape, the charges being at rest relative to each other inside, or any symmetry whatsoever: the law is fully general. Verified: reproduces Griffiths §2.2.1 (eq. 2.13) and Jackson §1.3; the two ingredients trace to this chapter's flux article (solid-angle results, themselves verified against Zangwill §3.3) and superposition article; linearity of integration is exact.

Go deeper · Derivation B · 2 minThe uniformly charged sphere — a point-charge impostor with a linear heart
Derivation BThe uniformly charged sphere — a point-charge impostor with a linear heart

The flagship application: a solid sphere of radius RR carries total charge QQ spread uniformly (ρ=3Q/4πR3\rho = 3Q/4\pi R^3). We find E\mathbf{E} everywhere — outside, inside, and at the surface — in a few lines each, a problem that would be a genuinely painful double integral by direct superposition. The strategy is the symmetry ritual in its purest form: argue the field's pattern first (radial, magnitude depending only on rr), choose concentric spherical Gaussian surfaces, and let equation (2) do the rest. Watch the single moving part: how much charge the Gaussian surface encloses as it grows — all of QQ outside, a shrinking fraction inside.

Step 1. Symmetry first, always. The source is invariant under every rotation about its centre, so the field must be too: E\mathbf{E} can only point radially, with a magnitude depending only on rr. (Any sideways component would pick a preferred direction the source does not have.) This certifies concentric spheres as Gaussian surfaces on which ∮E⋅da=E(r)⋅4πr2\oint\mathbf{E}\cdot\mathrm{d}\mathbf{a} = E(r)\cdot4\pi r^2 exactly.

Step 2. Outside (r≥Rr\ge R). The Gaussian sphere encloses everything: Qenc=QQ_{\text{enc}} = Q. Gauss's law:

E⋅4πr2=Qε0⇒E=14πε0Qr2E\cdot4\pi r^2 = \frac{Q}{\varepsilon_0} \quad\Rightarrow\quad E = \frac{1}{4\pi\varepsilon_0}\frac{Q}{r^2}

Why is this remarkable? It is exactly the point-charge field — not approximately, not asymptotically. From outside, a uniform sphere is a perfect impostor for a point charge at its centre. (This is the electrostatic twin of Newton's shell theorem, which cost Newton a decade; Gauss's law makes it a two-line corollary.)

Step 3. Inside (r<Rr < R). The Gaussian sphere encloses only the charge within radius rr — the fraction of volume (r/R)3(r/R)^3:

Qenc=Q r3R3,E⋅4πr2=Qr3ε0R3⇒E=14πε0Q rR3Q_{\text{enc}} = Q\,\frac{r^3}{R^3}, \qquad E\cdot4\pi r^2 = \frac{Qr^3}{\varepsilon_0 R^3} \quad\Rightarrow\quad E = \frac{1}{4\pi\varepsilon_0}\frac{Q\,r}{R^3}

Why linear in rr? Enclosed charge grows as r3r^3 while the meter's area grows as r2r^2; the quotient grows as rr. At the exact centre, E=0E=0 — every direction is balanced.

Step 4. Stitch and read the profile. At r=Rr=R both formulas give E=Q/4πε0R2E = Q/4\pi\varepsilon_0R^2: continuous, with a kink (the slope changes sign) marking where new charge stops accruing. The profile — linear ramp up to the surface, inverse-square decay beyond — is one of the half-dozen most reused curves in physics: it is also the gravitational field inside a uniform planet and the classical field inside a uniformly charged nucleus. A corollary drops out free: for a hollow shell, the interior Gaussian sphere encloses nothing, so E=0E = 0 everywhere inside — perfect shielding by symmetry alone, and the working principle of the Cavendish null tests of the inverse square. Verified: matches Griffiths Example 2.3 and Problem 2.8 (eqs. 2.8–2.9 family); continuity at r=Rr=R checked; worked example 2 runs the numbers (3.6×1043.6\times10^4, 7.2×1047.2\times10^4, 1.8×1041.8\times10^4 N/C at r=R/2,R,2Rr = R/2, R, 2R for Q=80Q=80 nC, R=10R=10 cm); shell corollary matches the Cavendish-test geometry.

Figure
The flagship profile — inside the sphere the field ramps linearly from zero; outside it impersonates a point charge exactly
distance r from centre E(r) inside the sphere r = R E ∝ r (enclosed charge grows as r³, meter area as r²) E ∝ 1/r² — exact point-charge impostor peak at the surface: Q/4πε₀R² (the kink) hollow shell variant: E = 0 everywhere inside — perfect shielding, the Cavendish null-test geometry

Limiting cases

caseresultmeaning
point charge∮E⋅da=q/ε0\oint\mathbf{E}\cdot\mathrm{d}\mathbf{a}=q/\varepsilon_0the law contains its own seed
no enclosed chargeΦ=0\Phi = 0 through any closed surfacefields pass through charge-free bags untaxed
uniform sphere, r≥Rr\ge RE=Q/4πε0r2E = Q/4\pi\varepsilon_0r^2exact point impostor — shell theorem for free
uniform sphere, r<Rr<RE=Qr/4πε0R3E = Qr/4\pi\varepsilon_0R^3linear ramp; zero at the centre
hollow shell, insideE=0E = 0 everywhereshielding; the Cavendish inverse-square test
R→0R\to0 at fixed QQinside region vanishes; pure 1/r21/r^2the point charge recovered as a limit
no symmetrylaw true, field underdeterminedone equation cannot yield three components

Worked examples

1 · Reading the charge-meter (confidence builder)

A closed surface encloses charges +3.0+3.0 nC and −5.0-5.0 nC; a third charge +7.0+7.0 nC sits just outside. (a) Find the net flux through the surface. (b) What changes if the surface is deformed into a shape three times larger, still enclosing the same two charges?

Step 1. The enclosed budget: Qenc=+3.0−5.0=−2.0Q_{\text{enc}} = +3.0 - 5.0 = -2.0 nC. The +7.0+7.0 nC outsider contributes fields everywhere but zero net flux.

Step 2. Gauss's law: Φ=Qenc/ε0=(−2.0×10−9)/(8.854×10−12)=−226\Phi = Q_{\text{enc}}/\varepsilon_0 = (-2.0\times10^{-9})/(8.854\times10^{-12}) = -226 V·m.

Step 3. Read the sign: negative net flux means more field lines enter than leave — the bag holds a net shredder, as a net negative charge should be.

Step 4. Deform the surface: nothing changes. Shape, size, and the positions of the two insiders (so long as they stay inside) are all invisible to the meter: still −226-226 V·m. What would change: sliding the +7.0+7.0 nC charge inside would jump the reading to (+5.0 nC)/ε0=+565(+5.0\ \mathrm{nC})/\varepsilon_0 = +565 V·m the instant it crosses the skin.

Answer: Φ=−226\Phi = -226 V·m, independent of the surface's shape and size; the outside charge affects the field on the surface but not the flux through it.

2 · The charged sphere, numbers in (exam level)

A solid sphere of radius R=10R = 10 cm carries Q=80Q = 80 nC uniformly. Find EE at r=5r = 5 cm, at the surface, and at r=20r = 20 cm; then find where inside the field equals its value at r=20r=20 cm.

Step 1. Outside formula at r=20r = 20 cm: E=keQ/r2=(8.99×109)(80×10−9)/(0.04)=1.8×104E = k_eQ/r^2 = (8.99\times10^9)(80\times10^{-9})/(0.04) = 1.8\times10^4 N/C.

Step 2. Surface (r=Rr = R): E=keQ/R2=(8.99×109)(80×10−9)/(0.01)=7.2×104E = k_eQ/R^2 = (8.99\times10^9)(80\times10^{-9})/(0.01) = 7.2\times10^4 N/C — the profile's peak.

Step 3. Inside at r=5r = 5 cm, the linear formula: E=keQr/R3=(8.99×109)(80×10−9)(0.05)/(10−3)=3.6×104E = k_eQr/R^3 = (8.99\times10^9)(80\times10^{-9})(0.05)/(10^{-3}) = 3.6\times10^4 N/C — exactly half the surface value, as r=R/2r = R/2 demands on a linear ramp.

Step 4. The matching point. Inside, E(r)=(7.2×104)(r/R)E(r) = (7.2\times10^4)(r/R); set equal to 1.8×1041.8\times10^4: r/R=1/4r/R = 1/4, so r=2.5r = 2.5 cm. The field at 2.52.5 cm depth-from-centre equals the field at 2020 cm outside — the profile crosses each value once on the ramp and once on the tail (except the peak).

Step 5. Sanity audit: density ρ=3Q/4πR3=1.9×10−5 C/m3\rho = 3Q/4\pi R^3 = 1.9\times10^{-5}\ \mathrm{C/m^3}; a Gaussian sphere at r=5r=5 cm encloses Q(r/R)3=80×(1/8)=10Q(r/R)^3 = 80\times(1/8) = 10 nC, and ke(10 nC)/(0.05)2=3.6×104k_e(10\ \mathrm{nC})/(0.05)^2 = 3.6\times10^4 N/C. ✓ Same answer by direct enclosed-charge bookkeeping — the formula and the ritual agree.

Answer: E=3.6×104E = 3.6\times10^4 N/C at 5 cm (inside), 7.2×1047.2\times10^4 N/C at the surface, 1.8×1041.8\times10^4 N/C at 20 cm; the interior matching point for the 20 cm value is r=2.5r = 2.5 cm.

Origins · 1 minCarl Friedrich Gauss and how this was discovered
CF
Carl Friedrich Gauss
1777–1855 · Göttingen Observatory

Gauss came to flux through planets, not charges. Directing the Göttingen observatory for nearly half a century, he built the mathematics of attraction — how a body pulls when its mass is spread over a volume — and his 1813 theorem relating a field's flux through a closed surface to the sources within was proved for gravity. That the same statement governs electricity is the deepest kind of free lunch: both forces are inverse-square, and the theorem is really about inverse-square geometry, indifferent to what is doing the attracting. Legendarily exacting ("few, but ripe" was his motto for publications), Gauss left the electric version to be formalized in his 1830s potential-theory work with his young collaborator Wilhelm Weber, with whom he also built one of the first working telegraphs and mapped the Earth's magnetic field through a network of observatories — geomagnetic flux audits on a planetary Gaussian surface. Maxwell placed the law first among his equations, where it has stood ever since.

History
1687
— Newton's shell theorem: a uniform sphere attracts as if all its mass sat at the centre — the result Gauss's law makes trivial
1773
— Lagrange derives flux-source relations for gravitation, the earliest ancestor of the theorem
1813
— Gauss proves the divergence relation for inverse-square attraction in his memoir on the attraction of spheroids
1835
— Gauss formulates the flux law for electrostatics in work published posthumously (1867)
1873
— Maxwell's Treatise installs Gauss's law as the first equation of electromagnetism
1971
— Williams, Faller and Hill's null-test experiment bounds deviations from the inverse square at the 10−1610^{-16} level — Gauss's law as precision metrology

Going further

References. Griffiths, Introduction to Electrodynamics, 4th ed., §2.2.1–2.2.3 · Purcell & Morin, Electricity and Magnetism, 3rd ed., §1.10–1.13 · Jackson, Classical Electrodynamics, 3rd ed., §1.3–1.4 · Zangwill, Modern Electrodynamics, §3.3–3.4 · Feynman Lectures on Physics, Vol. II, Ch. 4–5

Provenance. The law and flagship results are standard: assembly from point-charge flux plus superposition (Griffiths §2.2.1, eq. 2.13; Jackson §1.3), uniform-sphere fields inside and outside (Griffiths Example 2.3 and Problem 2.8), shell shielding and its role in inverse-square null tests (Jackson §I.2; Williams–Faller–Hill 1971). A verifier should recompute: Φ=−226\Phi = -226 V·m for Qenc=−2Q_{\text{enc}}=-2 nC with ε0=8.854×10−12\varepsilon_0=8.854\times10^{-12} F/m; the sphere numbers E=3.6×104E = 3.6\times10^4, 7.2×1047.2\times10^4, 1.8×1041.8\times10^4 N/C at r=5,10,20r = 5, 10, 20 cm for Q=80Q=80 nC, R=10R=10 cm, and the interior matching point r=R/4=2.5r = R/4 = 2.5 cm; ρ=3Q/4πR3=1.9×10−5 C/m3\rho = 3Q/4\pi R^3 = 1.9\times10^{-5}\ \mathrm{C/m^3}; continuity of the two branches at r=Rr=R. The line-charge one-liner E=λ/2πε0sE=\lambda/2\pi\varepsilon_0s cross-checks the direct integration of the continuous-distributions article.

Builds on: Electric Flux · Superposition Principle for Electric Fields · Electric Field Lines · Continuous Charge Distributions Leads to: Gauss's Law in Differential Form · Applications of Gauss's Law and Symmetry · The Curl of the Electrostatic Field · Electrostatic Potential

Is Gauss's law more fundamental than Coulomb's law, or just a repackaging?

In electrostatics they are logically equivalent — each derives from the other — so there "repackaging" is fair. The hierarchy appears the moment charges move: Coulomb's law fails for moving and accelerating charges (fields retard, magnetic effects appear), while Gauss's law remains exactly true at every instant, radiation and all. That is why Maxwell's equations contain Gauss's law verbatim and contain Coulomb's law only as a static solution. Physicists therefore rank Gauss's law as the fundamental statement: it is the piece of inverse-square physics that survives every generalization — including, reformulated, quantum electrodynamics.

If the outside charge's flux cancels, why do textbooks insist E in the integral includes it?

Because the cancellation is a property of the integral, not of the integrand, and forgetting that distinction breaks the tool. When you attempt the symmetric collapse ∮E⋅da→E⋅A\oint\mathbf{E}\cdot\mathrm{d}\mathbf{a}\to E\cdot A, you are making claims about the integrand — that it is constant and normal over the surface. An external charge wrecks those claims even though it leaves the total flux untouched: with a big charge nearby, the field on your "symmetric" sphere is no longer uniform, the collapse is illegal, and equation (2) computes nonsense. The honest statement: Gauss's law (1) is always true with the total field; the solver (2) additionally requires that the total field respect the symmetry — which in practice means all significant charges must share it.

What exactly qualifies as a "Gaussian surface"? Do I have to build something?

Nothing is built — a Gaussian surface is a purely imaginary closed surface you draw through space wherever it pleases you, existing only in the calculation. Any closed surface works for the law; the craft is choosing one that makes the integral trivial for the tool: pass it through the points where you want the field, orient it so the field is everywhere either parallel to the normal (constant magnitude, by symmetry) or perpendicular to it (zero contribution). Concentric spheres, coaxial cylinders, straddling pillboxes — the three families that ever succeed. Two hygiene rules: it must be genuinely closed, and it should not pass exactly through a point charge or surface charge layer (where the field is undefined or discontinuous — displace it infinitesimally instead).

Does Gauss's law hold inside materials, where there are atoms and bound charges everywhere?

Yes, exactly — with QencQ_{\text{enc}} meaning all charge inside: free electrons, ions, and every microscopic bound charge of every polarized atom. That completeness is also why the vacuum form becomes awkward in matter: tracking 102310^{23} bound charges is hopeless. The dielectrics tier will define the auxiliary field D\mathbf{D} whose Gauss law counts only the free charge, letting the bound charge hide inside the definition — a bookkeeping upgrade, not a modification of physics. The vacuum law you learned here is never violated; it is merely re-dressed for crowded rooms.

The shell theorem took Newton years — why does Gauss's law get it in two lines?

Because the two-line proof spends capital that took a century to accumulate. Newton, working with pairwise forces, had to integrate the pull of every mass element of the shell over solid angles — hard calculus (legend holds it delayed the Principia). Gauss's law repackages the inverse square as flux conservation once, in full generality; after that, any spherically symmetric question reduces to bookkeeping. The moral is genuine, not rhetorical: a good conservation law is compressed calculus — you pay the integration cost one time, in the theorem, and every subsequent application rides free. The divergence theorem behind the next article is the same trade at one level higher.

Do the sphere formulas work for a sphere whose density varies with radius?

Half of them, and it is worth seeing which half. Any radial density ρ(r)\rho(r) preserves spherical symmetry, so the ritual survives: the field is radial and E⋅4πr2=Qenc(r)/ε0E\cdot4\pi r^2 = Q_{\text{enc}}(r)/\varepsilon_0 still holds, with Qenc(r)=∫0rρ(r′)4πr′2dr′Q_{\text{enc}}(r) = \int_0^r\rho(r')4\pi r'^2\mathrm{d}r' now doing real work. Outside, the impostor theorem is untouched — only total QQ matters. Inside, the linear ramp is special to uniform density: ρ∝r\rho\propto r gives E∝r2E\propto r^2, a hollow-centred profile gives interior zeros, and so on. What breaks everything is angular dependence, ρ(r,θ,ϕ)\rho(r,\theta,\phi): then no Gaussian surface carries constant field, and you are back to honest superposition. Symmetry of the source, not sphericity of the surface, is the license.

What happens if a point charge sits exactly on my Gaussian surface?

The law's premises fracture: the field diverges at the charge, the flux integral becomes improper, and "enclosed or not" is genuinely ambiguous — so the honest answer is that the configuration is ill-posed and you should move the surface infinitesimally to one side or the other, which changes the flux by the full q/ε0q/\varepsilon_0 jump. (A limiting argument gives the half-answer q/2ε0q/2\varepsilon_0 for a smooth surface through the charge — the charge subtends half the sky — a cute result occasionally asked in orals, but it depends on the surface being locally flat there.) For surface charge layers, the same care applies: Gaussian pillboxes are always drawn straddling the layer, never coincident with it — which is exactly how the field-discontinuity boundary conditions of the next tier are derived.

Before this

Where this leads