Chapter 32
30 min read
Section 274 of 353

Maxwell's Equations in Differential Form

Maxwell's Equations

Learning Objectives

By the end of this section, you will be able to:

  1. Derive the differential form of Maxwell's equations from the integral form using the divergence and Stokes theorems
  2. Interpret the physical meaning of divergence and curl in the context of electromagnetic fields
  3. Understand how the differential equations describe local field behavior at every point in space
  4. Derive the electromagnetic wave equation from the coupled Maxwell equations
  5. Implement numerical solutions using finite difference methods (FDTD)
  6. Connect these equations to modern applications in physics, engineering, and machine learning
Why This Matters: The differential form of Maxwell's equations reveals the local, point-by-point behavior of electromagnetic fields. This is essential for understanding wave propagation, designing antennas and waveguides, simulating electromagnetic phenomena on computers, and even understanding the mathematical structure of gauge theories that underpin modern physics.

The Big Picture

James Clerk Maxwell's synthesis of electricity and magnetism into a unified theory stands as one of the greatest achievements in the history of physics. While the integral form of Maxwell's equations describes the global behavior of fields over regions and surfaces, the differential form reveals something more profound: the local laws that govern electromagnetic phenomena at each point in space and time.

The transition from integral to differential form represents a fundamental shift in perspective. Instead of asking "what is the total flux through this surface?" we ask "what is happening at this specific point right now?" This local perspective is crucial for:

  • Numerical simulations: Computers solve equations point by point, making the differential form ideal for computational electromagnetics
  • Wave propagation: The differential equations directly reveal how changes in one field create changes in another, leading to self-sustaining electromagnetic waves
  • Theoretical physics: The differential form connects to Lagrangian mechanics, gauge theories, and the geometric structure of spacetime
  • Engineering design: Understanding local field behavior is essential for designing antennas, waveguides, optical fibers, and photonic devices
Historical Note: Maxwell originally wrote his equations in a form involving 20 equations with 20 unknowns. The elegant four-equation form we use today was developed by Oliver Heaviside in the 1880s, who introduced the vector notation that makes the equations so compact and beautiful.

From Integral to Differential Form

The conversion from integral to differential form relies on two fundamental theorems from vector calculus: the Divergence Theorem and Stokes' Theorem. These theorems connect the behavior of a field over a region to its behavior on the boundary.

The Divergence Theorem Connection

The Divergence Theorem states that the total flux of a vector field through a closed surface equals the volume integral of the divergence:

SFdA=V(F)dV\oint_S \mathbf{F} \cdot d\mathbf{A} = \int_V (\nabla \cdot \mathbf{F}) \, dV

For Gauss's law, we have:

SEdA=Qencε0=1ε0VρdV\oint_S \mathbf{E} \cdot d\mathbf{A} = \frac{Q_{\text{enc}}}{\varepsilon_0} = \frac{1}{\varepsilon_0} \int_V \rho \, dV

Applying the divergence theorem to the left side:

V(E)dV=1ε0VρdV\int_V (\nabla \cdot \mathbf{E}) \, dV = \frac{1}{\varepsilon_0} \int_V \rho \, dV

Since this must hold for any volume V, the integrands must be equal at every point, giving us the differential form:

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

Key Insight: The divergence E\nabla \cdot \mathbf{E} measures the "source strength" of the electric field at each point. Positive charge creates positive divergence (field lines emanate outward), while negative charge creates negative divergence (field lines converge inward).

The Stokes Theorem Connection

Stokes' Theorem relates the circulation of a vector field around a closed curve to the flux of its curl through any surface bounded by that curve:

CFdl=S(×F)dA\oint_C \mathbf{F} \cdot d\mathbf{l} = \int_S (\nabla \times \mathbf{F}) \cdot d\mathbf{A}

For Faraday's law:

CEdl=dΦBdt=ddtSBdA\oint_C \mathbf{E} \cdot d\mathbf{l} = -\frac{d\Phi_B}{dt} = -\frac{d}{dt} \int_S \mathbf{B} \cdot d\mathbf{A}

