← Electricity & Magnetism

Vector Calculus for EM

Electromagnetism is written in the language of vector calculus. Gauss's theorem relates the flux of a vector field through a closed surface to its divergence inside; Stokes's theorem relates the circulation around a closed loop to the curl inside. Mastering these theorems makes Maxwell's equations transparent.

Key Concepts

Gradient
f=(f/x)x^+(f/y)y^+(f/z)z^\nabla f=(\partial f/\partial x)\hat x+(\partial f/\partial y)\hat y+(\partial f/\partial z)\hat z points in the direction of steepest ascent of ff and has magnitude equal to the rate of increase. The electric field E=V\vec E=-\nabla V.
Divergence
A=Ax/x+Ay/y+Az/z\nabla\cdot\vec A=\partial A_x/\partial x+\partial A_y/\partial y+\partial A_z/\partial z measures the source strength per unit volume. E=ρ/ε0\nabla\cdot\vec E=\rho/\varepsilon_0 (Gauss's law in differential form).
Curl
×A\nabla\times\vec A measures the rotation per unit area. ×E=B/t\nabla\times\vec E=-\partial\vec B/\partial t (Faraday's law in differential form). A conservative field has zero curl.
Stokes's & Gauss's Theorems
Gauss: SAda=V(A)dτ\oint_S \vec A\cdot d\vec a=\int_V(\nabla\cdot\vec A)d\tau. Stokes: CAdl=S(×A)da\oint_C\vec A\cdot d\vec l=\int_S(\nabla\times\vec A)\cdot d\vec a. These connect differential to integral forms of Maxwell's equations.

Key Equations

Gauss's theorem
SAda=V(A)dτ\oint_S \vec{A}\cdot d\vec{a} = \int_V (\nabla\cdot\vec{A})\,d\tau
Converts a surface integral to a volume integral.
Stokes's theorem
CAdl=S(×A)da\oint_C \vec{A}\cdot d\vec{l} = \int_S (\nabla\times\vec{A})\cdot d\vec{a}
Converts a line integral to a surface integral.
Helmholtz theorem
A=V+×W\vec{A} = -\nabla V + \nabla\times\vec{W}
Any vector field is the sum of an irrotational and a solenoidal part.
Worked Example

Applying the Divergence Theorem

Problem

For the vector field A=rr^\vec A=r\hat r in spherical coordinates (so Ar=rA_r=r), verify the divergence theorem over a sphere of radius RR.

Solution

Divergence: A=(1/r2)(r2r)/r=(1/r2)3r2=3\nabla\cdot\vec A=(1/r^2)\partial(r^2\cdot r)/\partial r=(1/r^2)\cdot3r^2=3. Volume integral: V3dτ=3(4πR3/3)=4πR3\int_V3\,d\tau=3\cdot(4\pi R^3/3)=4\pi R^3.

Surface integral: on sphere r=Rr=R, Ada=R4πR2dr/dr\vec A\cdot d\vec a=R\cdot4\pi R^2\cdot dr/|dr|... Ar^=R\vec A\cdot\hat r=R, area element da=R2sinθdθdϕda=R^2\sin\theta\,d\theta\,d\phi: Rda=R4πR2=4πR3\oint R\,da=R\cdot4\pi R^2=4\pi R^3. ✓

Answer Both sides give 4πR34\pi R^3 — the theorem is verified.
Practice

Exercises

7 problems
1 of 7

For f=x2+y2+z2=r2f=x^2+y^2+z^2=r^2, find f|\nabla f| at the point (1,2,2)(1,2,2).

(dimensionless)
2 of 7

For A=(x,y,z)\vec A=(x,y,z), find A\nabla\cdot\vec A.

(dimensionless)
3 of 7

For A=yx^xy^\vec A=y\hat x-x\hat y, find ×A|\nabla\times\vec A|.

Unlock Exercise 3

Subscribe to PhysWeb Pro to access all exercises and track your progress.

Upgrade to Pro →
4 of 7

The divergence theorem: for A=rr^\vec A=r\hat r, A=3\nabla\cdot\vec A=3. For a sphere of radius R=2.0R=2.0 m, find Ada=3×(4πR3/3)\oint\vec A\cdot d\vec a=3\times(4\pi R^3/3) (in m³).

Unlock Exercise 4

Subscribe to PhysWeb Pro to access all exercises and track your progress.

Upgrade to Pro →
5 of 7

The Laplacian of f=r2=x2+y2+z2f=r^2=x^2+y^2+z^2: 2f\nabla^2 f.

Unlock Exercise 5

Subscribe to PhysWeb Pro to access all exercises and track your progress.

Upgrade to Pro →
6 of 7

For E=V\vec E=-\nabla V with V=5x2V=5x^2 (V in volts, x in m), find ExE_x (in V/m) at any xx.

Unlock Exercise 6

Subscribe to PhysWeb Pro to access all exercises and track your progress.

Upgrade to Pro →
7 of 7

Stokes's theorem: A=yx^\vec A=y\hat x. Integrate over a unit square in the xyxy-plane. Adl\oint\vec A\cdot d\vec l along the boundary = ?

Unlock Exercise 7

Subscribe to PhysWeb Pro to access all exercises and track your progress.

Upgrade to Pro →

Key Takeaways

  • Gradient f\nabla f points up the slope; divergence A\nabla\cdot\vec A measures sources; curl ×A\nabla\times\vec A measures rotation.
  • Gauss's theorem converts surface flux to volume integral of divergence.
  • Stokes's theorem converts loop circulation to surface integral of curl.
  • The Laplacian 2=\nabla^2=\nabla\cdot\nabla appears in Poisson's equation 2V=ρ/ε0\nabla^2 V=-\rho/\varepsilon_0.