Gauss’ Law
Gauss’ law connects the electric field on a closed boundary to the net charge inside it. If we imagine field lines flowing out of or into an imaginary box: the net flow depends only on the enclosed charge.
Gauss’ law can be difficult to understand because it often (for an early physics student) requires two layers of abstraction away from what “feels intuitive”:
-
Rather than discussing the attractive/repulsive Coulomb interaction between charges, we are describing the effect of charges on an abstract vector field embedded in spacetime.
-
We are making statements about the structure of this field using imaginary surfaces.
Before continuing, build intuition for the first layer of abstraction. You should be comfortable representing the electric field as both a vector field (a vector giving the field at each point in space) and a field-line sketch (continuous curves whose tangents follow the field direction). Ideally, you can also compute the electric field for a finite collection of point charges.
Big Picture
A Gaussian surface is an imaginary closed boundary surrounding a volume of space, such as the surface of a sphere or all six faces of a box. It is purely a theoretical construction and has no effect on the electric field, charges, etc.
For now, read electric flux as a (signed) measure of how much field passes through a Gaussian surface. Although the electric field is not a flowing substance, like the water in a river, you may consider this analogy when applying Gauss’ Law. The total flux considers outward-flowing contributions as positive, which are shaded in red below. Likewise, inward-flowing flux is considered negative and shaded in blue.
To avoid clutter, the electric field vectors are only shown at points along the Gaussian surface. The vector arrows only shown direction, but the magnitude can be inferred by the shading.
Gauss’ Law Explorer
Move charges and change the Gaussian surface. Compare enclosed charge with total electric flux.
This interactive didn't load.
Reload the page. If it keeps happening, especially on a school network, the site's files may be filtered. The connection check can tell you what's blocked.
Try these comparisons, watching both the enclosed charge and total flux values:
- Drag a charge across the boundary.
- Compare Centered charge and Off-center charge. The field pattern and surface shading change, but the enclosed charge and total flux stay the same.
- Change the surface’s shape and size while keeping the same charge enclosed. The boundary samples different parts of the field, yet its total flux stays fixed.
- Compare External charge and Enclosed dipole. Both have zero net enclosed charge and zero total flux, even though the field is nonzero. Inward and outward contributions cancel.
The details under Inspect patches and edit charges are available when you are ready. First, let’s develop the mathematical language for computing the electric flux through each small piece of the surface.
Surface Normals
To measure how much field passes through a surface, we need its component perpendicular to that surface. A normal vector is an arrow perpendicular to a surface; a unit normal, , has magnitude one and specifies its orientation. A flat surface has two possible normal directions. Choose one: field along that direction contributes positive flux, and field opposing it contributes negative flux.
For a flat surface in a uniform field,
where is the field magnitude, is the area, is the angle between the field and the chosen normal, and denotes electric flux. Flux has units of .
θ = 30° · Field points through the surface
When the normal points along the field, and . When the field runs along the surface, and the flux is zero. Reversing the normal reverses the sign of the flux.
Why does the cosine appear?
Why does the cosine appear?
Only the perpendicular component contributes. Equivalently, the area presented to the field is the projected area . Multiplying either way gives .
We can package the area and orientation into an area vector, . The same relation is the dot product
If the field varies or the surface curves, divide the surface into tiny patches, each with its own normal, and add their contributions:
Here is the field at patch , is its unit normal, and is its area. The integral over the surface is the limit of that sum as the patches become small, with the infinitesimal area vector and the field at that point.
Closing the Surface
A closed surface surrounds a volume completely, like the six faces of a box or the surface of a sphere. For a closed surface, we choose every normal to point outward. A field pointing out contributes positive flux; a field pointing in contributes negative flux.
In a uniform field, a box has just as much inward flux as outward flux. Inspect its faces below, then change the field’s direction.
Each face has area 4 m² · E = 100 N/C
The net flux is zero even though the field is nonzero on the surface and throughout the box. Zero net flux means the signed contributions cancel; it does not mean there is no field.
Charge Inside, Flux Outside
Now that we have a mathematical definition of electric flux, we can state Gauss’ law:
The sum is over the entire surface, chopped up into little pieces of area . Note that the electric field and normal vector can be different at every point along the surface. More compactly, we write it as a closed surface integral. is the net charge inside inside the surface, and is the electric constant. It is related to Coulomb’s constant by .
This is the precise version of the relationship you explored above. Return to the explorer, and switch on outward normals and inspect patches. The shading and patch readout describe the signed normal component . The corresponding flux of the patch is then scaled by its area.
How does this agree with Coulomb’s law?
How does this agree with Coulomb’s law?
Place a point charge at the center of a sphere of radius . Its field is radial, so the normal component everywhere on the sphere is . The sphere has area , giving
The inverse-square decrease in the field exactly balances the increase in area. A larger sphere has the same total flux. The sign of determines whether the net flux is outward or inward.
This calculation shows the spherical case. The full law applies to any closed surface: changing its shape redistributes the local contributions without changing their sum, as long as no charge crosses the boundary.
What about charges outside the surface?
What about charges outside the surface?
An external charge can produce a strong field on a Gaussian surface. Its contributions to the total flux nevertheless cancel: some point inward and others outward. The cancellation follows from the inverse-square field and the orientation and area of the surface patches; the field strengths at the entry and exit points need not be equal.
By superposition, every charge contributes to the field on the left side of Gauss’ law. Only enclosed charges contribute to the net flux on the right side. Two equal and opposite enclosed charges also give zero net flux, despite producing a nonzero field.
Using Symmetry
Gauss’ law is true for every closed surface. It becomes a shortcut for finding when symmetry tells us the field’s direction and where its magnitude is constant. The trick is in identifying the symmetry of the charge distribution and then choosing a surface that matches this symmetry.
This isn’t always possible. But when it is: identify where the field is normal or tangent to the surface, simplify the flux integral, calculate the enclosed charge, and find the field.
Spherical symmetry: a charged sphere
Spherical symmetry: a charged sphere
For a spherically symmetric charge distribution, choose a concentric Gaussian sphere. The field is radial and has constant magnitude on that sphere. For positive enclosed charge,
Outside a sphere of radius and total charge , all its charge is enclosed, so .
Inside a uniformly charged solid insulating sphere, only the fraction of the charge is enclosed:
The field rises linearly from zero at the center, then falls as outside. This differs from a conductor in electrostatic equilibrium, whose field inside the conducting material is zero.
Cylindrical symmetry: an infinite line of charge
Cylindrical symmetry: an infinite line of charge
For an infinite straight line with uniform charge per length , use a coaxial cylinder of radius and length . The field is radial and constant on the curved side. It is tangent to both end caps, which contribute zero flux.
For positive , the field points away from the line; for negative , it points toward it. A long finite wire approximates this result near its middle when is small compared with its length.
Problem Solving
Net Charge and Total Flux
Net Charge and Total Flux
Problem
A closed surface encloses and . A charge lies outside. What is the net electric flux?
Use
.
Solve
Check
Positive net enclosed charge gives positive outward flux; the external charge affects the field but adds no net flux.
Inside a Uniformly Charged Sphere
Inside a Uniformly Charged Sphere
Problem
A solid insulating sphere of radius carries a uniformly distributed charge . Find the field at .
Use
and .
Solve
directed radially outward.
Check
At half the sphere’s radius, the field is half its surface value, consistent with the linear dependence inside.
Field of an Infinite Sheet
Field of an Infinite Sheet
Problem
An isolated infinite sheet has uniform charge density . Find the field magnitude on either side.
Use
A pillbox has flux through two end caps: .
Solve
The field points away from the positively charged sheet on each side.
Check
The arbitrary cap area cancels, and both sides contribute equally to the outward flux.
Gauss’ Law Checkpoint1 of 5