Applying Stokes' theorem and assuming we can exchange the order of differentiation and integration:

S(×E)dA=SBtdA\int_S (\nabla \times \mathbf{E}) \cdot d\mathbf{A} = -\int_S \frac{\partial \mathbf{B}}{\partial t} \cdot d\mathbf{A}

Since this holds for any surface S, we obtain Faraday's law in differential form:

×E=Bt\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}


Gauss's Law for Electricity

The differential form of Gauss's law for electricity is:

E=ρε0\boxed{\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}}

Let's unpack every symbol and its physical meaning:

SymbolNamePhysical Meaning
\nabla \cdotDivergence operatorMeasures the net outflow of a vector field from an infinitesimal volume
\mathbf{E}Electric fieldForce per unit charge at each point (units: N/C or V/m)
\rhoCharge densityCharge per unit volume at each point (units: C/m³)
ε₀Permittivity of free space8.85 × 10⁻¹² F/m, relates E field to source charges

In Cartesian coordinates, the divergence is computed as:

E=Exx+Eyy+Ezz\nabla \cdot \mathbf{E} = \frac{\partial E_x}{\partial x} + \frac{\partial E_y}{\partial y} + \frac{\partial E_z}{\partial z}

Physical Interpretation: This equation says that electric charges are the sources of electric field lines. Where there is positive charge density, field lines diverge outward. Where there is negative charge, they converge. In empty space (no charges),E=0\nabla \cdot \mathbf{E} = 0: field lines neither begin nor end.

Gauss's Law for Magnetism

The differential form of Gauss's law for magnetism is remarkably simple:

B=0\boxed{\nabla \cdot \mathbf{B} = 0}

This equation states that the magnetic field has zero divergence everywhere. In other words, there are no magnetic monopoles—no isolated north or south poles that could act as sources or sinks of magnetic field lines.

The profound implication is that magnetic field lines always form closed loops. They have no beginning or end. Even in the most powerful magnets, every field line that emerges from the "north" end curves around and returns to the "south" end.

Open Question in Physics: The search for magnetic monopoles remains an active area of research. Grand unified theories and string theory predict their existence. If found, we would need to modify this equation to: B=μ0ρm\nabla \cdot \mathbf{B} = \mu_0 \rho_m where ρm\rho_m is the magnetic charge density.

Faraday's Law in Differential Form

Faraday's law in differential form is:

×E=Bt\boxed{\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}}

This equation connects the curl of the electric field to the time rate of change of the magnetic field. Let's understand each part:

SymbolNamePhysical Meaning
\nabla \timesCurl operatorMeasures the rotation or circulation tendency of a field
\mathbf{E}Electric fieldThe field that exerts force on charges
\partial/\partial tPartial time derivativeRate of change with time at a fixed point
\mathbf{B}Magnetic fieldThe field that exerts force on moving charges

In Cartesian coordinates, the curl has three components:

(×E)x=EzyEyz(\nabla \times \mathbf{E})_x = \frac{\partial E_z}{\partial y} - \frac{\partial E_y}{\partial z}

(×E)y=ExzEzx(\nabla \times \mathbf{E})_y = \frac{\partial E_x}{\partial z} - \frac{\partial E_z}{\partial x}

(×E)z=EyxExy(\nabla \times \mathbf{E})_z = \frac{\partial E_y}{\partial x} - \frac{\partial E_x}{\partial y}

