Gradient, Divergence, Curl, and Integral Theorems
Maxwell's equations use two dialects of vector calculus. The differential dialect describes what fields do at a point: divergence detects sources and sinks, curl detects local circulation, and gradient points in the direction of fastest scalar increase. The integral dialect describes accumulated behavior over paths, surfaces, and volumes: voltage, flux, circulation, and total enclosed charge or current.
The two dialects are equivalent when fields are sufficiently smooth, but each highlights different physics. Gauss's law is often easiest as a flux integral when symmetry is high; Faraday's law is often clearest as a circulation integral when a changing magnetic flux threads a loop. This page summarizes the tools used throughout applied electromagnetics and connects to vector differential calculus and vector integral calculus.
Figure: Dipole field lines make superposition, potential gradients, and boundary intuition visible. Image: Wikimedia Commons, Geek3, CC BY-SA 4.0.
Definitions
For a scalar field , the gradient is
It points in the direction of maximum increase of . The directional derivative in direction is
For a vector field , divergence is
Divergence measures net outward flux density from an infinitesimal volume. Curl is
Curl measures local circulation density. The Laplacian of a scalar is
In Cartesian coordinates,
The gradient has units of "scalar units per meter." If is electric potential in volts, then has units V/m, matching electric field units. Divergence has units of "vector-field units per meter"; for in C/m, has units C/m, matching volume charge density. Curl also divides by length; for in V/m, has units V/m, matching because tesla per second is equivalent to V/m.
Line, surface, and volume integrals are respectively written
Key results
The divergence theorem converts a closed-surface flux integral into a volume integral:
Stokes's theorem converts a closed-path circulation integral into a surface integral of curl:
The orientation matters: the direction of and the positive traversal direction around are connected by the right-hand rule.
Three identities appear repeatedly in electromagnetics:
and
The first identity explains why electrostatic fields can be written as when . The second identity explains why a magnetic flux density can be written as because it automatically satisfies .
The best way to remember the physical roles is by testing small regions. Divergence asks whether more field leaves a tiny closed surface than enters it. Curl asks whether the field tends to push a tiny paddle wheel into rotation. Gradient asks which direction a scalar increases fastest. These tests are qualitative, but they prevent many sign and operator mistakes when reading Maxwell's equations.
Integral theorems also clarify when local and global statements can be exchanged. If everywhere inside a volume except at an isolated point charge, the point must be handled as a singular source or by enclosing it in a small surface. Smooth-field assumptions are often hidden in short derivations, but electromagnetic point sources and surface currents frequently create discontinuities that need boundary conditions.
Curvilinear coordinates change the formulas because the unit vectors and scale factors vary. For example, cylindrical divergence is
Spherical divergence is
These forms are not memorization trivia; they encode the expanding area of cylindrical and spherical shells.
One practical study method is to connect each operator to a limiting integral definition. Divergence is closed flux divided by small volume as the volume shrinks. Curl is circulation around a small loop divided by loop area as the loop shrinks. Gradient is the vector that makes for small displacement. These limiting ideas explain why the integral theorems are not separate facts pasted onto the differential formulas; they are the finite-region versions of the same local measurements.
Visual
| Operator | Input | Output | Physical reading in EM |
|---|---|---|---|
| scalar | vector | Field from potential, steepest change | |
| vector | scalar | Source density or flux expansion | |
| vector | vector | Circulation density | |
| scalar | scalar | Curvature, Poisson/Laplace equations | |
| vector on path | scalar | Circulation, voltage-like integral | |
| vector on surface | scalar | Flux through a closed surface |
Worked example 1: Gradient and directional derivative
Problem: Let . Find at and the directional derivative in the direction .
Step 1: Differentiate with respect to each coordinate:
Step 2: Evaluate at :
Step 3: Dot with :
Step 4: Compute:
Check: The maximum possible directional derivative is , and is less than that.
Worked example 2: Verify the divergence theorem for a cube
Problem: For , verify the divergence theorem over the cube .
Step 1: Compute divergence:
Step 2: Integrate over the cube volume:
Step 3: Compute flux through faces. At , , so flux is . At , , so flux is zero.
Step 4: By symmetry, the and faces each contribute , while the and faces contribute zero.
Step 5: Total closed-surface flux:
Check: The surface and volume results agree, so the divergence theorem holds for this field and region.
Code
import sympy as sp
x, y, z = sp.symbols("x y z", real=True)
V = 3*x**2*y + y*z**2
grad_V = [sp.diff(V, var) for var in (x, y, z)]
point = {x: 1, y: 2, z: -1}
grad_at_point = [g.subs(point) for g in grad_V]
A = [x, y, z]
div_A = sum(sp.diff(Ai, var) for Ai, var in zip(A, (x, y, z)))
print("gradient =", grad_V)
print("gradient at point =", grad_at_point)
print("divergence =", sp.simplify(div_A))
Common pitfalls
- Using Cartesian formulas in cylindrical or spherical problems without scale factors.
- Forgetting that Stokes's theorem requires a consistent path direction and surface normal.
- Treating like an ordinary vector in every algebraic context. It is a differential operator, so product rules matter.
- Assuming zero divergence means zero field. It means no local net source, not no field.
- Assuming zero curl means zero field. It means locally conservative in a simply connected region, not necessarily absent.
- Applying integral theorems across singularities without isolating them. Point charges and line currents require care.
- Treating a zero closed integral as proof that the integrand is zero everywhere. Cancellation over a path or surface can hide local structure unless the result holds for every possible region.
Connections
- Vector differential calculus for operator derivations.
- Vector integral calculus for Stokes and divergence theorem details.
- Gauss law, dielectrics, and boundaries for flux applications.
- Maxwell equations for time-varying fields for the differential and integral Maxwell forms.