Skip to content

Unit 8: Electric Charges, Fields, and Gauss's Law

Gauss's Law

Use Gauss's law to relate flux to enclosed charge, find enclosed charge from a density, and derive E for spherical, cylindrical and planar charge.

Topic 8.6 · 13 min read

Wrap any closed surface around some charges and add up the electric flux leaving it (topic 8.5 defined flux). The total depends on exactly one thing: the net charge inside. That fact is Gauss's law. It is true for every closed surface and every arrangement of charge, and for charge spread with enough symmetry it replaces the field integrals of topic 8.4 with one line of algebra.

What the law says

A Gaussian surface is a closed surface: it encloses a volume with no gaps, like a balloon or a sealed box, rather than an open sheet like a flag. It is imaginary, so you can draw it anywhere, including straight through charged material. As in topic 8.5, the area vector dA⃗d\vec{A} of each small patch points outward, away from the enclosed volume.

Two details decide most questions about the law.

  • The field in the integral is the total field at each point of the surface, produced by every charge, inside and outside. Charges outside the surface change E⃗\vec{E} on the surface.
  • Charges outside contribute zero net flux. Every field line from an outside charge that enters the surface leaves it somewhere else, so its inward flux and outward flux cancel. That is why only qencq_{\text{enc}} appears on the right.

For example, put +4.0 nC+4.0\ \text{nC} and −1.5 nC-1.5\ \text{nC} inside a lumpy closed surface and +6.0 nC+6.0\ \text{nC} just outside it. The net flux is

ΦE=(4.0−1.5)×10−9 C8.85×10−12 C2/(N⋅m2)=282 N⋅m2/C,\Phi_E = \frac{(4.0 - 1.5)\times10^{-9}\ \text{C}}{8.85\times10^{-12}\ \text{C}^2/(\text{N}\cdot\text{m}^2)} = 282\ \text{N}\cdot\text{m}^2/\text{C},

no matter where inside the charges sit or what shape the surface has. The +6.0 nC+6.0\ \text{nC} charge reshapes the field on the surface but adds nothing to the total. A negative qencq_{\text{enc}} gives negative flux: more field enters the surface than leaves.

Why the size and shape of the surface don't matter

Start with a point charge qq at the center of a sphere of radius rr. On the sphere the field has magnitude q4πε0r2\frac{q}{4\pi\varepsilon_0 r^2} and points straight outward, parallel to dA⃗d\vec{A} at every patch, so E⃗⋅dA⃗=E dA\vec{E}\cdot d\vec{A} = E\,dA and EE is the same everywhere on the sphere:

∮E⃗⋅dA⃗=E∮dA=q4πε0r2⋅4πr2=qε0.\oint \vec{E}\cdot d\vec{A} = E\oint dA = \frac{q}{4\pi\varepsilon_0 r^2}\cdot 4\pi r^2 = \frac{q}{\varepsilon_0}.

The radius cancels. A bigger sphere has a weaker field on it, falling as 1r2\frac{1}{r^2}, but more area, growing as r2r^2, and the two changes offset exactly. Gauss's law is the inverse-square law in disguise: if the field fell off as 1r3\frac{1}{r^3}, the flux through a sphere would shrink as 1r\frac{1}{r} and no such law could hold.

For a surface of any other shape, think in field lines. The number of lines leaving a charge is proportional to the charge, and every line that starts inside a closed surface must cross it outward (on net) to get out, whatever the surface looks like. So the flux through any closed surface around qq is the same as through the sphere, qε0\frac{q}{\varepsilon_0}. With several charges, the fields add, so the fluxes add, and each outside charge contributes zero.

The practical consequence: if you grow or shrink a Gaussian surface while the charge it encloses stays the same, the total flux does not change, even though the field on the surface does. If the surface cuts through a charged object, growing it encloses more charge and the flux grows with it.

Gauss's law is also the first of Maxwell's equations, the four equations that together describe all of classical electricity and magnetism: Gauss's law for electric fields, Gauss's law for magnetic fields (topic 12.1), Faraday's law (topic 13.2), and Ampère's law with Maxwell's addition (topic 12.4). Coulomb's law only describes charges at rest; Gauss's law stays true even when charges move.

Picking a surface that makes the integral easy