Physical Interpretation: A changing magnetic field creates a circulating electric field around it. The negative sign (Lenz's law) indicates that the induced electric field opposes the change in magnetic flux—nature resists change. This is the principle behind electric generators and transformers.

Amp\u00e8re-Maxwell Law in Differential Form

The Amp\u00e8re-Maxwell law in differential form is:

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

This equation has two source terms for the curl of the magnetic field:

  1. Current density J\mathbf{J}: Moving charges create magnetic fields (Amp\u00e8re's original discovery)
  2. Displacement current ε0Et\varepsilon_0 \frac{\partial \mathbf{E}}{\partial t}: Maxwell's addition—changing electric fields also create magnetic fields
Maxwell's Genius: The displacement current term was purely theoretical when Maxwell added it. He recognized that without it, charge conservation would be violated (imagine a charging capacitor—current flows in the wires but not between the plates, yet the magnetic field must be continuous). This term made the equations predict electromagnetic waves traveling at the speed of light.

Notice the beautiful symmetry with Faraday's law: a changing B\mathbf{B} creates a curl in E\mathbf{E}, and a changing E\mathbf{E} creates a curl in B\mathbf{B}. This mutual induction is the engine that drives electromagnetic wave propagation.


The Complete Differential Equations

Here are Maxwell's four equations in their full differential glory:

EquationDifferential FormPhysical Meaning
Gauss (E)\nabla \cdot \mathbf{E} = \rho/\varepsilon_0Charges are sources of E-field
Gauss (B)\nabla \cdot \mathbf{B} = 0No magnetic monopoles exist
Faraday\nabla \times \mathbf{E} = -\partial\mathbf{B}/\partial tChanging B creates curling E
Ampère-Maxwell\nabla \times \mathbf{B} = \mu_0\mathbf{J} + \mu_0\varepsilon_0 \partial\mathbf{E}/\partial tCurrents and changing E create curling B

In vacuum (no charges or currents), these simplify to:

E=0,B=0\nabla \cdot \mathbf{E} = 0, \quad \nabla \cdot \mathbf{B} = 0

×E=Bt,×B=μ0ε0Et\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}, \quad \nabla \times \mathbf{B} = \mu_0 \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t}

Maxwell's Equations Visualizer
∇ · E = ρ/ε₀

Charges create divergence in the electric field. Field lines emanate from positive charges and terminate on negative charges.

Charge:+1.0
Electric Field E

Force per unit charge. Sources: charges. Units: V/m

Magnetic Field B

Force on moving charges. Sources: currents. Units: Tesla


Visualizing Divergence and Curl

To truly understand Maxwell's equations, we need to develop geometric intuition for the divergence and curl operators. Let's visualize these concepts:

Divergence measures how much a vector field "spreads out" from each point. Imagine placing a tiny balloon in a flow field:

  • If the balloon expands, the divergence is positive (source)
  • If the balloon contracts, the divergence is negative (sink)
  • If the balloon maintains its size but may rotate or deform, the divergence is zero

Curl measures the local rotation of a field. Imagine placing a tiny paddle wheel:

  • If the wheel spins, there is non-zero curl
  • The curl vector points along the axis of rotation (right-hand rule)
  • The magnitude indicates how fast the wheel would spin
Divergence and Curl Explorer

Field Type

Point Source

Radially outward field like positive charge

∇ · F > 0 (source)
∇ × F = 0 (irrotational)

Tip: Enable particle mode to see how test particles would move in this field. Sources make particles spread apart, vortices make them spiral.


Deriving the Wave Equation

One of the most beautiful results from Maxwell's equations is the derivation of the electromagnetic wave equation. Starting from the vacuum equations:

×E=Bt\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}

×B=μ0ε0Et\nabla \times \mathbf{B} = \mu_0 \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t}

Take the curl of Faraday's law:

×(×E)=t(×B)\nabla \times (\nabla \times \mathbf{E}) = -\frac{\partial}{\partial t}(\nabla \times \mathbf{B})

Using the vector identity ×(×F)=(F)2F\nabla \times (\nabla \times \mathbf{F}) = \nabla(\nabla \cdot \mathbf{F}) - \nabla^2 \mathbf{F}and E=0\nabla \cdot \mathbf{E} = 0 in vacuum:

2E=t(μ0ε0Et)-\nabla^2 \mathbf{E} = -\frac{\partial}{\partial t}\left(\mu_0 \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t}\right)

This gives us the electromagnetic wave equation:

2E=μ0ε02Et2\boxed{\nabla^2 \mathbf{E} = \mu_0 \varepsilon_0 \frac{\partial^2 \mathbf{E}}{\partial t^2}}

