Electromagnetism — Maxwell's Equations Explained

Master Maxwell's equations with clear explanations, KaTeX notation, and Mermaid diagrams. Learn Gauss's law, Faraday's law, and electromagnetic wave theory.

Introduction

Maxwell's equations are the foundation of classical electromagnetism, describing how electric and magnetic fields are generated and interact. These four elegant equations unify electricity, magnetism, and optics into a single theoretical framework.

This guide covers Maxwell's equations in both integral and differential forms, explains their physical meaning, and shows how to document electromagnetic concepts effectively using KaTeX and Mermaid diagrams.

Prerequisites
This guide assumes familiarity with vector calculus (gradient, divergence, curl) and basic KaTeX syntax. See our Calculus in Technical Documentation guide for vector calculus notation.

Maxwell's Equations Overview

Maxwell's equations consist of four fundamental laws that describe all classical electromagnetic phenomena. Here they are in their most common differential form:

Maxwell's Equations (Differential Form)

The four fundamental equations of electromagnetism

Maxwell's Equations in Differential Form

1. Gauss's Law for Electricity

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

2. Gauss's Law for Magnetism

B=0\nabla \cdot \vec{B} = 0B=0

3. Faraday's Law of Induction

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

4. Ampère-Maxwell Law

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

Key Symbols

Electromagnetic Notation

Standard symbols used in electromagnetism

SymbolMeaningSI Unit
E\vec{E}EElectric fieldV/m
B\vec{B}BMagnetic fieldT (Tesla)
ρ\rhoρCharge densityC/m³
J\vec{J}JCurrent densityA/m²
ε0\varepsilon_0ε0Permittivity of free spaceF/m
μ0\mu_0μ0Permeability of free spaceH/m
cccSpeed of lightm/s

Fundamental constants:

ε08.854×1012 F/m\varepsilon_0 \approx 8.854 \times 10^{-12} \text{ F/m}ε08.854×1012 F/m μ0=4π×107 H/m\mu_0 = 4\pi \times 10^{-7} \text{ H/m}μ0=4π×107 H/m c=1μ0ε03×108 m/sc = \frac{1}{\sqrt{\mu_0 \varepsilon_0}} \approx 3 \times 10^8 \text{ m/s}c=μ0ε013×108 m/s

Gauss's Law for Electricity

Gauss's law relates the electric field to the charge distribution that creates it. It states that the electric flux through any closed surface is proportional to the enclosed charge.

Gauss's Law

Electric field and charge relationship

Differential Form:

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

Integral Form:

SEdA=Qencε0\oint_S \vec{E} \cdot d\vec{A} = \frac{Q_{\text{enc}}}{\varepsilon_0}SEdA=ε0Qenc

Physical Meaning: Electric field lines originate from positive charges and terminate on negative charges. The divergence of E\vec{E}E is non-zero only where charges exist.

Example - Point Charge:

For a point charge qqq at the origin:

E=q4πε0r2r^\vec{E} = \frac{q}{4\pi\varepsilon_0 r^2} \hat{r}E=4πε0r2qr^

Using a spherical Gaussian surface of radius rrr:

SEdA=E4πr2=qε0\oint_S \vec{E} \cdot d\vec{A} = E \cdot 4\pi r^2 = \frac{q}{\varepsilon_0}SEdA=E4πr2=ε0q

Electric Field Diagram

Visualizing electric field lines from a point charge

Rendering diagram...

Gauss's Law for Magnetism

Gauss's law for magnetism states that there are no magnetic monopoles—magnetic field lines always form closed loops. The net magnetic flux through any closed surface is zero.

Gauss's Law for Magnetism

No magnetic monopoles

Differential Form:

B=0\nabla \cdot \vec{B} = 0B=0

Integral Form:

SBdA=0\oint_S \vec{B} \cdot d\vec{A} = 0SBdA=0

Physical Meaning: Unlike electric field lines, magnetic field lines have no beginning or end. They always form closed loops. There are no isolated magnetic "charges" (monopoles).

Consequence: If you cut a bar magnet in half, you get two smaller magnets, each with both a north and south pole—never an isolated pole.

Mathematical Implication:

B=×A\vec{B} = \nabla \times \vec{A}B=×A

where A\vec{A}A is the magnetic vector potential. Since the divergence of a curl is always zero:

