1. Home
  2. Explore
  3. Physics
  4. Gauss’s Law and Electric Fields

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Gauss’s Law and Electric Fields

Electromagnetic Fields, Charge Conservation, and Potentials

Maxwell’s equations and the sources of fields

Electric and magnetic fields are related to distributions of charge and current. The four Maxwell equations describe these relationships. In SI units, their differential forms are:

Gauss’s law for electricity

∇⋅E=ρε0\nabla \cdot \mathbf{E}=\frac{\rho}{\varepsilon_0}∇⋅E=ε0​ρ​

The divergence of the electric field at a point is proportional to the charge density ρ\rhoρ there. Positive charge acts as a source of electric field; negative charge acts as a sink.

The corresponding integral form is:

∮SE⋅dS=Qencε0\oint_S \mathbf{E}\cdot d\mathbf{S} = \frac{Q_{\mathrm{enc}}}{\varepsilon_0}∮S​E⋅dS=ε0​Qenc​​

The net electric flux through a closed surface SSS depends on the total charge enclosed by that surface. For a continuous charge distribution occupying a volume VVV,

Qenc=∫Vρ dVQ_{\mathrm{enc}}=\int_V \rho\,dVQenc​=∫V​ρdV

Thus, the integral and differential forms express the same idea at different scales: total charge determines the net electric flux through a surrounding surface, while charge density determines the field’s divergence point by point.

Gauss’s law for magnetism

∇⋅B=0\nabla \cdot \mathbf{B}=0∇⋅B=0

and, in integral form,

∮SB⋅dS=0\oint_S \mathbf{B}\cdot d\mathbf{S}=0∮S​B⋅dS=0

This expresses the absence of magnetic monopoles in classical electromagnetism: magnetic field lines do not begin or end at isolated magnetic charges. The net magnetic flux through any closed surface is zero.

Faraday’s law

∇×E=−∂B∂t\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}∇×E=−∂t∂B​

A changing magnetic field produces a circulating electric field. The minus sign encodes the direction of the induced field: it opposes the change that produces it.

When the magnetic field does not vary with time, Faraday’s law reduces to

∇×E=0\nabla \times \mathbf{E}=0∇×E=0

Ampère–Maxwell law

∇×B=μ0J+μ0ε0∂E∂t\nabla \times \mathbf{B} = \mu_0\mathbf{J} + \mu_0\varepsilon_0\frac{\partial \mathbf{E}}{\partial t}∇×B=μ0​J+μ0​ε0​∂t∂E​