This is a wave equation! Comparing with the standard form 2f=1v22ft2\nabla^2 f = \frac{1}{v^2}\frac{\partial^2 f}{\partial t^2}, we identify the wave speed:

c=1μ0ε0=2.998×108 m/sc = \frac{1}{\sqrt{\mu_0 \varepsilon_0}} = 2.998 \times 10^8 \text{ m/s}

The Speed of Light: Maxwell recognized that this speed matched the measured speed of light. This was the moment when optics became a branch of electromagnetism. Light is an electromagnetic wave—oscillating electric and magnetic fields propagating through space.

Electromagnetic Wave Propagation

The interplay between the electric and magnetic fields in Maxwell's equations creates self-propagating electromagnetic waves. Let's explore this with an interactive visualization:

Electromagnetic Wave Propagation

Wavelength

1.0

View Angle

Show Fields

Key Properties

  • \u2022 E and B are perpendicular to each other
  • \u2022 Both are perpendicular to propagation
  • \u2022 |E| = c|B| (speed of light)
  • \u2022 S = E \u00d7 B points in propagation direction

From Maxwell: The coupled equations \u2207 \u00d7 E = -\u2202B/\u2202t and \u2207 \u00d7 B = \u03bc\u2080\u03b5\u2080\u2202E/\u2202t create self-propagating waves traveling at c = 1/\u221a(\u03bc\u2080\u03b5\u2080).

Key properties of electromagnetic waves:

  • Transverse waves: Both E and B oscillate perpendicular to the direction of propagation
  • E and B perpendicular: The electric and magnetic fields are perpendicular to each other
  • In phase: E and B reach their maxima and minima at the same locations
  • Amplitude relationship: E=cB|\mathbf{E}| = c|\mathbf{B}|

Numerical Implementation

The differential form of Maxwell's equations is ideally suited for numerical computation. The Finite Difference Time Domain (FDTD) method directly discretizes the equations on a grid:

FDTD Solver for Maxwell's Equations
🐍python
1NumPy Import

NumPy provides efficient array operations essential for finite difference methods on large grids.

7FDTD Solver Class

The Finite Difference Time Domain method discretizes Maxwell's differential equations on a staggered grid, allowing direct numerical simulation of electromagnetic waves.

11Grid Parameters

nx, ny define the spatial resolution. dx is the grid spacing in meters, typically nanometers for optical simulations.

16Physical Constants

These fundamental constants define electromagnetic behavior: c (speed of light), ε₀ (permittivity), and μ₀ (permeability) of free space.

21CFL Condition

The Courant-Friedrichs-Lewy condition ensures numerical stability. The time step must be small enough that information doesn't travel more than one grid cell per step.

24Yee Grid Fields

The Yee algorithm staggers E and H fields both in space and time, which naturally enforces the curl operations in Maxwell's equations.

29Update Coefficients

These coefficients come directly from the differential form of Maxwell's equations: Δt/(ε₀Δx) for E updates and Δt/(μ₀Δx) for H updates.

32Curl of E Method

This implements the spatial derivative (∇ × E)_z = ∂E_y/∂x - ∂E_x/∂y from Faraday's law in differential form.

41Central Differences

Finite differences approximate the partial derivatives. This converts the continuous differential equation to a discrete update rule.

46Curl of H Method

Computes (∇ × H) which drives the electric field evolution according to the Ampère-Maxwell equation.

7Time Stepping

Each step first updates H using Faraday's law, then updates E using Ampère-Maxwell. This leap-frog scheme is second-order accurate.

63Faraday Update

Direct implementation of ∂H/∂t = -(1/μ₀)∇ × E. The curl of E induces changes in the magnetic field.

67Ampère-Maxwell Update

Implements ∂E/∂t = (1/ε₀)∇ × H. The curl of H induces changes in the electric field.

79Poynting Vector

S = E × H represents the directional energy flux of the electromagnetic field, measured in watts per square meter.

82Energy Density

The total electromagnetic energy per unit volume combines electric field energy (ε₀|E|²/2) and magnetic field energy (μ₀|H|²/2).

