Tutorials › Calculus III › Electric Flux from Distributed Charge

Flux and Circulation Applications · Tutorial 993 of 999

Electric Flux from Distributed Charge

Learn to convert a volume charge density into the total electric flux through a closed surface, with careful attention to symmetry, orientation, units, and theorem conditions.

Advanced 10 min read

What You'll Learn

  • State the divergence theorem conditions needed for a flux calculation
  • Relate electric-field divergence to smooth volume charge density
  • Compute enclosed charge by integrating spherical and rectangular densities
  • Use symmetry and cancellation to simplify charge integrals
  • Check flux results using units, orientation, and a direct boundary calculation

From Charge Density to Electric Flux

Electric fields can be produced by charge spread continuously through a region, rather than concentrated at a single point. A volume charge density describes how much charge occupies each small piece of space. The divergence theorem turns that volume description into a statement about the total electric flux through the region’s boundary.

This connection is useful when the charge density is known and the desired quantity is the net outward flux through a closed surface. In particular, the total flux depends on the charge enclosed, even when the boundary is not spherical. A spherical boundary offers an additional advantage: if the charge distribution and field are spherically symmetric, the flux can also determine the field’s magnitude on the boundary.

Definition: A volume charge density \(\rho(x,y,z)\) assigns charge per unit volume. Its SI unit is coulombs per cubic metre, \(\mathrm{C/m^3}\). The charge in a volume \(V\) is \(Q_{\mathrm{enc}}=\iiint_V \rho\,dV\), provided the density is integrable there.

The electric flux through an oriented surface \(S\) is the surface integral of the normal component of the electric field. For a closed surface, we use the outward-pointing unit normal \(\mathbf n\), so positive net flux means more field exits the surface than enters it.

$$ \Phi_E=\iint_S \mathbf E\cdot\mathbf n\,dS. $$

Here \(\mathbf E\) is measured in newtons per coulomb, \(\mathrm{N/C}\), and flux has units \(\mathrm{N\,m^2/C}\). The surface must be closed for the enclosed-charge form of Gauss’s law used below.

The Divergence Theorem and Gauss’s Law

The divergence theorem applies to a vector field \(\mathbf E\) with continuous first partial derivatives on a region containing a bounded solid \(V\) whose boundary \(S=\partial V\) is piecewise smooth. With the outward orientation, it states that the flux through the boundary equals the integral of the divergence throughout the solid.

$$ \iint_{\partial V}\mathbf E\cdot\mathbf n\,dS = \iiint_V \nabla\cdot\mathbf E\,dV. $$

Gauss’s law for the electric field states that its divergence is the charge density divided by the vacuum permittivity \(\varepsilon_0\), where \(\varepsilon_0\) is measured in \(\mathrm{C^2/(N\,m^2)}\). For a smooth charge density and a field satisfying this local law throughout \(V\), the divergence theorem gives the integral law.

$$ \nabla\cdot\mathbf E=\frac{\rho}{\varepsilon_0} \qquad\Longrightarrow\qquad \iint_{\partial V}\mathbf E\cdot\mathbf n\,dS = \frac{1}{\varepsilon_0}\iiint_V\rho\,dV = \frac{Q_{\mathrm{enc}}}{\varepsilon_0}. $$

The implication follows by substituting \(\nabla\cdot\mathbf E=\rho/\varepsilon_0\) into the volume integral in the divergence theorem. Since \(\varepsilon_0\) is constant, it can be taken outside the integral. This is the central calculation: integrate the density over the enclosed volume, then divide by \(\varepsilon_0\).

Theorem: If \(V\) is a bounded solid with piecewise-smooth closed boundary, \(\mathbf E\) has continuous first partial derivatives on a neighborhood of \(V\), and \(\nabla\cdot\mathbf E=\rho/\varepsilon_0\) in \(V\), then the outward electric flux through \(\partial V\) is \(Q_{\mathrm{enc}}/\varepsilon_0\), where \(Q_{\mathrm{enc}}=\iiint_V\rho\,dV\).

This calculation gives total flux, not necessarily the electric field at each point of the boundary. To infer a field magnitude from the flux, additional information such as symmetry is needed. Also, the smoothness conditions matter: a singular point source inside the region cannot simply be treated as a smooth density there. The theorem must be applied only when its hypotheses hold, or with a suitable treatment of the singularity.

Worked Example: A Smooth Radial Density in a Sphere

Worked Example: Flux Through a Sphere with Radial Charge Density

Suppose a sphere of radius \(R=1\,\mathrm m\), centered at the origin, contains the smooth radial density \(\rho(r)=\rho_0(1-r^2/a^2)\), with \(\rho_0=6\,\mathrm{\mu C/m^3}\) and \(a=2\,\mathrm m\). Find the outward electric flux through the sphere.

Use spherical coordinates, where \(dV=r^2\sin\theta\,dr\,d\theta\,d\phi\). The enclosed charge is

