Review / Chapter 2 — Vector Calculus

Gauss's Law (Differential Form)

Chapter 2 — Vector Calculus

Combining Gauss's law in integral form with the divergence theorem gives the differential (or "local") form of Gauss's law:

\[\boxed{\ \vec{\nabla}\cdot\vec{E} = \frac{\rho}{\epsilon_0}\ }\]

where \(\rho(\vec{r})\) is the volume charge density. This is one of Maxwell's equations, and it says that the divergence of the electric field at a point equals the local charge density there, divided by \(\epsilon_0\).

Derivation in one line

Start with the integral form over a closed surface \(S\) enclosing volume \(V\):

\[\oint_S \vec{E}\cdot d\vec{A} = \frac{Q_{\rm enc}}{\epsilon_0} = \frac{1}{\epsilon_0}\int_V \rho\,dV.\]

Apply the divergence theorem to the left side:

\[\int_V(\vec{\nabla}\cdot\vec{E})\,dV = \frac{1}{\epsilon_0}\int_V \rho\,dV.\]

Since this equality holds for every choice of volume \(V\), the integrands must match pointwise: \(\vec{\nabla}\cdot\vec{E} = \rho/\epsilon_0\).

Why "local" matters

The integral form relates field on a surface to the total charge in a possibly-large volume. The differential form is purely local: the behavior of \(\vec{E}\) at a point is tied to the charge density at that same point. No action at a distance.

This is also a deep conceptual upgrade: it lets us write physics as partial differential equations. Everywhere you have charge, \(\vec{E}\) diverges; everywhere you don't, \(\vec{E}\) is divergence-free.

Three immediate consequences

  1. In charge-free regions, \(\rho = 0\), so \(\vec{\nabla}\cdot\vec{E} = 0\). Field lines can't start or end in empty space.
  2. Field lines begin on positive charge and end on negative charge. A positive \(\rho\) is a local source (positive divergence); a negative \(\rho\) is a local sink.
  3. Given \(\vec{E}\), you can read off \(\rho\): \(\rho = \epsilon_0\vec{\nabla}\cdot\vec{E}\). This is sometimes called the "source equation."

Worked example

Inside a uniformly charged ball of charge density \(\rho_0\) (radius \(R\)), symmetry forces \(\vec{E}(r) = E(r)\hat{r}\). From the integral form (or the argument below), \(\vec{E}(r) = \frac{\rho_0 r}{3\epsilon_0}\hat{r}\) for \(r

Check with the differential form. Compute \(\vec{\nabla}\cdot\vec{E}\) for \(\vec{E}=\frac{\rho_0}{3\epsilon_0}(x,y,z)\):

\[\vec{\nabla}\cdot\vec{E} = \frac{\rho_0}{3\epsilon_0}(1+1+1) = \frac{\rho_0}{\epsilon_0}.\ \checkmark\]

Matches \(\rho/\epsilon_0\) inside the ball.

Practice Problems

Problem 1easy
A region has \(\vec{E} = (3x,\ 0,\ 0)\) in some units. Find the charge density \(\rho\) in that region.
Hint
\(\rho = \epsilon_0\vec{\nabla}\cdot\vec{E}\).
Solution

\(\vec{\nabla}\cdot\vec{E} = 3+0+0 = 3\). So \(\rho = 3\epsilon_0\).

Answer: uniform \(\rho = 3\epsilon_0\).

Problem 2easy
Can \(\vec{E}(x,y,z) = (y,0,0)\) be a possible electrostatic field in vacuum? (Ignore curl for now; just check Gauss.)
Hint
Is the divergence zero?
Solution

\(\vec{\nabla}\cdot\vec{E} = 0\), so it's compatible with \(\rho = 0\) everywhere. (Separately, its curl isn't zero, so it still fails — but Gauss alone doesn't rule it out.)

Answer: yes, as far as Gauss's law is concerned; it corresponds to \(\rho = 0\).

Problem 3medium
A field is \(\vec{E} = A(x\hat{x}+y\hat{y})\) inside a cylinder of radius \(R\) aligned with the \(z\)-axis, and zero outside. Find \(\rho(\vec{r})\) inside the cylinder.
Hint
\(\vec{\nabla}\cdot\vec{E}\) is easy — one partial per component.
Solution

\(\vec{\nabla}\cdot\vec{E} = A+A+0 = 2A\). So \(\rho = 2A\epsilon_0\), uniform inside.

Answer: \(\rho = 2A\epsilon_0\).

Problem 4medium
Suppose \(\vec{E} = f(r)\hat{r}\) (spherically symmetric), with \(r = |\vec{r}|\). For \(\vec{\nabla}\cdot\vec{E} = 0\) away from the origin, what does \(f(r)\) have to be?
Hint
In spherical coords, \(\vec{\nabla}\cdot(f(r)\hat{r}) = \frac{1}{r^2}\frac{d}{dr}(r^2 f)\).
Solution

Set \(\frac{d}{dr}(r^2 f) = 0\), giving \(r^2 f = \text{const}\), so \(f(r) = C/r^2\).

Answer: \(\vec{E}\propto\hat{r}/r^2\) — Coulomb-like, with the point charge "hidden" at the origin.

Problem 5medium
A "slab" of charge extends from \(z=-a\) to \(z=a\) with uniform density \(\rho_0\), and is zero outside. Inside, the field has the form \(\vec{E}=E_z(z)\hat{z}\). Use the differential form of Gauss's law to find \(E_z(z)\), assuming by symmetry that \(E_z(0)=0\).
Hint
\(\partial_z E_z = \rho_0/\epsilon_0\); integrate in \(z\).
Solution

Inside the slab, \(\frac{dE_z}{dz} = \rho_0/\epsilon_0\), so \(E_z(z) = \rho_0 z/\epsilon_0\) (using \(E_z(0)=0\)).

Answer: \(\vec{E}(z) = (\rho_0 z/\epsilon_0)\hat{z}\) for \(|z|

Problem 6hard
A field \(\vec{E} = (a x,\ b y,\ c z)\) is claimed to describe a physical distribution. What's the charge density \(\rho\)? Show that the flux out of a box \([0,L]^3\) equals \((a+b+c)\epsilon_0 L^3/\epsilon_0 = (a+b+c)L^3\), consistent with both forms of Gauss's law.
Hint
Divergence is constant; use it both locally (for \(\rho\)) and integrated (for total charge = flux\(\cdot\epsilon_0\)).
Solution

\(\vec{\nabla}\cdot\vec{E} = a+b+c\), so \(\rho = (a+b+c)\epsilon_0\). Total charge in the box is \((a+b+c)\epsilon_0 L^3\), and Gauss (integral) gives flux \(= Q/\epsilon_0 = (a+b+c)L^3\). Consistent.

Answer: \(\rho = (a+b+c)\epsilon_0\); flux \((a+b+c)L^3\) matches both forms.