(×A)=0\nabla \cdot (\nabla \times \vec{A}) = 0(×A)=0

Faraday's Law of Induction

Faraday's law describes how a changing magnetic field creates an electric field. This is the principle behind electric generators, transformers, and inductors.

Faraday's Law

Electromagnetic induction

Differential Form:

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

Integral Form:

CEdl=dΦBdt\oint_C \vec{E} \cdot d\vec{l} = -\frac{d\Phi_B}{dt}CEdl=dtdΦB

where the magnetic flux is:

ΦB=SBdA\Phi_B = \int_S \vec{B} \cdot d\vec{A}ΦB=SBdA

Physical Meaning: A time-varying magnetic field induces a circulating electric field. The negative sign (Lenz's law) indicates the induced field opposes the change in flux.

EMF in a Loop:

E=dΦBdt=ddtSBdA\mathcal{E} = -\frac{d\Phi_B}{dt} = -\frac{d}{dt}\int_S \vec{B} \cdot d\vec{A}E=dtdΦB=dtdSBdA

Example - Rotating Loop:

For a loop of area AAA rotating with angular velocity ω\omegaω in a uniform field BBB:

ΦB=BAcos(ωt)\Phi_B = BA\cos(\omega t)ΦB=BAcos(ωt) E=BAωsin(ωt)\mathcal{E} = BA\omega\sin(\omega t)E=BAωsin(ωt)

Electromagnetic Induction Diagram

Faraday's law in action

Rendering diagram...

Ampère-Maxwell Law

The Ampère-Maxwell law describes how magnetic fields are generated by electric currents and changing electric fields. Maxwell's crucial addition of the displacement current term completed the equations and predicted electromagnetic waves.

Ampère-Maxwell Law

Magnetic field sources

Differential Form:

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

Integral Form:

CBdl=μ0Ienc+μ0ε0dΦEdt\oint_C \vec{B} \cdot d\vec{l} = \mu_0 I_{\text{enc}} + \mu_0 \varepsilon_0 \frac{d\Phi_E}{dt}CBdl=μ0Ienc+μ0ε0dtdΦE

Two Source Terms:

  1. Conduction current: μ0J\mu_0 \vec{J}μ0J — moving charges create magnetic fields

  2. Displacement current: μ0ε0Et\mu_0 \varepsilon_0 \frac{\partial \vec{E}}{\partial t}μ0ε0tE — changing electric fields create magnetic fields

Physical Meaning: Magnetic field lines circulate around both electric currents and regions where the electric field is changing.

Example - Long Straight Wire:

For current III in a long wire:

CBdl=B2πr=μ0I\oint_C \vec{B} \cdot d\vec{l} = B \cdot 2\pi r = \mu_0 ICBdl=B2πr=μ0I B=μ0I2πrB = \frac{\mu_0 I}{2\pi r}B=2πrμ0I
Maxwell's Key Insight
Maxwell added the displacement current term $\varepsilon_0 \frac{\partial \vec{E}}{\partial t}$, which was not in Ampère's original law. This term ensures charge conservation and, crucially, predicts that changing electric fields produce magnetic fields—enabling electromagnetic waves to propagate through empty space.

Electromagnetic Waves

Maxwell's equations predict the existence of electromagnetic waves—self-propagating oscillations of electric and magnetic fields. This was one of the greatest theoretical predictions in physics.

Wave Equation Derivation

Deriving the electromagnetic wave equation

In Free Space (no charges or currents):

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

Derivation:

Take the curl of Faraday's law:

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

Using the vector identity ×(×E)=(E)2E\nabla \times (\nabla \times \vec{E}) = \nabla(\nabla \cdot \vec{E}) - \nabla^2 \vec{E}×(×E)=(E)2E:

2E=μ0ε02Et2-\nabla^2 \vec{E} = -\mu_0 \varepsilon_0 \frac{\partial^2 \vec{E}}{\partial t^2}2E=μ0ε0t22E

Wave Equation:

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

Wave Speed:

c=1μ0ε0=299,792,458 m/sc = \frac{1}{\sqrt{\mu_0 \varepsilon_0}} = 299,792,458 \text{ m/s}c=μ0ε01=299,792,458 m/s

Plane Wave Solution

Electromagnetic plane wave propagating in the z-direction

Plane Wave Solution:

For a wave propagating in the zzz-direction:

E=E0cos(kzωt)x^\vec{E} = E_0 \cos(kz - \omega t) \hat{x}E=E0cos(kzωt)x^ B=B0cos(kzωt)y^\vec{B} = B_0 \cos(kz - \omega t) \hat{y}B=B0cos(kzωt)y^

Wave Parameters:

  • Wave number: k=2πλk = \frac{2\pi}{\lambda}k=λ2π
  • Angular frequency: ω=2πf\omega = 2\pi fω=2πf
  • Phase velocity: c=ωk=fλc = \frac{\omega}{k} = f\lambdac=kω=fλ

Field Relationship:

E0B0=c\frac{E_0}{B_0} = cB0E0=c

Energy Density:

u=12ε0E2+12μ0B2=ε0E2u = \frac{1}{2}\varepsilon_0 E^2 + \frac{1}{2\mu_0}B^2 = \varepsilon_0 E^2u=21ε0E2+2μ01B2=ε0E2

Poynting Vector (energy flux):

S=1μ0E×B\vec{S} = \frac{1}{\mu_0}\vec{E} \times \vec{B}S=μ01E×B

Intensity:

I=S=12cε0E02I = \langle S \rangle = \frac{1}{2}c\varepsilon_0 E_0^2I=S=21cε0E02

Electromagnetic Wave Diagram

Structure of an electromagnetic wave

Rendering diagram...

Integral vs Differential Forms

Maxwell's equations can be written in either integral or differential form. Each has its advantages depending on the problem at hand.

Both Forms Compared

Integral and differential forms side by side

Gauss's Law (Electricity):

IntegralDifferential
SEdA=Qencε0\displaystyle\oint_S \vec{E} \cdot d\vec{A} = \frac{Q_{\text{enc}}}{\varepsilon_0}SEdA=ε0QencE=ρε0\nabla \cdot \vec{E} = \frac{\rho}{\varepsilon_0}E=ε0ρ

Gauss's Law (Magnetism):

IntegralDifferential
SBdA=0\displaystyle\oint_S \vec{B} \cdot d\vec{A} = 0SBdA=0B=0\nabla \cdot \vec{B} = 0B=0

Faraday's Law:

IntegralDifferential
CEdl=dΦBdt\displaystyle\oint_C \vec{E} \cdot d\vec{l} = -\frac{d\Phi_B}{dt}CEdl=dtdΦB×E=Bt\nabla \times \vec{E} = -\frac{\partial \vec{B}}{\partial t}×E=tB

Ampère-Maxwell Law:

IntegralDifferential
CBdl=μ0I+μ0ε0dΦEdt\displaystyle\oint_C \vec{B} \cdot d\vec{l} = \mu_0 I + \mu_0\varepsilon_0\frac{d\Phi_E}{dt}CBdl=μ0I+μ0ε0dtdΦE×B=μ0J+μ0ε0Et\nabla \times \vec{B} = \mu_0 \vec{J} + \mu_0\varepsilon_0\frac{\partial \vec{E}}{\partial t}×B=μ0J+μ0ε0tE
When to Use Each Form
Integral form: Best for problems with high symmetry (spherical, cylindrical, planar) where you can choose a convenient Gaussian surface or Amperian loop.

Differential form: Best for deriving wave equations, understanding local field behavior, and computational electromagnetics.

Maxwell's Equations in Matter

In materials, we introduce auxiliary fields to account for the response of matter to electromagnetic fields.

Macroscopic Maxwell's Equations

Maxwell's equations in linear, isotropic media

Auxiliary Fields:

Electric displacement: D=ε0E+P=εE\vec{D} = \varepsilon_0 \vec{E} + \vec{P} = \varepsilon \vec{E}D=ε0E+P=εE

Magnetic field intensity: H=Bμ0M=Bμ\vec{H} = \frac{\vec{B}}{\mu_0} - \vec{M} = \frac{\vec{B}}{\mu}H=μ0BM=μB

Maxwell's Equations in Matter:

D=ρf\nabla \cdot \vec{D} = \rho_fD=ρf B=0\nabla \cdot \vec{B} = 0B=0 ×E=Bt\nabla \times \vec{E} = -\frac{\partial \vec{B}}{\partial t}×E=tB ×H=Jf+Dt\nabla \times \vec{H} = \vec{J}_f + \frac{\partial \vec{D}}{\partial t}×H=Jf+tD

Constitutive Relations (linear media):

D=εE,B=μH\vec{D} = \varepsilon \vec{E}, \quad \vec{B} = \mu \vec{H}D=εE,B=μH

where ε=ε0εr\varepsilon = \varepsilon_0 \varepsilon_rε=ε0εr and μ=μ0μr\mu = \mu_0 \mu_rμ=μ0μr

Applications

Maxwell's equations have countless applications in technology and science. Here are some key examples with their governing equations.

Electromagnetic Applications

Real-world applications of Maxwell's equations

Capacitor:

Electric field between parallel plates:

E=σε0=VdE = \frac{\sigma}{\varepsilon_0} = \frac{V}{d}E=ε0σ=dV

Capacitance:

C=ε0AdC = \frac{\varepsilon_0 A}{d}C=dε0A

Inductor:

Magnetic field in a solenoid:

B=μ0nIB = \mu_0 n IB=μ0nI

Inductance:

L=μ0n2VL = \mu_0 n^2 VL=μ0n2V

Transformer:

Voltage ratio:

VsVp=NsNp\frac{V_s}{V_p} = \frac{N_s}{N_p}VpVs=NpNs

Antenna Radiation:

Radiated power:

P=μ0c12π(I0ωc)2P = \frac{\mu_0 c}{12\pi}\left(\frac{I_0 \ell \omega}{c}\right)^2P=12πμ0c(cI0ω)2

Waveguide:

Cutoff frequency:

fc=c2af_c = \frac{c}{2a}fc=2ac

Electromagnetic Spectrum

Applications across the EM spectrum

Rendering diagram...

Best Practices

Use Vector Notation Consistently
Always use arrows ($\vec{E}$) or bold ($\mathbf{E}$) for vector quantities. Be consistent throughout your documentation.
Include Units
Electromagnetic quantities have specific SI units. Include them in definitions and final answers: $E = 100 \text{ V/m}$
Show Both Forms When Appropriate
For educational content, showing both integral and differential forms helps readers understand the connection between local and global behavior.
Use Diagrams for Field Visualization
Electromagnetic fields are inherently spatial. Use Mermaid diagrams to show field line patterns, wave propagation, and circuit configurations.
Define Your Coordinate System
Specify whether you're using Cartesian, cylindrical, or spherical coordinates, especially for problems with specific symmetry.

Common Mistakes

Confusing E and D, B and H
$\vec{E}$ and $\vec{D}$ are different fields, as are $\vec{B}$ and $\vec{H}$. In vacuum they differ only by constants, but in matter they have different physical meanings.
Forgetting the Displacement Current
The term $\varepsilon_0 \frac{\partial \vec{E}}{\partial t}$ in Ampère's law is essential for wave propagation and charge conservation. Don't omit it.
Sign Errors in Faraday's Law
The negative sign in Faraday's law (Lenz's law) is crucial—it determines the direction of induced currents. Always include it.
Mixing Gaussian and SI Units
Electromagnetic equations look different in Gaussian (CGS) and SI units. Stick to one system consistently. This guide uses SI units.
Incorrect Surface/Path Orientation
In integral forms, the surface normal and path direction must follow the right-hand rule. Incorrect orientation leads to sign errors.

Quick Reference

LawDifferential FormPhysical Meaning
Gauss (E)$\nabla \cdot \vec{E} = \rho/\varepsilon_0$Charges create E fields
Gauss (B)$\nabla \cdot \vec{B} = 0$No magnetic monopoles
Faraday$\nabla \times \vec{E} = -\partial\vec{B}/\partial t$Changing B creates E
Ampère-Maxwell$\nabla \times \vec{B} = \mu_0\vec{J} + \mu_0\varepsilon_0\partial\vec{E}/\partial t$Currents and changing E create B

Key Formulas

QuantityFormula
Speed of light$c = 1/\sqrt{\mu_0\varepsilon_0}$
Wave equation$\nabla^2\vec{E} = \mu_0\varepsilon_0 \partial^2\vec{E}/\partial t^2$
Poynting vector$\vec{S} = \vec{E} \times \vec{B}/\mu_0$
Energy density$u = \varepsilon_0 E^2/2 + B^2/(2\mu_0)$

Related Content

Ready to Start?

Start creating beautiful technical documentation with AutEng.

Get Started with AutEng