$$ Q_{\mathrm{enc}} = \int_0^{2\pi}\int_0^\pi\int_0^R \rho_0\left(1-\frac{r^2}{a^2}\right) r^2\sin\theta\,dr\,d\theta\,d\phi. $$

The angular integrals are \(\int_0^{2\pi}d\phi=2\pi\) and \(\int_0^\pi\sin\theta\,d\theta=2\). Therefore,

$$ Q_{\mathrm{enc}} = 4\pi\rho_0\int_0^R\left(r^2-\frac{r^4}{a^2}\right)dr = 4\pi\rho_0\left(\frac{R^3}{3}-\frac{R^5}{5a^2}\right). $$

Substitute \(R=1\,\mathrm m\), \(a=2\,\mathrm m\), and \(\rho_0=6\times10^{-6}\,\mathrm{C/m^3}\). The bracket is \(\frac{1}{3}\,\mathrm{m^3}-\frac{1}{20}\,\mathrm{m^3}=\frac{17}{60}\,\mathrm{m^3}\). Thus

$$ Q_{\mathrm{enc}} = 4\pi(6\times10^{-6}\,\mathrm{C/m^3}) \left(\frac{17}{60}\,\mathrm{m^3}\right) = 6.8\pi\times10^{-6}\,\mathrm C. $$

Gauss’s law now gives

$$ \Phi_E = \frac{6.8\pi\times10^{-6}\,\mathrm C} {8.8541878128\times10^{-12}\,\mathrm{C^2/(N\,m^2)}} \approx 2.41\times10^6\,\mathrm{N\,m^2/C}. $$

The units reduce to \(\mathrm{N\,m^2/C}\), as required. The density is nonnegative on this sphere because \(r\leq1\,\mathrm m< a\), so the positive outward flux is consistent with the enclosed positive charge. The result is the net flux; without knowing that the field is spherically symmetric, it does not specify the field point by point.

Worked Example: A Rectangular Volume with Varying Density

Worked Example: Flux Through a Rectangular Box

Let \(V\) be the box \(0\leq x\leq L\), \(0\leq y\leq b\), \(0\leq z\leq c\), with \(L=0.4\,\mathrm m\), \(b=0.3\,\mathrm m\), and \(c=0.2\,\mathrm m\). Its density is \(\rho(x,y,z)=\rho_0(1+x/L)\), where \(\rho_0=2\,\mathrm{\mu C/m^3}\). Find the outward flux through the entire boundary.

Integrate first in \(z\) and \(y\), which contributes a factor \(bc\):

$$ Q_{\mathrm{enc}} = \rho_0bc\int_0^L\left(1+\frac{x}{L}\right)dx = \rho_0bc\left(L+\frac{L}{2}\right) = \frac32\rho_0Lbc. $$

The box volume is \(Lbc=(0.4)(0.3)(0.2)\,\mathrm{m^3}=0.024\,\mathrm{m^3}\). Hence

$$ Q_{\mathrm{enc}} = \frac32(2\times10^{-6}\,\mathrm{C/m^3})(0.024\,\mathrm{m^3}) = 7.2\times10^{-8}\,\mathrm C. $$

Therefore,

$$ \Phi_E = \frac{7.2\times10^{-8}\,\mathrm C} {8.8541878128\times10^{-12}\,\mathrm{C^2/(N\,m^2)}} \approx 8.13\times10^3\,\mathrm{N\,m^2/C}. $$

As a direct check, consider the smooth field \(\mathbf E=(\rho_0/\varepsilon_0)(x+x^2/(2L),0,0)\), with coordinates expressed in metres and the stated SI values of \(\rho_0\), \(\varepsilon_0\), and \(L\). Its divergence is \((\rho_0/\varepsilon_0)(1+x/L)=\rho/\varepsilon_0\). The field has no \(y\)- or \(z\)-component, so the four faces perpendicular to those axes contribute zero flux. On the face \(x=0\), the field is zero. On the face \(x=L\), the outward normal is \((1,0,0)\), and the field is constant across the face. Its flux is

$$ bc\,E_x(L) = \frac{\rho_0bc}{\varepsilon_0} \left(L+\frac{L^2}{2L}\right) = \frac{3\rho_0Lbc}{2\varepsilon_0}, $$

which equals \(Q_{\mathrm{enc}}/\varepsilon_0\). This checks both the integral result and the outward orientation.

Worked Example: A Linear Density on a Centered Sphere

Worked Example: Cancellation of a Linear Density Term

Consider the sphere \(x^2+y^2+z^2\leq R^2\), with \(R=0.5\,\mathrm m\), and density \(\rho=(4\,\mathrm{\mu C/m^3})+(2\,\mathrm{\mu C/m^4})x\). Find its total outward electric flux. The coefficient of \(x\) carries units \(\mathrm{\mu C/m^4}\), so that the linear term has density units \(\mathrm{\mu C/m^3}\).

The integral of \(x\) over the centered sphere is zero: the transformation \((x,y,z)\mapsto(-x,y,z)\) maps the sphere to itself and changes the sign of \(x\). Thus the linear term contributes no net charge. The constant term gives

$$ Q_{\mathrm{enc}} = (4\,\mathrm{\mu C/m^3})\frac{4\pi R^3}{3} = (4\,\mathrm{\mu C/m^3})\frac{4\pi(0.5\,\mathrm m)^3}{3} = \frac{2\pi}{3}\,\mathrm{\mu C}. $$

Consequently,

$$ \Phi_E = \frac{(2\pi/3)\times10^{-6}\,\mathrm C} {8.8541878128\times10^{-12}\,\mathrm{C^2/(N\,m^2)}} \approx 2.36\times10^5\,\mathrm{N\,m^2/C}. $$

For a dimensional check, a smooth field with the required divergence is \(\mathbf E=\frac{1}{\varepsilon_0}\left[\frac{4\,\mathrm{\mu C/m^3}}{3}(x,y,z)+(1\,\mathrm{\mu C/m^4})(x^2,0,0)\right]\), with coordinates in metres. Differentiating its components gives \(\nabla\cdot\mathbf E=[4\,\mathrm{\mu C/m^3}+2\,\mathrm{\mu C/m^4}x]/\varepsilon_0=\rho/\varepsilon_0\). Each term inside the brackets has units \(\mathrm{C/m^2}\); dividing by \(\varepsilon_0\) gives \(\mathrm{N/C}\). The divergence therefore has units \(\mathrm{N/(C\,m)}\), matching \(\rho/\varepsilon_0\). The odd density contribution cancels in the volume integral, as required by the symmetry of the sphere.

Why Symmetry Helps—and What It Does Not Do

Symmetry can simplify the charge integral. In the centered-sphere example, reflection symmetry made the integral of \(x\) vanish. In a spherical density, spherical coordinates reduce the angular integrals to a simple factor. These are ways to compute \(Q_{\mathrm{enc}}\); they do not replace the divergence theorem.

When the entire electric field is spherically symmetric, it is also constant in magnitude on a sphere and points in the radial direction. Then \(\mathbf E\cdot\mathbf n=E(R)\) everywhere on a sphere of radius \(R\), so the flux is \(4\pi R^2E(R)\). Combined with Gauss’s law, this gives \(E(R)=Q_{\mathrm{enc}}/(4\pi\varepsilon_0R^2)\). This field conclusion requires spherical symmetry of the field, not merely a spherical boundary.

Key takeaway: For a smooth charge distribution and a valid closed boundary, the net outward electric flux is the enclosed charge divided by \(\varepsilon_0\). The boundary’s shape does not change that total, although its shape and the field’s symmetry can affect how the flux is distributed across it.

A Common Pitfall: Mixing Up Density and Charge

A frequent error is to use a density value as though it were already a charge. For example, if one writes \(Q_{\mathrm{enc}}=\rho_0\) for a uniform density, the units on the two sides are \(\mathrm{C/m^3}\) and \(\mathrm C\), respectively. They do not match. The density must be integrated over the volume:

$$ Q_{\mathrm{enc}}=\rho_0\,\operatorname{Vol}(V) $$

for uniform \(\rho_0\). The resulting charge has units \((\mathrm{C/m^3})(\mathrm{m^3})=\mathrm C\). Another error is to reverse the normal: the divergence theorem uses the outward normal. Reversing it changes the sign of the surface flux, while the enclosed charge integral remains unchanged.

It is also essential to keep dimensions consistent inside a field formula. Terms added as components of \(\mathbf E\) must have the same units. In the last example, the coefficients were explicitly given units so each bracketed term had units \(\mathrm{C/m^2}\); division by \(\varepsilon_0\) then produced \(\mathrm{N/C}\). The same dimensional check should be made before differentiating or integrating a proposed physical field.

1
Identify the solid and its boundary.
Confirm that the surface is closed and use its outward orientation.
2
Check the hypotheses.
Ensure the field is sufficiently smooth on the region and that its divergence equals \(\rho/\varepsilon_0\).
3
Integrate the density.
Compute \(Q_{\mathrm{enc}}=\iiint_V\rho\,dV\), keeping the volume element and units.
4
Convert charge to flux.
Divide by \(\varepsilon_0\), then check the sign and flux units.

Check Your Understanding

Use the definitions and examples above to answer these questions.

  1. What conditions allow the divergence theorem to convert a surface flux into a volume integral?
  2. A constant density fills a box of volume \(V_0\). What expression gives its enclosed charge, and what are the units?
  3. Why does the integral of \(x\) over a sphere centered at the origin equal zero?
  4. Does a spherical boundary alone guarantee that the electric-field magnitude is constant on that boundary? Explain.
  5. What sign should the flux have if the enclosed charge is positive and the surface normal is outward?