Deriving Gauss’s Law with Signed Solid Angle
An off-center charge gives a stronger field on the nearby side of a sphere than on the far side. Yet
moving the charge anywhere inside leaves its total flux through the sphere unchanged. A charge
outside also creates a field on the sphere, but in that case the total flux is zero. How can an
integral distinguish inside from outside when the integrand depends on the charge position and on
the shape of the surface?
ES02 showed how to add Coulomb fields from discrete and continuous sources. Here we apply the
same law to a different integration problem. The charge stays fixed while the observation point
moves over a surface. We will derive the flux from a single charge, then use superposition to treat
many charges. Two direct integrals and a second proof make the sign and the inside/outside
distinction explicit.
Scope.
We use electrostatics in vacuum and SI units. The closed surface S = ∂V encloses a bounded
region V and is oriented outward. Assume S is smooth, or piecewise smooth with finitely many
regular pieces. The derivation uses rays with finitely many transverse crossings in almost every
direction. Edges, tangencies and other exceptional directions of zero solid-angle measure do not
enter the integral. A point charge must lie away from S. Familiarity with dot products, cross
products, and definite integrals is enough for the main proof. A separate proof uses the divergence
theorem.
1 Electric flux through an oriented patch
The oriented area element is dA = ndA. The positive scalar dA measures the patch area, and the
unit Normal n specifies its orientation. On a closed surface, outward means from V into its
complement, including from material into an enclosed cavity.
For a small flat patch with nearly constant field and normal, the leading flux is (E ⋅n)ΔA.
Partition a surface into patches Sj, evaluate the field and normal at a sample point on each, and
refine the partition. This gives the electric flux
For a closed surface we write ∮
S. The normal component is positive for an outward field,
negative for an inward field, and zero for a tangent field. The units of flux are N m2∕C. A
single integral of the normal component gives one scalar and leaves the local field values
undetermined.
2 From Coulomb’s law to signed solid angle
Use r′ for the fixed source position and r for the moving observation point on the surface. Define
R = r − r′, R = |R| and R = R∕R. With ke = 1∕(4π𝜖0), the Coulomb field and its contribution to
flux are
The direction R points away from the source regardless of the sign of q. The factor q supplies the
sign of the field.
2.1 Start with a charge at the center of a sphere
Take a sphere of radius a > 0 centered at the charge. On its surface R = a, and the
outward normal is R, so R ⋅n = 1. The signed normal field keq∕a2 is constant over the
sphere. Using polar and azimuthal angles 𝜃,ϕ about the charge gives dA = a2 sin 𝜃 d𝜃 dϕ.
Thus
The cancellation happens patch by patch: for the same angular patch, doubling a makes the area
four times as large and the field one quarter as strong. The ratio dA∕a2 is the area of the
corresponding patch on the unit sphere. On a general surface the distance varies and the patch can
tilt relative to the ray. To recover an angular area, project perpendicular to the ray and divide by
R2, keeping track of the orientation.
Figure 1. The patch normal sets the sign of the radial projection. The unit-sphere arc indicates
where neighboring rays land. For the patch shown, the projected area is positive.
Radial projection of an oriented patch sends each point r of the patch to its direction R on
the unit sphere centered at the source. The signed solid angle dΩ is the oriented area of this
image, with the unit sphere oriented away from the source. Let γ be the angle between R and n.
The patch area projected onto the plane perpendicular to the ray is dA cos γ with sign. Rescaling
lengths by 1∕R multiplies that area by 1∕R2.
Here is the differential calculation. Parametrize the patch with coordinates u,v ordered so that
dA = (ru × rv) dudv, where ru = ∂r∕∂u and likewise for v. Because r′ is fixed, Ru = ru.
Differentiate R2 = R ⋅ R at fixed v and divide by 2R:
Differentiating R = R∕R now gives both tangent vectors on the unit sphere:
Take their cross product and dot it with the outward unit-sphere normal R. Each cross-product
term containing R has zero scalar triple product against R. The remaining term is
The sign changes when the patch normal reverses. Solid angle is dimensionless because both dA
and R2 have units of area. Its named unit is the steradian. Equations (2) and (6) give
dΦ = keq dΩ. This is exact in the differential limit, including when nearby patches lie at different
distances.
3 Count ray crossings over the whole surface
Launch a ray r′ + tu, t > 0, for one unit direction u. At a regular crossing, R = u. An exit has
u ⋅n > 0 and contributes +1 to the signed ray crossing count. An entry has a negative dot
product and contributes −1. The numbers are multiplicities for the same direction, so a narrow
cone may pick up several patches with opposite signs.
Let I(t) = 1 when the ray is inside V and I(t) = 0 outside. An exit decreases I by one, while an
entry increases it by one. Thus the signs of the counted crossings are the negatives of the jumps of
I. Along a ray that ends outside the bounded region,
The sum telescopes even when the ray leaves a region and later returns to it. This is the step that
permits concave boundaries, several components, and cavities.
Figure 2. On the left a ray from inside has an unpaired exit after any entry-exit pairs cancel. On
the right a ray from outside has one entry and one exit. The symbols describe the signs of signed
solid angle.
Integrate the signed multiplicity in Equation (7) over all launch directions. In polar angles on the
unit sphere the area element is sin 𝜃 d𝜃 dϕ, and its total is
Every regular direction contributes once for an inside source and zero times for an outside source.
Hence the point-charge result is
For q < 0, an inside charge gives negative flux. The count of geometric crossings stays the
same.
4 Add sources to obtain Gauss’s law
Electric fields superpose, and Equation (1) is linear in the field. For point charges qi at r′i away
from the boundary,
For a bounded volume density ρ with bounded support, use dq = ρ(r′) dV ′ and integrate each
point-source result. The volume and surface integrals may be exchanged because their joint
integrand is absolutely integrable. Section 12 gives the bound, including when the density extends
across S. Integrating over the surface first gives
A line or surface distribution of finite total absolute charge away from S can be added by the same
argument with λdℓ′ or σ dA′ and a positive separation from S. In each case, Gauss’s Law
is
where Qenc is the signed charge in V . This result needs no symmetry of the field. Symmetry
becomes useful if the goal is to extract E from the single flux constraint.
5 A second proof using a small sphere
This proof avoids counting rays. Put Ri = ri − ri′ in Cartesian components. At a field point
distinct from the source, ∂Rj∕∂ri = δij. Since ∂iR = Ri∕R, the chain rule gives ∂iR−3 = −3R
i∕R5.
Now compute the divergence:
For an exterior source the field is smooth throughout V , so the divergence theorem immediately
gives zero flux. For an interior source remove a ball of radius δ centered at the charge. Choose δ
small enough that the closed ball lies completely inside V . The remaining region V δ excludes the
singular point. At its new inner boundary the outward normal points into the ball and is
−R.
Figure 3. The divergence theorem applies to the shaded region after the singular point is removed.
For the positive charge shown, the field and the outward normal of that region point in opposite
directions on the small spherical boundary.
The flux on the small sphere, with this inner orientation, is
The divergence theorem says the sum of the original surface flux and this inner flux is zero.
Therefore the original surface flux is q∕𝜖0. The answer is independent of δ because the
inverse-square field and the sphere area cancel exactly. Equation (13) holds only away from R = 0,
so it cannot be integrated directly over a region containing the charge.
6 Worked example 1: move a charge off the center of a sphere
Take an observation sphere of radius a > 0 centered at the origin and a charge q at r′ = bz, with
b ≥ 0 and b≠a. Calculate the full flux by integrating the actual normal component. For 0 < b < a,
also calculate the flux through the northern hemisphere with the same outward radial
orientation.
Figure 4. The outward surface normal is radial from the sphere center. The displacement R starts
at the source, so it generally makes an angle with that normal. The northern hemisphere ends at
the dashed equator.
Write the observation position as r = ar, with polar angle 𝜃 from +z. Its normal is
r. Put u = cos 𝜃. The numerator in the normal field and the square of the separation
are
Use dA = a2 sin 𝜃 d𝜃 dϕ. The azimuthal integrand is constant and its integral contributes 2π.
Because du = − sin 𝜃 d𝜃, the limits 𝜃 = 0,π become u = 1,−1. Reverse these limits to absorb the
minus sign:
For b = 0, the integral is 2∕a2, giving 4πk
eq directly.
For b > 0, set t = a2 + b2 − 2abu = R2. Then du = −dt∕(2ab) and
The old lower limit u = −1 maps to (a + b)2, and u = 1 maps to (a − b)2. Reverse the limits
again:
The upper endpoint contributes (a + b) − (a − b) = 2b. At the lower endpoint the square root
is |a − b|. If b < a, the lower contribution is (a − b) − (a + b) = −2b. If b > a, it is
(b − a) − [−(a + b)] = 2b. Inserting these values,
Using a − b in place of |a − b| would select the inside result even for an exterior charge. For q > 0
and b > a, the local normal component in Equation (16) is inward where u > a∕b and outward
where u < a∕b. Both regions contribute before their fluxes cancel.
6.1 How much of the flux crosses the northern hemisphere?
For q≠0 and 0 < b < a, 𝜃 ranges only from 0 to π∕2. The corresponding limits on t are (a − b)2
and a2 + b2 in increasing order. At the new upper limit the bracket in Equation (18)
is
The lower endpoint is still −2b. The hemispherical fluxes are
They approach equal halves as b tends to zero. For b∕a ≪ 1, the binomial expansion
gives
In detail, with η = b∕a, the ratio b∕
= η(1 + η2)−1∕2 equals η − η3∕2 + O(η5).
Halving this term gives Equation (22). At a = 1.00 m, b = 0.600 m, and q = 4.00 nC, the
fraction through the north is 0.75725. Using 𝜖0 = 8.854 × 10−12 C2∕(N m2) gives about
342 N m2∕C through the north and 110 N m2∕C through the south. Their unrounded sum is
451.8 N m2∕C.
Figure 5 shows the northern linear approximation only for 0 ≤ η ≤ 0.20. To bound its error, put
w =
. Subtract the exact fraction in Equation (21) from the linear approximation and
rationalize w − 1:
Since w ≥ 1, this upper bound is 0.002 on the plotted interval, or 0.2 percentage points of total
flux.
At the other end, take the limit of the exact fractions while b < a. The ratio b∕
tends to
1∕
as b → a−, so
The open circles mark the limits from inside. At b = a the charge would be on the integration
surface and the field would be singular at the pole.
Figure 5. The exact hemispherical fractions sum to one for 0 ≤ b∕a < 1. The dashed northern
approximation 1∕2 + b∕(2a) is drawn through b∕a = 0.20. Open circles show the one-sided limits
as the charge approaches the sphere from inside.
7 Worked example 2: flux through an open disk
This disk receives flux from a point charge. Take a disk of radius A in the plane z = 0 with positive
normal z, and put q at z = −h, h > 0. A ring of observation points at radius s has dA = sdsdϕ.
For an observation point on that ring,
Figure 6. The ray to the rim makes angle 𝜃max with the disk normal. The annulus of radius s
supplies observation points with a common normal field.
After the azimuthal integral the flux is 2πkeqh∫
0As(s2 + h2)−3∕2 ds. For w = s2 + h2 we have
dw = 2sds. The limits become h2 and A2 + h2. Therefore
The square root of h2 is h under the stated assumption. As a geometric check, the disk
subtends the cone 0 ≤ 𝜃 ≤ 𝜃max, where cos 𝜃max = h∕
. The signed solid angle is
2π ∫
0𝜃max sin 𝜃 d𝜃 = 2π(1 − cos 𝜃
max), positive for this orientation. Multiplying by keq reproduces
the integral.
For A∕h ≪ 1, set x = (A∕h)2. Keeping the next term makes the constant-field approximation
quantitative:
The leading term is the field at the disk center times the area. The correction reduces the
magnitude for either sign of q. At fixed h and A →∞, Equation (26) gives q∕(2𝜖0) because the
viewing cone approaches a hemisphere. Reversing the disk orientation reverses all these
fluxes.
8 Worked example 3: a hollow spherical region with two boundaries
Let V be the shell a < r < c with 0 < a < c. Put q0 at the center of the cavity and q1 at an
arbitrary point of the shell. Assume no charge is on either boundary. On the outer sphere the
outward normal is +r. That sphere, with its conventional outward orientation, encloses both
charges, so Φout = (q0 + q1)∕𝜖0.
On the inner sphere the normal of the shell points into the cavity, so it is −r. With the
conventional outward normal of the ball r < a, the inner sphere would have flux q0∕𝜖0. Reversing
its normal gives the shell’s Φin = −q0∕𝜖0. Adding the two contributions,
This accounts for the two boundary components without requiring a symmetric field. As a
direct check on the central charge alone, its radial field is keq0∕r2. Integrating with the
respective normals gives +4πkeq0 on the outer sphere and −4πkeq0 on the inner sphere.
The cavity source is outside the material of the shell, and its two contributions sum to
zero.
9 What the flux result lets you infer
- Choose the outward normal of the region. The inner wall of a cavity points the
other way from the normal of the solid ball that would fill it.
- Use a closed surface when counting enclosed charge. An open disk can receive
positive or negative flux. It has no enclosed volume.
- Separate total flux from field magnitude. Outside charges can produce an inward
field on some patches and an outward field on others. Knowing the total only fixes
their signed integral.
- Justify any simplification of the flux integral. Pulling a normal field component
out of an integral requires that it be constant over the portion in question. A spherical
surface alone supplies no such property for a displaced source.
- Use one-sided limits when a point source approaches a boundary. The result
was derived with the source away from the surface. A boundary singularity requires a
separate prescription.
10 Exercises
- A flat open panel has area 0.0750 m2. Its chosen normal makes 120∘ with a uniform
field of magnitude 180 N∕C. Find the flux for both possible orientations.
- A cube of side ℓ is immersed in a uniform field E0z, with faces parallel to the coordinate
planes. Find all six face fluxes and the total. What does the result tell you about the
local field?
- A positive point charge lies inside an observation sphere at displacement b = a∕2
toward its north pole. Find the fraction of its flux through each hemisphere.
- A closed surface encloses +5.00 nC and −2.00 nC. A third charge of −4.00 nC lies
outside. Find the net flux. How does moving the third charge closer affect the
conclusion?
- A positive point charge is a distance h below the center of an upward-oriented disk.
Find the disk radius for which its flux equals one quarter of q∕𝜖0.
- In the hollow region of Worked Example 3 set q0 = +6.00 nC and q1 = −2.00 nC. Find
both component fluxes and the net flux.
- A ball of radius a contains ρ = ρ0(1 + αz∕a), with ρ0 > 0 and |α| ≤ 1. Find the
total flux through its boundary. Then calculate the field at its center directly from
Coulomb’s law to show what the total flux alone misses.
11 Complete exercise solutions
- The normal component is E cos 120∘ = −90 N∕C. Thus Φ = (−90)(0.0750) =
−6.75 N m2∕C. Reversing the normal changes the angle to 60∘ and gives +6.75 N m2∕C.
- The top and bottom normals are +z and −z, respectively. The top gives +E0ℓ2 and
the bottom −E0ℓ2. Each side normal lies in the xy plane and gives zero. The sum
vanishes even when E0 is nonzero everywhere.
- Divide Equation (21) by q∕𝜖0 and insert b = a∕2. The ratio b∕
=
(a∕2)∕(a
∕2) = 1∕
. The northern fraction is (1+1∕
)∕2 ≈ 0.7236. The southern
fraction is (1 − 1∕
)∕2 ≈ 0.2764.
- The signed enclosed charge is (5.00 − 2.00) nC = 3.00 nC. Divide by 𝜖0 to get
3.39×102 N m2∕C. The contribution from the third charge is zero in the surface integral
as long as it stays outside. Its local field generally changes when it moves.
- Divide Equation (26) by q∕𝜖0: Φdisk∕(q∕𝜖0) =
(1 − h∕
). Set this to 1∕4,
which gives h∕
= 1∕2. Both sides are positive. Squaring gives A2 + h2 = 4h2,
hence A =
h.
- The outer sphere conventionally encloses q0 + q1 = +4.00 nC, so its flux is +4.52 ×
102 N m2∕C. The inner normal points into the cavity. Its flux is −q
0∕𝜖0 = −6.78 ×
102 N m2∕C. Adding before rounding gives q
1∕𝜖0 = −2.26 × 102 N m2∕C.
- Reflection z
− z shows that the term proportional to z integrates to zero in the charge
integral. The constant term gives Qenc = 4πρ0a3∕3, so the flux is this quantity
divided by 𝜖0. For the field at the center, each source position r′ has R = −r′. The
constant part of the density cancels in the vector integral. The remaining field
has only a z component by rotations about z. With 𝜃 the source polar angle,
z′ = r′ cos 𝜃:
The radial integral is a2∕2. With u = cos 𝜃, the last integral becomes ∫
−11u2 du = 2∕3. The
angular factor is therefore 4π∕3, and Ez(0) = −αρ0a∕(6𝜖0). For positive α the greater
positive density above the center pushes the field downward there.
The flux proof completes the transition from adding individual Coulomb fields to using a
surface integral as a constraint. With sufficiently symmetric sources, that constraint
determines the field efficiently. The next ES03 examples apply it to planes, cylinders, and
spheres.
12 Optional mathematical note: exchanging the integrals
Let K be the support of the bounded volume density and let ρmax bound |ρ|. Choose a common
finite distance L so that |r′− r|≤ L for every r′∈ K and r ∈ S. Such an L exists because both
sets are bounded. At each fixed surface point, use |R ⋅n|≤ 1 and enlarge the source
integration region to a ball of radius L. In that ball use spherical coordinates about r,
with radial variable s = |r′− r|. Omitting the constant ke, the absolute-value integral
obeys
The spherical volume element supplies the factor s2 that cancels the singular radial factor
under the integral. The bound is uniform on S. Since S has finite area, integrating this
bound over S proves absolute integrability, and Fubini’s theorem allows the exchange.
The point-charge flux formula is needed only for r′ off S because S has zero volume
measure.
References
References
[1] D. J. Griffiths, Introduction to Electrodynamics, 4th ed., chapter 2.
[2] P. Dourmashkin et al., Electricity and Magnetism, MIT TEAL, chapter 3, Gauss’s
law.
[3] Massachusetts Institute of Technology, Electricity and Magnetism: Electrostatics,
MIT Open Learning Library, 8.02.1x, course materials.
[4] J. D. Jackson, Classical Electrodynamics, 3rd ed., chapter 1, electrostatics.
[5] PhysicsLibrary, Electric Dipoles and Continuous Charge Distributions (ES02).
[6] PhysicsLibrary, Electromagnetic Waves: Electric Flux (EM06).
[7] PhysicsLibrary, Electromagnetic Waves: Gauss’s Law (EM07).