Gauss's law always holds, but it gives you EE only when you can pull EE out of the integral. That requires a surface built from pieces of two kinds:

  • pieces where E⃗\vec{E} is perpendicular to the surface (parallel to dA⃗d\vec{A}) and has the same magnitude everywhere, so that piece's flux is just EAEA;
  • pieces where E⃗\vec{E} lies along the surface, so E⃗⋅dA⃗=0\vec{E}\cdot d\vec{A} = 0 and the piece carries no flux.

Symmetry tells you the field's direction before you calculate anything. For a ball whose charge density depends only on distance from the center, any rotation about the center leaves the charge looking the same, so the field cannot favor any direction other than radial, and its magnitude can depend only on rr. For a very long cylinder with charge depending only on distance from the axis, the field points straight away from the axis (a component along the axis would have to pick one end over the other). For a large flat sheet, the field is perpendicular to the sheet and has the same magnitude at equal distances on either side.

Three Gaussian surfaces. Left: a shaded charged ball with a dashed concentric sphere of radius r around it; field arrows point radially outward through the sphere, so the flux is E times 4 pi r squared. Middle: a long shaded rod seen from the side, with a dashed coaxial cylinder of radius r and length l around it; field arrows point straight away from the rod through the curved side and none cross the end caps, so the flux is E times 2 pi r l. Right: a charged sheet seen edge-on, with a dashed cylinder of end area A straddling it; field arrows point away from the sheet through both end faces and none cross the curved side, so the flux is 2EA.
SymmetryGaussian surfaceFluxField
Spherical (or a point charge)Concentric sphere, radius rrE (4πr2)E\,(4\pi r^2)E=qenc4πε0r2E = \dfrac{q_{\text{enc}}}{4\pi\varepsilon_0 r^2}
Cylindrical (very long)Coaxial cylinder, radius rr, length ℓ\ellE (2πrℓ)E\,(2\pi r\ell); ends carry noneE=qenc/ℓ2πε0rE = \dfrac{q_{\text{enc}}/\ell}{2\pi\varepsilon_0 r}
Planar (large sheet)Cylinder or box through the sheet, end area AA2EA2EA; sides carry noneE=σ2ε0E = \dfrac{\sigma}{2\varepsilon_0} for a thin sheet

The sheet result comes from setting the flux through the two end faces, 2EA2EA, equal to σAε0\frac{\sigma A}{\varepsilon_0}, where σA\sigma A is the charge on the patch of sheet inside the box. The distance from the sheet never appears, so the field of an infinite sheet is the same at every distance: its field lines are parallel and do not spread out. For a line charge λ\lambda, the cylinder gives E=λ2πε0rE = \frac{\lambda}{2\pi\varepsilon_0 r}, the same result topic 8.4 reaches by integrating along the whole line.

Inside a uniformly charged solid ball of total charge QQ and radius RR, a Gaussian sphere of radius r<Rr < R encloses only the fraction r3R3\frac{r^3}{R^3} of the volume, so qenc=Qr3R3q_{\text{enc}} = Q\frac{r^3}{R^3} and

E=Qr3/R34πε0r2=Qr4πε0R3.E = \frac{Qr^3/R^3}{4\pi\varepsilon_0 r^2} = \frac{Qr}{4\pi\varepsilon_0 R^3}.

The field grows linearly from zero at the center to its largest value at the surface; outside, it falls as 1r2\frac{1}{r^2}, exactly as if all the charge sat at the center.

The exam asks you to use Gauss's law to calculate fields only for point charges and for spherical, cylindrical and planar symmetry. For a finite rod, a cube or a disk, the law is still true, but no closed surface has a field of constant magnitude perpendicular to it, so it cannot give you EE; use topic 8.4's integration instead. Topic 10.1 applies Gauss's law to conductors.

Finding the enclosed charge from a density

Charge spread over a region is described by a density: λ\lambda (coulombs per meter) along a line, σ\sigma (coulombs per square meter) over a surface, or ρ\rho (coulombs per cubic meter) through a volume. If the density is uniform, multiply it by the length, area or volume. If it varies, add up thin pieces on which it is nearly constant:

Q=∫λ dx,Q=∫σ dA,Q=∫ρ dV.Q = \int \lambda\,dx, \qquad Q = \int \sigma\,dA, \qquad Q = \int \rho\,dV.