94 lines without explanation
1import numpy as np
2import matplotlib.pyplot as plt
3from mpl_toolkits.mplot3d import Axes3D
4
5class MaxwellSolver:
6    """
7    Finite Difference Time Domain (FDTD) solver for Maxwell's equations.
8    Implements the Yee algorithm for electromagnetic wave propagation.
9    """
10
11    def __init__(self, nx=100, ny=100, dx=1e-9, dt=None):
12        """Initialize the FDTD grid and constants."""
13        self.nx, self.ny = nx, ny
14        self.dx = self.dy = dx  # Spatial step (meters)
15
16        # Physical constants
17        self.c = 3e8           # Speed of light (m/s)
18        self.eps0 = 8.85e-12   # Permittivity of free space
19        self.mu0 = 4*np.pi*1e-7  # Permeability of free space
20
21        # CFL condition for stability: dt <= dx/(c*sqrt(2))
22        self.dt = dt if dt else 0.99 * dx / (self.c * np.sqrt(2))
23
24        # Initialize field arrays (Yee grid staggering)
25        self.Ex = np.zeros((nx, ny))   # Electric field x-component
26        self.Ey = np.zeros((nx, ny))   # Electric field y-component
27        self.Hz = np.zeros((nx, ny))   # Magnetic field z-component
28
29        # Update coefficients from differential Maxwell equations
30        self.update_coef_E = self.dt / (self.eps0 * self.dx)
31        self.update_coef_H = self.dt / (self.mu0 * self.dx)
32
33    def compute_curl_E(self):
34        """
35        Compute curl of E for the Hz update.
36        From Faraday: ∂Hz/∂t = -(1/μ₀)(∂Ey/∂x - ∂Ex/∂y)
37        """
38        dEy_dx = np.zeros_like(self.Ey)
39        dEx_dy = np.zeros_like(self.Ex)
40
41        # Central differences for spatial derivatives
42        dEy_dx[:-1, :] = (self.Ey[1:, :] - self.Ey[:-1, :]) / self.dx
43        dEx_dy[:, :-1] = (self.Ex[:, 1:] - self.Ex[:, :-1]) / self.dy
44
45        return dEy_dx - dEx_dy  # This is (∇ × E)_z
46
47    def compute_curl_H(self):
48        """
49        Compute curl of H for the E updates.
50        From Ampère-Maxwell: ∂E/∂t = (1/ε₀)(∇ × H)
51        """
52        dHz_dy = np.zeros_like(self.Hz)
53        dHz_dx = np.zeros_like(self.Hz)
54
55        # Staggered grid differences
56        dHz_dy[:, 1:] = (self.Hz[:, 1:] - self.Hz[:, :-1]) / self.dy
57        dHz_dx[1:, :] = (self.Hz[1:, :] - self.Hz[:-1, :]) / self.dx
58
59        return dHz_dy, -dHz_dx  # (∇ × H)_x, (∇ × H)_y
60
61    def step(self, source_pos=None, source_value=0):
62        """Advance the simulation by one time step."""
63        # Update H field using Faraday's Law (differential form)
64        curl_E_z = self.compute_curl_E()
65        self.Hz -= self.update_coef_H * curl_E_z
66
67        # Update E field using Ampère-Maxwell Law (differential form)
68        curl_H_x, curl_H_y = self.compute_curl_H()
69        self.Ex += self.update_coef_E * curl_H_x
70        self.Ey += self.update_coef_E * curl_H_y
71
72        # Add source excitation
73        if source_pos is not None:
74            i, j = source_pos
75            self.Ez[i, j] += source_value
76
77    def compute_poynting_vector(self):
78        """
79        Compute Poynting vector: S = E × H
80        Represents electromagnetic energy flow.
81        """
82        Sx = self.Ey * self.Hz
83        Sy = -self.Ex * self.Hz
84        return Sx, Sy
85
86    def compute_energy_density(self):
87        """
88        Compute electromagnetic energy density:
89        u = (1/2)(ε₀|E|² + μ₀|H|²)
90        """
91        E_squared = self.Ex**2 + self.Ey**2
92        H_squared = self.Hz**2
93        return 0.5 * (self.eps0 * E_squared + self.mu0 * H_squared)
94
95# Demonstrate wave propagation
96solver = MaxwellSolver(nx=200, ny=200, dx=1e-9)
97
98# Run simulation with sinusoidal source
99frames = []
100for t in range(500):
101    # Sinusoidal source at center
102    omega = 2 * np.pi * 600e12  # 600 THz (visible light)
103    source = np.sin(omega * t * solver.dt)
104    solver.step(source_pos=(100, 100), source_value=source)
105
106    if t % 10 == 0:
107        frames.append(solver.Hz.copy())
108
109print(f"Simulated {len(frames)} frames of EM wave propagation")
Computational Electromagnetics: FDTD and related methods are used throughout industry: designing smartphone antennas, optimizing photonic crystals, simulating radar signatures, and developing metamaterials. The differential form of Maxwell's equations makes these simulations possible.

