physics2u
Tier
⌕ Search ⌘K
Derivation

Differential Gauss's Law via the Divergence Theorem

D-041 Home PU-102 Threads fields · symmetry Depends on Gauss's Law (Integral Form) from Coulomb, 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
The integral Gauss law holds for every closed surface \(\partial V\).If it held only for special (e.g. highly symmetric) surfaces, the argument that fixes the integrand pointwise collapses and only averaged information survives.
\(\mathbf{E}\) is continuously differentiable (\(C^1\)) throughout \(V\).The divergence theorem requires a differentiable field; at surfaces of discontinuity (idealised sheet charges, conductor boundaries) \(\nabla\cdot\mathbf{E}\) is not an ordinary function and the local law must be read distributionally.
The charge is described by a well-defined volume density \(\rho(\mathbf{r})\) with \(Q_{\text{enc}}=\int_V\rho\,dV\).Point, line, and surface charges give a \(\rho\) that is a Dirac distribution; the pointwise equation then holds only in the sense of distributions, with delta-function sources.
The integrand \(\nabla\cdot\mathbf{E}-\rho/\varepsilon_0\) is continuous.The step "a vanishing integral over every region implies a vanishing integrand" needs continuity; a merely integrable integrand could vanish in the mean while being nonzero on a set of measure zero.
Derivation
1
\[ \oint_{\partial V}\mathbf{E}\cdot d\mathbf{A}=\frac{Q_{\text{enc}}}{\varepsilon_0} \]
Start from the integral form of Gauss's law, taken here as a prior result (Coulomb's law plus superposition), valid for an arbitrary closed surface \(\partial V\) bounding a volume \(V\). A
2
\[ Q_{\text{enc}}=\int_{V}\rho\,dV \]
Express the enclosed charge as the volume integral of the charge density over the region \(V\) bounded by \(\partial V\); this is the definition of \(\rho\). A
3
\[ \oint_{\partial V}\mathbf{E}\cdot d\mathbf{A}=\frac{1}{\varepsilon_0}\int_{V}\rho\,dV \]
Substitute Step 2 into Step 1; the constant \(\varepsilon_0\) passes outside the integral. Symbols only, no numbers yet. A
4
\[ \oint_{\partial V}\mathbf{E}\cdot d\mathbf{A}=\int_{V}(\nabla\cdot\mathbf{E})\,dV \]
Apply the divergence theorem (Gauss–Ostrogradsky) to the left side, converting the surface flux of \(\mathbf{E}\) into the volume integral of its divergence. Legal because \(\mathbf{E}\in C^1\) on \(V\) and \(\partial V\) is a piecewise-smooth closed surface. B
5
\[ \int_{V}(\nabla\cdot\mathbf{E})\,dV=\frac{1}{\varepsilon_0}\int_{V}\rho\,dV \]
Equate the two expressions for the same surface integral (Step 3 and Step 4). Both are now volume integrals over the identical region \(V\). A
6
\[ \int_{V}\left(\nabla\cdot\mathbf{E}-\frac{\rho}{\varepsilon_0}\right)dV=0 \]
Collect both terms under a single integral by linearity of integration. The combined integrand is the quantity whose vanishing we want to establish. A
7
\[ \int_{V}\left(\nabla\cdot\mathbf{E}-\frac{\rho}{\varepsilon_0}\right)dV=0\ \ \forall V\ \Longrightarrow\ \nabla\cdot\mathbf{E}-\frac{\rho}{\varepsilon_0}=0 \]
Localisation step. Since \(\partial V\) — hence \(V\) — was arbitrary, the integral vanishes for all regions. If the continuous integrand \(f\) were positive at a point \(\mathbf{r}_0\), continuity would give a small ball around \(\mathbf{r}_0\) on which \(f>0\), making the integral over that ball strictly positive — a contradiction. Hence \(f\equiv0\) pointwise (the fundamental lemma / du Bois-Reymond argument). C
8
\[ \nabla\cdot\mathbf{E}=\frac{\rho}{\varepsilon_0} \]
Rearrange the pointwise equality from Step 7 to isolate the divergence. This is the differential form of Gauss's law. A
Result
\[ \boxed{\ \nabla\cdot\mathbf{E}=\frac{\rho}{\varepsilon_0}\ } \]

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
1
Uniformly charged ball — verify the local law inside. A ball of radius \(R\) carries uniform density \(\rho_0\). Inside, symmetry and the integral law give \(\mathbf{E}(r)=\dfrac{\rho_0 r}{3\varepsilon_0}\hat{\mathbf{r}}\) for \(r<R\). Check that \(\nabla\cdot\mathbf{E}=\rho_0/\varepsilon_0\). B
\[ E_r(r)=\frac{\rho_0 r}{3\varepsilon_0},\qquad \nabla\cdot\mathbf{E}=\frac{1}{r^2}\frac{d}{dr}\!\left(r^2 E_r\right) \]
Use the spherical-coordinate divergence for a purely radial field depending only on \(r\).
\[ \nabla\cdot\mathbf{E}=\frac{1}{r^2}\frac{d}{dr}\!\left(r^2\cdot\frac{\rho_0 r}{3\varepsilon_0}\right)=\frac{1}{r^2}\frac{d}{dr}\!\left(\frac{\rho_0 r^3}{3\varepsilon_0}\right)=\frac{1}{r^2}\cdot\frac{\rho_0\,(3r^2)}{3\varepsilon_0} \]
Differentiate; the factor \(r^2\) cancels.
\[ \nabla\cdot\mathbf{E}=\frac{\rho_0}{\varepsilon_0} \]
Now put in numbers: take \(\rho_0=6.0\times10^{-6}\ \mathrm{C\,m^{-3}}\). Then \(\rho_0/\varepsilon_0=(6.0\times10^{-6})/(8.854\times10^{-12})\).
\[ \nabla\cdot\mathbf{E}=\frac{\rho_0}{\varepsilon_0}=6.78\times10^{5}\ \mathrm{V\,m^{-2}} \]

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}}\). ✓

2
Recover charge density from a given field. An electrostatic field in a region is measured to be \(\mathbf{E}=k\,x\,\hat{\mathbf{x}}\) with \(k=2.5\times10^{4}\ \mathrm{V\,m^{-2}}\). Find the charge density producing it. B
\[ \rho=\varepsilon_0\,\nabla\cdot\mathbf{E}=\varepsilon_0\left(\frac{\partial E_x}{\partial x}+\frac{\partial E_y}{\partial y}+\frac{\partial E_z}{\partial z}\right) \]
Invert the differential law to solve for \(\rho\); write out the Cartesian divergence.
\[ \frac{\partial E_x}{\partial x}=\frac{\partial}{\partial x}(k x)=k,\qquad \frac{\partial E_y}{\partial y}=\frac{\partial E_z}{\partial z}=0 \]
Only the \(x\)-component is nonzero and it varies linearly in \(x\).
\[ \rho=\varepsilon_0 k=(8.854\times10^{-12}\ \mathrm{F\,m^{-1}})(2.5\times10^{4}\ \mathrm{V\,m^{-2}}) \]
Substitute numbers; \(\mathrm{F\,m^{-1}}\times\mathrm{V\,m^{-2}}=\mathrm{C\,m^{-3}}\).
\[ \rho=2.2\times10^{-7}\ \mathrm{C\,m^{-3}} \]

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
  1. (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\).
  2. (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.
  3. (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}\).
    SolutionInside, \(\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}}\).
  4. (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.
    SolutionFor \(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. ✓
  5. (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.
    SolutionEnclosed 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. ✓