The trick is to choose pieces whose every point has the same density. When ρ\rho depends only on rr:

  • for a sphere, use thin spherical shells, dV=4πr2 drdV = 4\pi r^2\,dr;
  • for a cylinder of length ℓ\ell, use thin cylindrical shells, dV=2πrℓ drdV = 2\pi r\ell\,dr;
  • for a flat disk with σ\sigma depending on rr, use thin rings, dA=2πr drdA = 2\pi r\,dr.

Two short examples. A rod along the xx-axis from 00 to LL with λ=βx2\lambda = \beta x^2 carries Q=∫0Lβx2 dx=βL33Q = \int_0^L \beta x^2\,dx = \frac{\beta L^3}{3}. A disk of radius RR with σ=σ0rR\sigma = \sigma_0\frac{r}{R} carries Q=∫0Rσ0rR 2πr dr=2πσ0R23Q = \int_0^R \sigma_0\frac{r}{R}\,2\pi r\,dr = \frac{2\pi\sigma_0 R^2}{3}.

For Gauss's law you usually need the charge inside the Gaussian surface, not the total. Then the upper limit of the integral is the radius of the Gaussian surface (if it lies inside the charge) or the edge of the charge (if the surface lies outside it).

Worked examples

Worked exampleExample 1: growing the surface

A +5.0 nC+5.0\ \text{nC} point charge sits at the center of a spherical Gaussian surface of radius 0.10 m0.10\ \text{m}. Use ε0=8.85×10−12 C2/(N⋅m2)\varepsilon_0 = 8.85\times10^{-12}\ \text{C}^2/(\text{N}\cdot\text{m}^2) and k=9.0×109 N⋅m2/C2k = 9.0\times10^{9}\ \text{N}\cdot\text{m}^2/\text{C}^2.

(a) Calculate the electric flux through the surface and the magnitude of the field on it.

(b) The radius of the surface is tripled to 0.30 m0.30\ \text{m}. Calculate the new flux and field magnitude.

(c) A −2.0 nC-2.0\ \text{nC} charge is placed 0.50 m0.50\ \text{m} from the center. What is the flux through the 0.30 m0.30\ \text{m} surface? What is it if that charge is moved to 0.20 m0.20\ \text{m} from the center?

Show solution

(a) Gauss's law gives the flux directly from the enclosed charge:

ΦE=qencε0=5.0×10−9 C8.85×10−12 C2/(N⋅m2)=565 N⋅m2/C.\Phi_E = \frac{q_{\text{enc}}}{\varepsilon_0} = \frac{5.0\times10^{-9}\ \text{C}}{8.85\times10^{-12}\ \text{C}^2/(\text{N}\cdot\text{m}^2)} = 565\ \text{N}\cdot\text{m}^2/\text{C}.

On the sphere, E=kqr2=(9.0×109)(5.0×10−9)(0.10)2=4.5×103 N/CE = \frac{kq}{r^2} = \frac{(9.0\times10^{9})(5.0\times10^{-9})}{(0.10)^2} = 4.5\times10^{3}\ \text{N/C}, directed radially outward.

(b) The enclosed charge has not changed, so the flux is still 565 N⋅m2/C565\ \text{N}\cdot\text{m}^2/\text{C}. The field on the larger sphere is (9.0×109)(5.0×10−9)(0.30)2=500 N/C\frac{(9.0\times10^{9})(5.0\times10^{-9})}{(0.30)^2} = 500\ \text{N/C}, one ninth as large, because the area grew by a factor of 9 and the flux stayed fixed.

(c) At 0.50 m0.50\ \text{m} the new charge is outside the 0.30 m0.30\ \text{m} sphere, so the flux stays 565 N⋅m2/C565\ \text{N}\cdot\text{m}^2/\text{C}. The field on the sphere is no longer uniform (it is stronger on the side facing the negative charge and weaker on the far side), but the outside charge's own field lines enter and leave the sphere, so its inward and outward flux cancel. At 0.20 m0.20\ \text{m} the charge is inside, so qenc=5.0−2.0=3.0 nCq_{\text{enc}} = 5.0 - 2.0 = 3.0\ \text{nC} and

ΦE=3.0×10−98.85×10−12=339 N⋅m2/C.\Phi_E = \frac{3.0\times10^{-9}}{8.85\times10^{-12}} = 339\ \text{N}\cdot\text{m}^2/\text{C}.
Worked exampleExample 2: a thick charged slab

