Differential Gauss's Law via the Divergence Theorem
Statement
From the integral form of Gauss's law, \(\oint_{\partial V}\mathbf{E}\cdot d\mathbf{A}=\dfrac{Q_{\text{enc}}}{\varepsilon_0}\), valid for every closed surface, the divergence theorem yields the local (differential) law \(\nabla\cdot\mathbf{E}=\dfrac{\rho}{\varepsilon_0}\), holding pointwise wherever \(\mathbf{E}\) is continuously differentiable and \(\rho\) is the volume charge density.
Why it matters
The integral law relates the flux through a surface to the total charge it encloses, but it does not say what the field is doing at a single point. The differential law converts that global bookkeeping into a pointwise statement: it identifies the electric charge density as the local source of the divergence of \(\mathbf{E}\). This is the form that enters Maxwell's equations and every boundary-value problem in electrostatics.
Once written locally, the law couples directly to a potential through \(\mathbf{E}=-\nabla\phi\), producing Poisson's equation \(\nabla^2\phi=-\rho/\varepsilon_0\). Differential field equations, not integral ones, are what generalise cleanly to time-dependent fields and to media, so this step is the gateway from static flux counting to the full field theory.
Assumptions
Derivation
Result
Reading. At each point of space the divergence of the electric field — the net outward flux per unit volume in the limit of a vanishing region — equals the local charge density divided by \(\varepsilon_0\). Positive charge is a source from which field lines emanate; negative charge is a sink into which they converge; where \(\rho=0\) the field is divergence-free (though not necessarily zero). The field's sources sit exactly where the charge is.
Units check. In SI, \([\mathbf{E}]=\mathrm{V\,m^{-1}}=\mathrm{N\,C^{-1}}\), so \([\nabla\cdot\mathbf{E}]=\mathrm{V\,m^{-2}}\). On the right, \([\rho]=\mathrm{C\,m^{-3}}\) and \([\varepsilon_0]=\mathrm{C^2\,N^{-1}\,m^{-2}}=\mathrm{F\,m^{-1}}\), so \([\rho/\varepsilon_0]=\dfrac{\mathrm{C\,m^{-3}}}{\mathrm{C^2\,N^{-1}\,m^{-2}}}=\mathrm{N\,C^{-1}\,m^{-1}}=\mathrm{V\,m^{-2}}\). Both sides carry \(\mathrm{V\,m^{-2}}\). ✓
Limiting cases
- Source-free region (\(\rho=0\)): \(\nabla\cdot\mathbf{E}=0\). The field is solenoidal; field lines neither begin nor end there, matching a charge-free vacuum.
- Uniform field: a constant \(\mathbf{E}\) has zero divergence everywhere, so it corresponds to \(\rho=0\) — consistent with the idealised interior far from the charges that produce it.
- Recover the integral law: integrate \(\nabla\cdot\mathbf{E}=\rho/\varepsilon_0\) over any \(V\) and apply the divergence theorem in reverse to return exactly to \(\oint\mathbf{E}\cdot d\mathbf{A}=Q_{\text{enc}}/\varepsilon_0\). The two forms are mathematically equivalent for smooth fields.
- Point charge, \(r\neq0\): for \(\mathbf{E}=\frac{q}{4\pi\varepsilon_0}\frac{\hat{\mathbf{r}}}{r^2}\) one finds \(\nabla\cdot\mathbf{E}=0\) everywhere except the origin, where the source \(q\,\delta^3(\mathbf{r})/\varepsilon_0\) sits.
Breaks when
- Field discontinuities / idealised surface and point charges. At a charged conducting surface or a sheet of surface charge \(\sigma\), the normal component of \(\mathbf{E}\) jumps, so \(\mathbf{E}\notin C^1\) and \(\nabla\cdot\mathbf{E}\) is not an ordinary function. The pointwise law fails as written; it must be replaced by the boundary condition \((\mathbf{E}_2-\mathbf{E}_1)\cdot\hat{\mathbf{n}}=\sigma/\varepsilon_0\), or read distributionally with a delta on the surface.
- Inside polarisable/dielectric media. The form \(\nabla\cdot\mathbf{E}=\rho/\varepsilon_0\) holds only if \(\rho\) is the total (free + bound) charge density. Using free charge alone requires the auxiliary field: \(\nabla\cdot\mathbf{D}=\rho_{\text{free}}\) with \(\mathbf{D}=\varepsilon_0\mathbf{E}+\mathbf{P}\). Forgetting the bound charge \(\rho_b=-\nabla\cdot\mathbf{P}\) breaks the equation.
- Non-differentiable or singular charge models. Line charges, point charges, and surfaces give a \(\rho\) that is a distribution, not a function; the equation is then valid only in the distributional sense (e.g. \(\nabla\cdot(\hat{\mathbf{r}}/r^2)=4\pi\delta^3(\mathbf{r})\)).
Failure modes
- Confusing divergence with magnitude. Believing a large \(|\mathbf{E}|\) means a large \(\nabla\cdot\mathbf{E}\). A point charge's field is enormous near the charge yet has zero divergence everywhere off the origin.
- Applying the pointwise law at a surface charge. Writing \(\nabla\cdot\mathbf{E}=\sigma/\varepsilon_0\) at a sheet — mixing a surface density (\(\mathrm{C\,m^{-2}}\)) into a volume-density equation (\(\mathrm{C\,m^{-3}}\)). The correct statement there is the jump condition, not the divergence.
- Using free charge in a dielectric with \(\varepsilon_0\). Writing \(\nabla\cdot\mathbf{E}=\rho_{\text{free}}/\varepsilon_0\) inside matter, dropping the bound charge, instead of \(\nabla\cdot\mathbf{D}=\rho_{\text{free}}\).
- Thinking \(\nabla\cdot\mathbf{E}=0\) implies \(\mathbf{E}=0\). A divergence-free field can be large and structured (e.g. the field in the charge-free gap between capacitor plates).
- Using the divergence theorem across a singularity. Applying it to a volume that contains a point charge without accounting for the delta source, then wrongly concluding the flux integral is zero.
Discussion
The physical content of this step is that charge is the source of electric-field divergence, and it acts locally. The integral law is compatible with the charge being "smeared" anywhere inside the surface — flux counting cannot tell where within \(V\) the charge sits. Shrinking the argument to arbitrarily small volumes forces the correspondence to become pointwise: the divergence at \(\mathbf{r}\) is set by the charge density at that same \(\mathbf{r}\), with no action at a distance in the field equation itself. This locality is what makes \(\nabla\cdot\mathbf{E}=\rho/\varepsilon_0\) a genuine field law rather than a mere integral constraint.
Geometrically, \(\nabla\cdot\mathbf{E}\) is the flux per unit volume out of an infinitesimal box; the derivation is precisely the divergence theorem run in the limit of vanishing box size, so the differential law is the "microscopic" version of the same flux bookkeeping. The equation also splits cleanly from the other Maxwell equations: it constrains only the longitudinal (curl-free) part of \(\mathbf{E}\), while \(\nabla\times\mathbf{E}\) is fixed separately (by \(-\partial\mathbf{B}/\partial t\)). In electrostatics, combined with \(\nabla\times\mathbf{E}=0\), it becomes Poisson's equation for the potential, the workhorse of boundary-value electrostatics.
Read distributionally, the law is exact even for singular sources. The Coulomb field of a point charge satisfies \(\nabla\cdot\left(\frac{q}{4\pi\varepsilon_0}\frac{\hat{\mathbf{r}}}{r^2}\right)=\frac{q}{\varepsilon_0}\delta^3(\mathbf{r})\), where the identity \(\nabla\cdot(\hat{\mathbf{r}}/r^2)=4\pi\delta^3(\mathbf{r})\) encodes the entire flux \(4\pi\) of a unit monopole. From this viewpoint \(\nabla\cdot\mathbf{E}=\rho/\varepsilon_0\) is the differential form of the statement that the Coulomb kernel \(1/(4\pi r)\) is the Green's function of the Laplacian; the divergence-theorem derivation and the Green's-function construction are two faces of the same fact, and the whole of electrostatics can be rebuilt from either.
Common misconceptions. The differential and integral forms are not "two different laws" — for smooth fields they are exactly equivalent, related by the divergence theorem in either direction. The differential form is not more fundamental in content, but it is more useful: it is local, it generalises to time-dependent and material settings, and it is the version that appears in Maxwell's equations. And \(\nabla\cdot\mathbf{E}=0\) says the field has no sources there, not that the field vanishes.
Worked examples
Reading. The divergence is constant throughout the ball and equals \(\rho_0/\varepsilon_0\), independent of \(r\) — exactly the differential law, confirming the interior field solution. Units: \(\mathrm{C\,m^{-3}}/(\mathrm{F\,m^{-1}})=\mathrm{V\,m^{-2}}\). ✓
Reading. A field growing linearly in \(x\) has constant, nonzero divergence, so it is sustained by a uniform positive volume charge \(\rho=\varepsilon_0 k\). The differential law lets us read the source directly off the field's spatial variation, with no integration needed. ✓
Problems
- (A) Direct application. A field is \(\mathbf{E}=(a\,y,\,a\,x,\,0)\) with \(a\) constant. Find \(\rho\).
Solution
\(\nabla\cdot\mathbf{E}=\partial_x(a y)+\partial_y(a x)+\partial_z(0)=0+0+0=0\). Hence \(\rho=\varepsilon_0\nabla\cdot\mathbf{E}=0\). The field is divergence-free (in fact a shear/rotational-type field), so it carries no net charge source in the region — despite \(\mathbf{E}\neq0\). - (B) Radial power law. In a region \(\mathbf{E}=C\,r^n\,\hat{\mathbf{r}}\) (spherical). For which \(n\) is the region charge-free (\(\rho=0\)), and what is \(\rho(r)\) in general?
Solution
\(\nabla\cdot\mathbf{E}=\frac{1}{r^2}\frac{d}{dr}(r^2\,C r^n)=\frac{C}{r^2}\frac{d}{dr}(r^{n+2})=\frac{C(n+2)r^{n+1}}{r^2}=C(n+2)r^{n-1}\). Then \(\rho=\varepsilon_0 C(n+2)r^{n-1}\). It vanishes (for \(r\neq0\)) only when \(n=-2\), the Coulomb case \(\mathbf{E}\propto\hat{\mathbf{r}}/r^2\), which is source-free away from the origin. - (B) Slab geometry. An infinite slab \(|x|\le d\) carries constant \(\rho_0\); outside is empty. By symmetry \(\mathbf{E}=E_x(x)\hat{\mathbf{x}}\) with \(E_x(0)=0\). Find \(E_x(x)\) inside using the differential law and evaluate at \(x=d\) for \(\rho_0=1.0\times10^{-6}\ \mathrm{C\,m^{-3}}\), \(d=0.02\ \mathrm{m}\).
Solution
Inside, \(\frac{dE_x}{dx}=\rho_0/\varepsilon_0\Rightarrow E_x(x)=\frac{\rho_0}{\varepsilon_0}x+\text{const}\). Symmetry (\(E_x\) odd, \(E_x(0)=0\)) sets the constant to zero: \(E_x(x)=\rho_0 x/\varepsilon_0\). At \(x=d\): \(E_x=\frac{(1.0\times10^{-6})(0.02)}{8.854\times10^{-12}}=\frac{2.0\times10^{-8}}{8.854\times10^{-12}}\approx2.26\times10^{3}\ \mathrm{V\,m^{-1}}\). - (C) Distributional check. Show that \(\mathbf{E}=\dfrac{q}{4\pi\varepsilon_0}\dfrac{\hat{\mathbf{r}}}{r^2}\) satisfies \(\nabla\cdot\mathbf{E}=\dfrac{q}{\varepsilon_0}\delta^3(\mathbf{r})\), and confirm consistency with the integral law over a sphere.
Solution
For \(r\neq0\), \(\nabla\cdot(\hat{\mathbf{r}}/r^2)=\frac{1}{r^2}\frac{d}{dr}(r^2\cdot r^{-2})=\frac{1}{r^2}\frac{d}{dr}(1)=0\), so the divergence vanishes off the origin. But the flux of \(\hat{\mathbf{r}}/r^2\) through any enclosing sphere is \(\oint \frac{\hat{\mathbf{r}}}{r^2}\cdot d\mathbf{A}=\frac{1}{r^2}(4\pi r^2)=4\pi\neq0\). A quantity that is zero everywhere except a point yet integrates to \(4\pi\) is \(4\pi\delta^3(\mathbf{r})\); hence \(\nabla\cdot(\hat{\mathbf{r}}/r^2)=4\pi\delta^3(\mathbf{r})\). Multiplying, \(\nabla\cdot\mathbf{E}=\frac{q}{4\pi\varepsilon_0}\cdot4\pi\delta^3(\mathbf{r})=\frac{q}{\varepsilon_0}\delta^3(\mathbf{r})\). Integrating over a ball: \(\int\nabla\cdot\mathbf{E}\,dV=\frac{q}{\varepsilon_0}=\oint\mathbf{E}\cdot d\mathbf{A}\), the integral law. ✓ - (C) Non-uniform sphere. A ball of radius \(R\) has \(\rho(r)=\rho_0(1-r/R)\) for \(r\le R\). Find \(E_r(r)\) inside from the integral law, then verify it reproduces \(\rho(r)\) via the differential law.
Solution
Enclosed charge: \(Q(r)=\int_0^r\rho_0(1-r'/R)4\pi r'^2\,dr'=4\pi\rho_0\left(\frac{r^3}{3}-\frac{r^4}{4R}\right)\). Gauss: \(E_r\,4\pi r^2=Q(r)/\varepsilon_0\Rightarrow E_r=\frac{\rho_0}{\varepsilon_0}\left(\frac{r}{3}-\frac{r^2}{4R}\right)\). Check: \(\nabla\cdot\mathbf{E}=\frac{1}{r^2}\frac{d}{dr}(r^2 E_r)=\frac{1}{r^2}\frac{d}{dr}\!\left[\frac{\rho_0}{\varepsilon_0}\!\left(\frac{r^3}{3}-\frac{r^4}{4R}\right)\right]=\frac{1}{r^2}\frac{\rho_0}{\varepsilon_0}\!\left(r^2-\frac{r^3}{R}\right)=\frac{\rho_0}{\varepsilon_0}\!\left(1-\frac{r}{R}\right)=\frac{\rho(r)}{\varepsilon_0}\). The differential law recovers the input density exactly. ✓