Case Study 1 — Gauss's Law and the Field of a Charged Sphere

Field: Electrostatics / physics. How the Divergence theorem turns an impossible-looking surface integral into a one-line calculation, and how it produces the most-used equation in introductory electromagnetism.

The problem an engineer actually faces

A capacitor designer needs the electric field around a small spherical conductor. A medical-imaging physicist needs the field inside a uniformly charged ball of tissue-equivalent gel. A semiconductor engineer needs the field in a doped region modeled as a uniform charge cloud. In every case the question is the same: given how much charge sits where, what is the electric field everywhere?

The honest definition of the field is a nightmare. Coulomb's law says each tiny piece of charge $dq$ at position $\mathbf{r}'$ contributes a field $\dfrac{1}{4\pi\varepsilon_0}\dfrac{dq}{\|\mathbf{r}-\mathbf{r}'\|^2}$ pointing away from it, and the total field is the vector sum (integral) of all those contributions. For a continuous charge distribution that is a triple integral of a vector-valued, singular integrand — the kind of thing you would hand to a computer and hope. Yet a first-year physics student computes the field of a charged sphere in two lines. The trick that collapses the nightmare is the Divergence theorem of §37.4.

Step 1 — From Coulomb to Gauss

The bridge is Gauss's law, which §37.7 derived as the Divergence theorem applied to the electric field. Its integral form says the flux of $\mathbf{E}$ out of any closed surface equals the charge enclosed, divided by $\varepsilon_0$:

$$\oiint_{\partial E}\mathbf{E}\cdot d\mathbf{S} = \frac{Q_{\text{enc}}}{\varepsilon_0}.$$

Why is this true? Start from the experimental fact that a point charge $q$ produces $\mathbf{E} = \dfrac{q}{4\pi\varepsilon_0}\dfrac{\mathbf{r}}{\|\mathbf{r}\|^3}$. Push it through a sphere of radius $R$ centered on the charge. On that sphere the outward unit normal is $\mathbf{n} = \mathbf{r}/R$, and $\|\mathbf{r}\| = R$, so

$$\mathbf{E}\cdot\mathbf{n} = \frac{q}{4\pi\varepsilon_0}\frac{\mathbf{r}}{R^3}\cdot\frac{\mathbf{r}}{R} = \frac{q}{4\pi\varepsilon_0}\frac{R^2}{R^4} = \frac{q}{4\pi\varepsilon_0 R^2}.$$

This is constant over the sphere, so the flux is that constant times the sphere's area $4\pi R^2$:

$$\oiint_{\partial E}\mathbf{E}\cdot d\mathbf{S} = \frac{q}{4\pi\varepsilon_0 R^2}\cdot 4\pi R^2 = \frac{q}{\varepsilon_0}.$$

The radius cancelled completely. Notice what this means: the flux is $q/\varepsilon_0$ no matter how big the sphere is — and, because the field is divergence-free away from the charge, no matter what shape the surface is. The inverse-square law and the way surface area grows as $R^2$ conspire to make flux a pure measure of enclosed charge.

A subtlety worth flagging (it is the §37.5 pitfall). You cannot apply the Divergence theorem to the solid ball containing the point charge, because $\mathbf{E}$ blows up at the origin and $\nabla\cdot\mathbf{E}$ is not defined there. The point charge is a genuine singularity. The nonzero flux $q/\varepsilon_0$ is exactly the divergence theorem's way of reporting "there is a source inside that I cannot see by integrating a smooth divergence." The honest bookkeeping uses the Dirac delta: $\nabla\cdot\mathbf{E} = q\,\delta(\mathbf{r})/\varepsilon_0$.

Step 2 — The uniformly charged ball

Now the real engineering case: a ball of radius $R$ carrying a uniform charge density $\rho_0$ (total charge $Q = \rho_0\cdot\tfrac{4}{3}\pi R^3$). Here the field is smooth everywhere, the Divergence theorem applies cleanly, and symmetry does the rest.

By spherical symmetry, $\mathbf{E}$ must point radially and depend only on the distance $r$ from the center: $\mathbf{E} = E(r)\,\hat{\mathbf{r}}$. Choose a Gaussian surface: an imaginary sphere of radius $r$ centered on the ball. On it, $\mathbf{E}\cdot\mathbf{n} = E(r)$ is constant, so the flux is simply $E(r)\cdot 4\pi r^2$. Gauss's law then reads

$$E(r)\cdot 4\pi r^2 = \frac{Q_{\text{enc}}(r)}{\varepsilon_0}.$$

Everything now hinges on how much charge the Gaussian surface encloses, and that depends on whether we are inside or outside the ball.

Outside ($r > R$). The Gaussian sphere encloses the entire charge $Q$:

$$E(r) = \frac{Q}{4\pi\varepsilon_0 r^2}.$$

From outside, a uniform ball is indistinguishable from a point charge at its center — exactly the inverse-square field. This is the electrostatic cousin of Newton's shell theorem for gravity.

Inside ($r < R$). The Gaussian sphere encloses only the charge within radius $r$:

$$Q_{\text{enc}}(r) = \rho_0\cdot\frac{4}{3}\pi r^3.$$

So

$$E(r)\cdot 4\pi r^2 = \frac{\rho_0\cdot\frac{4}{3}\pi r^3}{\varepsilon_0} \quad\Longrightarrow\quad E(r) = \frac{\rho_0\,r}{3\varepsilon_0}.$$

Inside the ball the field grows linearly from zero at the center, then peaks at the surface and falls off as $1/r^2$ outside. At $r = R$ the two formulas agree — using $Q = \rho_0\cdot\tfrac{4}{3}\pi R^3$, the outside formula gives $E(R) = \rho_0 R/(3\varepsilon_0)$, matching the inside formula. The field is continuous, as it must be.

Step 3 — Confirming the differential form

The differential form of Gauss's law (§37.7) says $\nabla\cdot\mathbf{E} = \rho/\varepsilon_0$. Let us verify it inside the ball, where $\mathbf{E} = \dfrac{\rho_0}{3\varepsilon_0}\langle x, y, z\rangle$ (since $r\,\hat{\mathbf{r}} = \langle x,y,z\rangle$). The divergence is

$$\nabla\cdot\mathbf{E} = \frac{\rho_0}{3\varepsilon_0}\,(1 + 1 + 1) = \frac{\rho_0}{\varepsilon_0}.$$

It matches exactly. The Divergence theorem and the pointwise law are two views of one fact: the integral version (a Gaussian surface) is what you use to compute the field when symmetry is present; the differential version is what you feed into Poisson's equation $\nabla^2 V = -\rho/\varepsilon_0$ to solve geometries with no symmetry at all.

Why this matters beyond the textbook sphere

The maneuver — replace an intractable Coulomb sum with a flux through a cleverly chosen surface — is one of the most leveraged ideas in applied physics. It also extends, byte for byte, to gravity (Newton's $\mathbf{g}$ obeys the same law with mass density in place of charge) and to steady heat flow and incompressible fluid flow. Whenever a field is sourced by a density and falls off as inverse-square, the Divergence theorem turns "integrate over the whole interior" into "measure the flux through the boundary," and symmetry finishes the job.

For non-symmetric distributions, the same theorem powers the numerics. A finite-volume electrostatics solver tiles space into cells and enforces $\oiint_{\partial\text{cell}}\mathbf{E}\cdot d\mathbf{S} = Q_{\text{cell}}/\varepsilon_0$ on each one (§37.6). Because the flux leaving one cell enters its neighbor, total charge is conserved exactly — the discrete Divergence theorem (§37.11) is built into the solver's bones. The two-line undergraduate calculation and the million-cell industrial simulation rest on the same theorem.

Discussion Questions

  1. Surface choice. In Step 2 we chose a sphere as the Gaussian surface. What property of the field made a sphere the only sensible choice, and why would a cube fail to simplify the flux integral even though Gauss's law is still true for it?

  2. The singularity. Explain in your own words why the Divergence theorem cannot be applied to the solid ball around a point charge, yet Gauss's integral law still gives the correct flux $q/\varepsilon_0$. What is the integral law "seeing" that the naive volume integral of $\nabla\cdot\mathbf{E}$ misses (§37.5)?

  3. Continuity at the boundary. We checked that the inside and outside fields agree at $r = R$. Should the field always be continuous across a charged surface? Investigate what happens at an idealized infinitely thin charged shell and reconcile it with the smooth-ball result.

  4. Cross-theorem. Gauss's law for magnetism says $\oiint\mathbf{B}\cdot d\mathbf{S} = 0$ for every closed surface. Using §37.9, explain why this forces $\mathbf{B}$ to be the curl of a vector potential, and contrast this with the electric case where the flux is nonzero.

Annotated Reading

  • Griffiths, Introduction to Electrodynamics, Ch. 2 (Electrostatics). The canonical treatment of Gauss's law; the charged-ball calculation appears as a worked example. Griffiths is unusually explicit about when the flux integral simplifies and why symmetry is essential.
  • Stewart, Calculus: Early Transcendentals, §16.9 (The Divergence Theorem). The mathematical engine of this case study, with the inverse-square-field flux computed as a guided exercise. See appendices/appendix-h-stewart-chapter-mapping.md.
  • OpenStax, Calculus Volume 3, §6.8 (The Divergence Theorem). Free, with the Gauss's-law application stated explicitly. See appendices/appendix-i-openstax-chapter-mapping.md.
  • Chapter 38 of this book. Where Gauss's law becomes one case of $\int_{\partial M}\omega = \int_M d\omega$ — the same equation that contains the Stokes-theorem circulation of Case Study 2.