A large flat slab of insulating plastic is 4.0 cm4.0\ \text{cm} thick and carries a uniform charge density ρ=+2.0 μC/m3\rho = +2.0\ \mu\text{C/m}^3. Treat the slab as infinite in its two long directions, and measure xx from its midplane. Find the electric field (a) 1.0 cm1.0\ \text{cm} from the midplane and (b) 5.0 cm5.0\ \text{cm} from the midplane. Use ε0=8.85×10−12 C2/(N⋅m2)\varepsilon_0 = 8.85\times10^{-12}\ \text{C}^2/(\text{N}\cdot\text{m}^2).

Show solution

Start with the surface. The charge has planar symmetry about the midplane, so E⃗\vec{E} is perpendicular to the slab, points away from the midplane on both sides (the charge is positive), and has the same magnitude at +x+x and −x-x. By the same symmetry, E=0E = 0 on the midplane itself. Use a box with end faces of area AA at +x+x and −x-x, parallel to the slab. The field is perpendicular to both end faces and pointing out of them, and it runs along the four side faces, so

∮E⃗⋅dA⃗=2EA.\oint \vec{E}\cdot d\vec{A} = 2EA.

Placing the box symmetrically about the midplane is the move that makes the field equal on both end faces.

(a) Inside the slab, at x=0.010 mx = 0.010\ \text{m}, the box holds a layer of slab 2x2x thick, so qenc=ρ(2x)Aq_{\text{enc}} = \rho(2x)A:

2EA=ρ 2xAε0⇒E=ρxε0=(2.0×10−6)(0.010)8.85×10−12=2.26×103 N/C,2EA = \frac{\rho\,2xA}{\varepsilon_0} \quad\Rightarrow\quad E = \frac{\rho x}{\varepsilon_0} = \frac{(2.0\times10^{-6})(0.010)}{8.85\times10^{-12}} = 2.26\times10^{3}\ \text{N/C},

directed away from the midplane.

(b) Outside the slab, at x=0.050 mx = 0.050\ \text{m}, the box now holds the slab's full thickness, 2a=0.040 m2a = 0.040\ \text{m}, so qenc=ρ(2a)Aq_{\text{enc}} = \rho(2a)A:

E=ρaε0=(2.0×10−6)(0.020)8.85×10−12=4.52×103 N/C,E = \frac{\rho a}{\varepsilon_0} = \frac{(2.0\times10^{-6})(0.020)}{8.85\times10^{-12}} = 4.52\times10^{3}\ \text{N/C},

directed away from the slab. The answer does not depend on xx: outside, the slab acts like a thin sheet with σ=ρ(2a)\sigma = \rho(2a), and σ2ε0=ρaε0\frac{\sigma}{2\varepsilon_0} = \frac{\rho a}{\varepsilon_0} matches.

Worked exampleExample 3: a nonuniform cylinder (free-response style)

A very long solid insulating cylinder of radius RR has a volume charge density that falls off from its axis as

ρ(r)=ρ0(1−rR)for r≤R,\rho(r) = \rho_0\left(1 - \frac{r}{R}\right) \quad \text{for } r \le R,

where ρ0\rho_0 is a positive constant and rr is the distance from the axis. Express answers in terms of ρ0\rho_0, RR, rr and physical constants.

(a) Derive an expression for the charge per unit length λ\lambda of the cylinder.

(b) Using Gauss's law, derive an expression for the magnitude of the electric field at a distance r<Rr < R from the axis.

(c) Derive an expression for the magnitude of the field at a distance r>Rr > R.

(d) Sketch EE as a function of rr from r=0r = 0 to r=3Rr = 3R. A student claims the field is strongest at the surface of the cylinder. Is the student correct? Justify your answer.

Show solution

(a) The density depends only on rr, so slice a length ℓ\ell of the cylinder into thin cylindrical shells of radius r′r', thickness dr′dr' and volume dV=2πr′ℓ dr′dV = 2\pi r'\ell\,dr', each with uniform density:

q=∫0Rρ0(1−r′R)2πr′ℓ dr′=2πρ0ℓ(R22−R23)=πρ0R2ℓ3.q = \int_0^R \rho_0\left(1 - \frac{r'}{R}\right)2\pi r'\ell\,dr' = 2\pi\rho_0\ell\left(\frac{R^2}{2} - \frac{R^2}{3}\right) = \frac{\pi\rho_0 R^2\ell}{3}.

Dividing by ℓ\ell, λ=πρ0R23\lambda = \dfrac{\pi\rho_0 R^2}{3}.

(b) By cylindrical symmetry, E⃗\vec{E} points radially away from the axis and depends only on rr. Take a coaxial Gaussian cylinder of radius r<Rr < R and length ℓ\ell. The field is perpendicular to its curved side with constant magnitude and lies along its end caps, so the flux is E(2πrℓ)E(2\pi r\ell). The enclosed charge is the same integral with upper limit rr:

qenc=∫0rρ0(1−r′R)2πr′ℓ dr′=2πρ0ℓ(r22−r33R).q_{\text{enc}} = \int_0^r \rho_0\left(1 - \frac{r'}{R}\right)2\pi r'\ell\,dr' = 2\pi\rho_0\ell\left(\frac{r^2}{2} - \frac{r^3}{3R}\right).

Gauss's law, E(2πrℓ)=qencε0E(2\pi r\ell) = \frac{q_{\text{enc}}}{\varepsilon_0}, gives

E=ρ0ε0(r2−r23R).E = \frac{\rho_0}{\varepsilon_0}\left(\frac{r}{2} - \frac{r^2}{3R}\right).

(c) For r>Rr > R the same Gaussian cylinder encloses all the charge in its length, λℓ\lambda\ell:

E(2πrℓ)=πρ0R2ℓ3ε0⇒E=ρ0R26ε0r.E(2\pi r\ell) = \frac{\pi\rho_0R^2\ell}{3\varepsilon_0} \quad\Rightarrow\quad E = \frac{\rho_0R^2}{6\varepsilon_0 r}.

As a check, both expressions give E=ρ0R6ε0E = \frac{\rho_0R}{6\varepsilon_0} at r=Rr = R. With no surface charge, the field must be continuous there.

(d) The sketch starts at E=0E = 0 on the axis (no enclosed charge), rises, reaches a maximum inside the cylinder, comes down to ρ0R6ε0\frac{\rho_0R}{6\varepsilon_0} at r=Rr = R with no jump, and then decreases as 1r\frac{1}{r}, so that at r=2Rr = 2R it is half its value at RR and at 3R3R a third.

Graph of E against r from 0 to 3R, with E in units of rho0 R over epsilon0. E starts at zero at r equals 0, rises to a maximum of 3 rho0 R over 16 epsilon0 at r equals three quarters of R, decreases to rho0 R over 6 epsilon0 at r equals R with no jump, and then falls off as 1 over r, reaching half that value at 2R and a third of it at 3R.

The student is not correct. Inside, dEdr=ρ0ε0(12−2r3R)\frac{dE}{dr} = \frac{\rho_0}{\varepsilon_0}\left(\frac{1}{2} - \frac{2r}{3R}\right), which is zero at r=34Rr = \frac{3}{4}R, positive before it and negative after it. So the field is largest at r=34Rr = \frac{3}{4}R, where E=3ρ0R16ε0E = \frac{3\rho_0R}{16\varepsilon_0}, which is greater than the surface value ρ0R6ε0\frac{\rho_0R}{6\varepsilon_0}. Physically, past r=34Rr = \frac{3}{4}R the thin outer layers add so little charge that the enclosed charge grows more slowly than the area 2πrℓ2\pi r\ell it is spread over.

Where students lose points

On the exam

In a Gauss's law derivation, show each step the reasoning needs: state the law, name the Gaussian surface and say why E⃗\vec{E} is constant and perpendicular on it (and zero flux through the other parts), compute qencq_{\text{enc}} (with an integral when the density varies), and solve for EE. Sketches of EE against rr are graded on behavior: zero or linear growth inside, the right falloff outside (1r2\frac{1}{r^2} for spheres, 1r\frac{1}{r} for cylinders, constant for planes), and continuity at a surface with no surface charge. Factor-of-change questions ("the radius doubles; what happens to EE?") come straight from those dependences. A calculator is allowed throughout the exam.

Check yourself

  1. Question 1

    A point charge qq sits at the exact center of a closed cubical surface. What is the electric flux through one face of the cube?

    1. A

      qε0\dfrac{q}{\varepsilon_0}

    2. B

      q4ε0\dfrac{q}{4\varepsilon_0}

    3. C

      q6ε0\dfrac{q}{6\varepsilon_0}

    4. D

      Gauss's law can't be used because the field is not uniform on a face.

    Show answer

    C

    The total flux through the closed cube is qε0\frac{q}{\varepsilon_0} by Gauss's law, and with the charge at the center the six faces are identical, so each carries one sixth. Choice D confuses finding EE (which needs a uniform field on the surface) with finding flux (which never does).

  2. Question 2

    A solid insulating ball of radius RR has charge spread uniformly through its volume. What is the ratio of the field magnitude at r=R2r = \frac{R}{2} to the field magnitude at r=2Rr = 2R?

    Show answer

    2 (the field at R2\frac{R}{2} is twice the field at 2R2R).

    Inside, E=Qr4πε0R3E = \frac{Qr}{4\pi\varepsilon_0R^3}, which at R2\frac{R}{2} is Q8πε0R2\frac{Q}{8\pi\varepsilon_0R^2}. Outside, E=Q4πε0r2E = \frac{Q}{4\pi\varepsilon_0r^2}, which at 2R2R is Q16πε0R2\frac{Q}{16\pi\varepsilon_0R^2}. The ratio is 2.

  3. Question 3

    A closed surface encloses charges +3q+3q and −q-q. A charge +5q+5q sits outside it. Which statement is correct?

    1. A

      The net flux through the surface is 7qε0\frac{7q}{\varepsilon_0}.

    2. B

      The net flux is 2qε0\frac{2q}{\varepsilon_0}, and the field on the surface is produced only by the two enclosed charges.

    3. C

      The net flux is 4qε0\frac{4q}{\varepsilon_0}, because only the sizes of the enclosed charges count.

    4. D

      The net flux is 2qε0\frac{2q}{\varepsilon_0}, and the field on the surface is produced by all three charges.

    Show answer

    D

    The flux counts only the net enclosed charge, 3q−q=2q3q - q = 2q. The field at each point of the surface is still the total field of every charge, including the outside one, whose flux simply cancels over the closed surface. Choice B gets the flux right but wrongly drops the outside charge from the field.

  4. Question 4

    An insulating ball of radius R=0.20 mR = 0.20\ \text{m} has volume charge density ρ=Ar2\rho = Ar^2, with A=3.0×10−3 C/m5A = 3.0\times10^{-3}\ \text{C/m}^5. What is its total charge?

    Show answer

    Q=4πAR55≈2.4×10−6 CQ = \dfrac{4\pi AR^5}{5} \approx 2.4\times10^{-6}\ \text{C}

    Use thin spherical shells, dV=4πr2 drdV = 4\pi r^2\,dr: Q=∫0RAr2⋅4πr2 dr=4πAR55=4π(3.0×10−3)(0.20)55=2.4×10−6 CQ = \int_0^R Ar^2\cdot4\pi r^2\,dr = \frac{4\pi AR^5}{5} = \frac{4\pi(3.0\times10^{-3})(0.20)^5}{5} = 2.4\times10^{-6}\ \text{C}. Multiplying the density at the surface by the ball's volume would give a value 53\frac{5}{3} times too large.

  5. Question 5

    Why can't Gauss's law by itself give the electric field at a point near the middle of a uniformly charged rod of length 10 cm?

    1. A

      Gauss's law applies only to charges that are infinitely large.

    2. B

      No closed surface around the rod has a field of constant magnitude perpendicular to it everywhere, so EE can't be taken out of the flux integral.

    3. C

      The flux through any closed surface around the rod is zero.

    4. D

      The rod's charge is spread out, and Gauss's law applies only to point charges.

    Show answer

    B

    Gauss's law is true for the rod, but on any closed surface around the rod or part of it, the field changes from place to place: at a given distance from the rod, it is strongest opposite the rod's middle and points straight away from the rod there, and toward the rod's ends it weakens and tilts to point partly along the rod, away from its middle. So EE varies in size and direction over the surface, stays inside the integral, and the law gives only the total flux. Choices A and D describe limits on when the law is useful as if they were limits on when it is true.

Go deeper