Modern Applications

The differential form of Maxwell's equations underpins countless technologies:

ApplicationKey Equations UsedWhat It Does
Antenna DesignAll four equationsOptimizes radiation patterns for phones, satellites, radar
Optical FibersWave equationsGuides light for telecommunications
MRI MachinesFaraday + Ampère-MaxwellImages internal body structures
Photonic CrystalsWave equations with periodic εCreates optical bandgaps for novel devices
MetamaterialsAll four equationsAchieves negative refractive index, cloaking
EMC/EMI TestingAll four equationsEnsures devices don&apos;t interfere with each other
Quantum ElectrodynamicsQuantized Maxwell equationsDescribes light-matter interaction

Connection to Machine Learning

Maxwell's equations have surprising connections to modern machine learning:

Physics-Informed Neural Networks (PINNs)

Neural networks can learn to solve Maxwell's equations by incorporating the differential equations directly into the loss function. Instead of just matching data, the network learns solutions that satisfy the physical laws:

L=Ldata+λiEθρε02\mathcal{L} = \mathcal{L}_{data} + \lambda \sum_{i} \left\| \nabla \cdot \mathbf{E}_\theta - \frac{\rho}{\varepsilon_0} \right\|^2

Neural Operators

Fourier Neural Operators and DeepONet architectures learn mappings between function spaces, enabling rapid prediction of electromagnetic field distributions for new geometries without running expensive FDTD simulations.

Inverse Design

Deep learning optimizes photonic structures by learning gradients through differentiable Maxwell solvers. This enables design of novel optical devices like wavelength demultiplexers and mode converters.

The Future: The combination of Maxwell's equations with machine learning is revolutionizing photonics and electromagnetic design. AI can now discover device geometries that humans would never conceive, optimized for specific frequency responses or radiation patterns.

Check Your Understanding
Question 1 of 8

What does the equation ∇ · E = ρ/ε₀ tell us about electric field lines?


Summary

In this section, we have explored Maxwell's equations in their differential form:

  • Gauss's Law (E): E=ρ/ε0\nabla \cdot \mathbf{E} = \rho/\varepsilon_0— charges create divergence in the electric field
  • Gauss's Law (B): B=0\nabla \cdot \mathbf{B} = 0— no magnetic monopoles
  • Faraday's Law: ×E=B/t\nabla \times \mathbf{E} = -\partial \mathbf{B}/\partial t— changing B creates curling E
  • Amp\u00e8re-Maxwell: ×B=μ0J+μ0ε0E/t\nabla \times \mathbf{B} = \mu_0 \mathbf{J} + \mu_0 \varepsilon_0 \partial \mathbf{E}/\partial t— currents and changing E create curling B

We saw how these local equations:

  1. Are derived from the integral forms using the divergence and Stokes theorems
  2. Predict electromagnetic waves traveling at the speed of light
  3. Form the foundation for computational electromagnetics (FDTD method)
  4. Connect to modern machine learning through physics-informed neural networks
Looking Ahead: In the next section, we will explore electromagnetic waves in more detail, including polarization, energy transport via the Poynting vector, and wave propagation in materials with different properties.
Loading comments...