The integral theorems topic closed by making a promise: that the divergence theorem is "exactly what lets you move freely" between a local statement about a field and a global statement about flux through a closed surface, and that this move was "about to become the entire content of Gauss's law, the next stop on the electromagnetism branch of this track." This is that stop, and the promise gets kept in full — not just quoted, but actually carried out, starting from nothing but Coulomb's law and the divergence theorem already proved.
Setting up the flux integral for a point charge
Take a single point charge sitting at the origin, with field , and surround it with an imaginary sphere of radius centered on the charge — the same kind of closed surface used to verify the divergence theorem in that topic's worked example. Compute the flux of through this sphere directly. On the surface of the sphere, is the outward normal , and everywhere, so:
Every factor of canceled — the in the denominator of the field against the in the area element — leaving something that doesn't depend on the sphere's radius at all. That's already suspicious in the best way: the flux through a sphere twice as large is exactly the same. And nothing in the derivation actually used that the surface was a sphere — any closed surface enclosing the same charge, however lumpy, encloses the same total flux, because the field lines from have to pass through some closed surface around it exactly once each, regardless of the surface's shape. Defining (the permittivity of free space, a repackaging of the same constant Coulomb's law uses), this becomes:
By superposition — the same principle Coulomb's law established for combining forces from multiple charges — a surface enclosing several charges gets a flux contribution of from each one individually, so the total is:
where is the total charge enclosed by the surface — and, crucially, only the enclosed charge; any charge sitting outside contributes zero net flux, because every field line from an external charge that enters the surface on one side has to exit again somewhere else, canceling its own contribution. This is Gauss's law, and it holds for any closed surface and any charge distribution, not just the single point charge used to derive it — a claim justified rigorously in the next section, not just asserted.
The differential form, via the divergence theorem
Gauss's law as just stated is an integral relation — flux through an entire closed surface on the left, total charge on the right. The divergence theorem converts the left side into a volume integral:
Meanwhile, write the enclosed charge as the volume integral of a charge density (charge per unit volume) over the same region:
Substituting both into Gauss's law:
This has to hold for any volume you choose to draw — a tiny one around any point, a huge one, any shape at all. The only way an integral can vanish for every possible region of integration is if the thing being integrated is zero everywhere, at every single point. That gives the differential form of Gauss's law:
This is exactly the local-versus-global move the integral theorems topic previewed by name: "electric charge creates an electric field whose divergence is proportional to charge density at every point — or, in exactly equivalent language via this theorem, whose total flux through any closed surface is proportional to the total charge enclosed." Both statements — the integral one and this differential one — say the identical physics; the divergence theorem is the bridge that lets you freely choose whichever form is more convenient for the problem in front of you. And the physical picture matches what divergence itself means: electric charge is literally what makes the electric field have a source. Positive charge is a place field lines spring from; negative charge is a place they vanish into; and this equation is the precise, quantitative version of that picture.
Why this is useful: symmetry does the integral for you
Gauss's law is true always, but it is a fast tool only when the charge distribution has enough symmetry to guarantee, by an argument alone, that has constant magnitude and a known direction over some surface you get to choose — a Gaussian surface. When that's true, can be pulled outside the flux integral entirely, collapsing down to times the surface's area, and Gauss's law becomes simple algebra instead of a genuine integral. Compare this to computing the same field by direct Coulomb's-law superposition — summing (really, integrating) the contribution of every infinitesimal piece of charge, each pointing in a different direction, weighted by its own distance to the field point. For anything beyond a single point charge, that integral gets painful fast; Gauss's law, when the symmetry is there to exploit, sidesteps it completely.
Worked example
An infinitely long straight rod carries a uniform linear charge density (charge per unit length). Use Gauss's law to find the electric field at a perpendicular distance from the rod, and compare the effort to a direct Coulomb's-law integration. (click to reveal the solution)
Setting up — choosing the Gaussian surface: the charge distribution is symmetric under rotation about the rod's axis and under translation along it. Symmetry demands that point straight away from the rod (radially, in the cylindrical sense) and depend only on the perpendicular distance , not on position along the rod or angle around it — any other direction or dependence would have no symmetry reason to be there, and would have to point somewhere arbitrary that the problem itself gives no basis for choosing. This is exactly the situation Gauss's law wants: pick a cylindrical Gaussian surface of radius and length , coaxial with the rod.
Evaluating the flux, piece by piece. The cylinder has three pieces: the curved side and two flat end caps. On the end caps, the field is radial (perpendicular to the rod's axis) while the outward normal of an end cap points along the axis — the two are perpendicular to each other everywhere on the caps, so there, and the end caps contribute nothing. On the curved side, is parallel to the outward normal everywhere (both point radially outward) and constant in magnitude over the whole side by the symmetry argument above, so it factors straight out of the integral:
Applying Gauss's law. The enclosed charge is the charge per unit length times the enclosed length: . So:
The length of the Gaussian cylinder — an arbitrary choice we made — cancels from both sides, exactly as it should for a quantity ( at distance ) that can't depend on how long a surface we happened to imagine. Solving for :
Interpreting the result: the field falls off as , not — a direct consequence of the charge being spread along an infinite line rather than concentrated at a point; the extra dimension of "sourceness" changes the geometry of how the flux spreads out. Contrast this with what a direct Coulomb's-law approach would have required: integrating over every infinitesimal charge element along the rod, tracking how both the distance from each element to the field point and the direction change continuously along the rod, then resolving the result into components and integrating those separately (the components parallel to the rod cancel by symmetry, but you'd have to show that by actually carrying out and comparing the integrals) — a genuine calculus problem with a trigonometric substitution buried in it. Gauss's law reached the identical result in three lines, and did it by reading off geometry rather than grinding through an integral — precisely the contrast this topic promised.
Where this leads
Gauss's law is the first of what will turn out to be four fundamental equations governing electric and magnetic fields — Maxwell's equations, still ahead in this track, are built from exactly this equation and three siblings like it. For now, its immediate job is more concrete: it explains, almost for free, why charge on a real conductor behaves the way it does — sitting entirely on the surface, with zero field anywhere inside — which is exactly where conductors and capacitance picks up next.