A magnetic field can circulate around a current density \mathbf{J. A changing electric field also contributes to the curl of the magnetic field through the displacement-current term, μ0ε0 ∂E/∂t\mu_0\varepsilon_0\,\partial\mathbf{E}/\partial tμ0​ε0​∂E/∂t.

The Maxwell equations therefore connect electric and magnetic fields in two ways:

  • A changing magnetic field produces a circulating electric field.

  • A current or a changing electric field produces a circulating magnetic field.

The measurable fields are E\mathbf{E}E and B\mathbf{B}B. The charge and current distributions that source them are ρ\rhoρ and J\mathbf{J}J.


Charge density, current density, and conservation

Charge and current density

The charge density ρ(r,t)\rho(\mathbf{r},t)ρ(r,t) describes how much charge is present per unit volume at location r\mathbf{r}r and time ttt. Its SI unit is coulombs per cubic metre:

[ρ]=C m−3[\rho]=\mathrm{C\,m^{-3}}[ρ]=Cm−3

The current density J(r,t)\mathbf{J}(\mathbf{r},t)J(r,t) describes the flow of charge per unit area. It is a vector because it has both a magnitude and a direction, and its SI unit is amperes per square metre:

[J]=A m−2[\mathbf{J}]=\mathrm{A\,m^{-2}}[J]=Am−2

Integrating charge density over a volume gives the total charge in that volume:

Q=∫Vρ dVQ=\int_V \rho\,dVQ=∫V​ρdV

Current density describes how charge crosses a surface. The current flowing outward through a surface element is J⋅dS\mathbf{J}\cdot d\mathbf{S}J⋅dS, so the total outward current through a closed surface SSS is

∮SJ⋅dS\oint_S \mathbf{J}\cdot d\mathbf{S}∮S​J⋅dS

The continuity equation

Charge is conserved: charge cannot simply appear or disappear within a region. If positive outward current carries charge away through the boundary of a volume, the amount of charge inside that volume must decrease.

The rate of change of charge inside volume VVV is

ddt∫Vρ dV=−∮SJ⋅dS\frac{d}{dt}\int_V \rho\,dV = -\oint_S \mathbf{J}\cdot d\mathbf{S}dtd​∫V​ρdV=−∮S​J⋅dS

The negative sign indicates that outward current reduces the charge remaining inside. Applying the divergence theorem,

∮SJ⋅dS=∫V∇⋅J dV\oint_S \mathbf{J}\cdot d\mathbf{S} = \int_V \nabla\cdot\mathbf{J}\,dV∮S​J⋅dS=∫V​∇⋅JdV

gives

∫V(∂ρ∂t+∇⋅J)dV=0\int_V \left( \frac{\partial \rho}{\partial t} + \nabla\cdot\mathbf{J} \right)dV=0∫V​(∂t∂ρ​+∇⋅J)dV=0

Because this relationship holds for any volume, the integrand must vanish at every point:

∂ρ∂t+∇⋅J=0\frac{\partial \rho}{\partial t} + \nabla\cdot\mathbf{J}=0∂t∂ρ​+∇⋅J=0

The continuity equation states that local charge density changes only when charge flows into or out of the region.

If ∇⋅J>0\nabla\cdot\mathbf{J}>0∇⋅J>0, more current flows out of a small region than flows in, so its charge density decreases. If ∇⋅J<0\nabla\cdot\mathbf{J}<0∇⋅J<0, there is net inward current, so the charge density increases.


Electrostatic potential

Defining a scalar potential

For an electrostatic field, the magnetic field is not changing with time, so Faraday’s law gives

∇×E=0\nabla\times\mathbf{E}=0∇×E=0

A curl-free electric field can be written as the gradient of a scalar potential. With the standard sign convention,

E=−∇ϕ\mathbf{E}=-\nabla\phiE=−∇ϕ

Here ϕ\phiϕ is the electrostatic potential. The minus sign means that the electric field points in the direction in which the potential decreases most rapidly.

The potential difference between two points AAA and BBB is related to the electric field by

ϕ(B)−ϕ(A)=−∫ABE⋅dℓ\phi(B)-\phi(A) = -\int_A^B \mathbf{E}\cdot d\boldsymbol{\ell}ϕ(B)−ϕ(A)=−∫AB​E⋅dℓ

For a curl-free electrostatic field, this integral is independent of the path between AAA and BBB. The potential difference is therefore uniquely determined by the endpoints, even though the path used to calculate it may vary.

A potential is defined only up to an additive constant. For localized charge distributions, a common convention is to set the potential to zero at infinity. This reference then assigns a specific value of potential to each point.

Poisson’s equation

Substituting E=−∇ϕ\mathbf{E}=-\nabla\phiE=−∇ϕ into Gauss’s law gives

∇⋅(−∇ϕ)=ρε0\nabla\cdot(-\nabla\phi)=\frac{\rho}{\varepsilon_0}∇⋅(−∇ϕ)=ε0​ρ​

and therefore

∇2ϕ=−ρε0\nabla^2\phi=-\frac{\rho}{\varepsilon_0}∇2ϕ=−ε0​ρ​

This is Poisson’s equation. It relates the charge density at each point to the curvature of the electrostatic potential there. In a region with no charge, it reduces to Laplace’s equation, ∇2ϕ=0\nabla^2\phi=0∇2ϕ=0.

For a point charge qqq at the origin, with the potential set to zero at infinity, the potential at distance rrr is

ϕ(r)=14πε0qr\phi(\mathbf{r}) = \frac{1}{4\pi\varepsilon_0}\frac{q}{r}ϕ(r)=4πε0​1​rq​

For a continuous charge distribution, the potential at an observation point r\mathbf{r}r is the sum of the contributions from all source locations r′\mathbf{r}'r′:

ϕ(r)=14πε0∫V′ρ(r′)∣r−r′∣ dV′\phi(\mathbf{r}) = \frac{1}{4\pi\varepsilon_0} \int_{V'} \frac{\rho(\mathbf{r}')}{|\mathbf{r}-\mathbf{r}'|} \,dV'ϕ(r)=4πε0​1​∫V′​∣r−r′∣ρ(r′)​dV′

The potential formulation is useful because the source charge density directly determines a scalar function, from which the electric field can then be found by taking a gradient.


Magnetic fields and the vector potential

Why a scalar potential is not generally sufficient

For a static current, the Ampère law becomes

∇×B=μ0J\nabla\times\mathbf{B}=\mu_0\mathbf{J}∇×B=μ0​J

If the current density is nonzero, the magnetic field generally has a nonzero curl. A field that is the gradient of a scalar has zero curl, so a general magnetic field produced by currents cannot be represented by a simple scalar magnetic potential throughout the region containing those currents.

However, Gauss’s law for magnetism always gives

∇⋅B=0\nabla\cdot\mathbf{B}=0∇⋅B=0

A divergence-free field can be expressed as the curl of a vector field. This motivates defining the magnetic vector potential A\mathbf{A}A by

B=∇×A\mathbf{B}=\nabla\times\mathbf{A}B=∇×A

This definition automatically satisfies ∇⋅B=0\nabla\cdot\mathbf{B}=0∇⋅B=0, because the divergence of a curl is always zero.

Finding the vector potential in magnetostatics

Substituting B=∇×A\mathbf{B}=\nabla\times\mathbf{A}B=∇×A into the magnetostatic Ampère law gives

∇×(∇×A)=μ0J\nabla\times(\nabla\times\mathbf{A})=\mu_0\mathbf{J}∇×(∇×A)=μ0​J

The vector identity

∇×(∇×A)=∇(∇⋅A)−∇2A\nabla\times(\nabla\times\mathbf{A}) = \nabla(\nabla\cdot\mathbf{A})-\nabla^2\mathbf{A}∇×(∇×A)=∇(∇⋅A)−∇2A

allows the equation to be rewritten in terms of the divergence and Laplacian of A\mathbf{A}A. A convenient choice is the Coulomb gauge,

∇⋅A=0\nabla\cdot\mathbf{A}=0∇⋅A=0

With this choice,

∇2A=−μ0J\nabla^2\mathbf{A}=-\mu_0\mathbf{J}∇2A=−μ0​J

This is a vector Poisson equation. It represents three component equations: each component of the current density sources the corresponding component of the vector potential.

For a localized steady current distribution, the solution is

A(r)=μ04π∫V′J(r′)∣r−r′∣ dV′\mathbf{A}(\mathbf{r}) = \frac{\mu_0}{4\pi} \int_{V'} \frac{\mathbf{J}(\mathbf{r}')}{|\mathbf{r}-\mathbf{r}'|} \,dV'A(r)=4πμ0​​∫V′​∣r−r′∣J(r′)​dV′

Once A\mathbf{A}A is known, the magnetic field follows from B=∇×A\mathbf{B}=\nabla\times\mathbf{A}B=∇×A.

Connection to the Biot–Savart law

Taking the curl of the vector-potential expression produces the Biot–Savart law:

B(r)=μ04π∫V′J(r′)×(r−r′)∣r−r′∣3 dV′\mathbf{B}(\mathbf{r}) = \frac{\mu_0}{4\pi} \int_{V'} \frac{ \mathbf{J}(\mathbf{r}')\times(\mathbf{r}-\mathbf{r}') }{ |\mathbf{r}-\mathbf{r}'|^3 } \,dV'B(r)=4πμ0​​∫V′​∣r−r′∣3J(r′)×(r−r′)​dV′

Each current element contributes a magnetic field whose direction is perpendicular to both the direction of current flow and the displacement from that current element to the observation point. The vector-potential method and the Biot–Savart law are equivalent ways to determine the magnetic field of steady currents.


Gauge freedom and measurable fields

The vector potential is not unique. If a scalar function g(r,t)g(\mathbf{r},t)g(r,t) is added through

A′=A+∇g\mathbf{A}'=\mathbf{A}+\nabla gA′=A+∇g

then

∇×A′=∇×A+∇×∇g=B\nabla\times\mathbf{A}' = \nabla\times\mathbf{A} + \nabla\times\nabla g = \mathbf{B}∇×A′=∇×A+∇×∇g=B

because the curl of a gradient is zero. Thus, different vector potentials can produce the same magnetic field.

Choosing a particular condition on the potentials is called choosing a gauge. In magnetostatics, the Coulomb-gauge condition ∇⋅A=0\nabla\cdot\mathbf{A}=0∇⋅A=0 is often useful because it simplifies the equation for A\mathbf{A}A. The gauge condition is a mathematical choice, not a change in the physical magnetic field.

Likewise, adding a constant to the electrostatic potential does not change E=−∇ϕ\mathbf{E}=-\nabla\phiE=−∇ϕ. In both cases, the potentials assist calculations, while the electric and magnetic fields are the observable quantities.


Time-varying fields and dynamic potentials

Why the electrostatic description must change

When the magnetic field varies with time, Faraday’s law gives

∇×E=−∂B∂t\nabla\times\mathbf{E} = -\frac{\partial\mathbf{B}}{\partial t}∇×E=−∂t∂B​

The curl of E\mathbf{E}E is then generally nonzero, so the full electric field cannot be written as the gradient of a scalar potential alone.

The magnetic field can still be represented as

B=∇×A\mathbf{B}=\nabla\times\mathbf{A}B=∇×A

Using this form in Faraday’s law gives

∇×E=−∇×∂A∂t\nabla\times\mathbf{E} = -\nabla\times\frac{\partial\mathbf{A}}{\partial t}∇×E=−∇×∂t∂A​

or

∇×(E+∂A∂t)=0\nabla\times \left( \mathbf{E}+\frac{\partial\mathbf{A}}{\partial t} \right)=0∇×(E+∂t∂A​)=0

The quantity in parentheses is curl-free and can therefore be expressed as the negative gradient of a scalar potential Φ\PhiΦ:

E+∂A∂t=−∇Φ\mathbf{E}+\frac{\partial\mathbf{A}}{\partial t} = -\nabla\PhiE+∂t∂A​=−∇Φ

Thus the electric field in a time-varying situation is

E=−∇Φ−∂A∂t\mathbf{E} = -\nabla\Phi - \frac{\partial\mathbf{A}}{\partial t}E=−∇Φ−∂t∂A​

The first term is associated with spatial changes in the scalar potential. The second arises from a time-varying vector potential and accounts for the induced, circulating part of the electric field.

Gauge transformations in the dynamic case

The dynamic potentials also have gauge freedom. Under the transformation

A′=A+∇g\mathbf{A}'=\mathbf{A}+\nabla gA′=A+∇g

the scalar potential must transform as

Φ′=Φ−∂g∂t\Phi'=\Phi-\frac{\partial g}{\partial t}Φ′=Φ−∂t∂g​

to leave both physical fields unchanged:

B′=∇×A′=B\mathbf{B}'=\nabla\times\mathbf{A}'=\mathbf{B}B′=∇×A′=B

and

E′=−∇Φ′−∂A′∂t=E\mathbf{E}'=-\nabla\Phi'-\frac{\partial\mathbf{A}'}{\partial t} =\mathbf{E}E′=−∇Φ′−∂t∂A′​=E

The potentials may therefore change while E\mathbf{E}E and B\mathbf{B}B remain the same.

Lorenz gauge and the wave equations

A useful dynamic gauge condition is the Lorenz gauge:

∇⋅A+1c2∂Φ∂t=0\nabla\cdot\mathbf{A} + \frac{1}{c^2}\frac{\partial\Phi}{\partial t} =0∇⋅A+c21​∂t∂Φ​=0

where ccc is the speed of light in vacuum,

c=1μ0ε0c=\frac{1}{\sqrt{\mu_0\varepsilon_0}}c=μ0​ε0​​1​

With this gauge choice, the equations for the scalar and vector potentials separate into inhomogeneous wave equations:

∇2Φ−1c2∂2Φ∂t2=−ρε0\nabla^2\Phi - \frac{1}{c^2}\frac{\partial^2\Phi}{\partial t^2} = -\frac{\rho}{\varepsilon_0}∇2Φ−c21​∂t2∂2Φ​=−ε0​ρ​
∇2A−1c2∂2A∂t2=−μ0J\nabla^2\mathbf{A} - \frac{1}{c^2}\frac{\partial^2\mathbf{A}}{\partial t^2} = -\mu_0\mathbf{J}∇2A−c21​∂t2∂2A​=−μ0​J

These equations describe how changing sources generate potentials that propagate as waves. The charge density ρ(r,t)\rho(\mathbf{r},t)ρ(r,t) sources Φ\PhiΦ, while the current density J(r,t)\mathbf{J}(\mathbf{r},t)J(r,t) sources A\mathbf{A}A.

In the Lorenz gauge, charge and current sources determine separate equations for the scalar and vector potentials, while the electric and magnetic fields are reconstructed from those potentials.

The potentials are often mathematically convenient because they let source distributions be used directly to calculate fields, while the gauge freedom allows the calculation to be organized without changing any measurable electric or magnetic field.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent