Menu

EducationPhotonicsWave Equation
Photonics SeriesPhotonics Lesson20 min read

The Electromagnetic Wave Equation

How do light, radio waves, and X-rays travel through empty space? In this lesson, we derive the wave equation from Maxwell's equations and build intuition by visualizing every concept with live Python code you can edit and run.

What you will learn: Starting from Maxwell's four equations, we show that electric and magnetic fields satisfy a wave equation whose solutions travel at the speed of light. We then explore superposition, interference, standing waves, and wave packets - all with interactive code labs.

Prerequisites: Basic calculus (partial derivatives), familiarity with vectors (curl, divergence). No coding experience required - just edit the numbers and see what happens.

Lesson Outline

1.Maxwell's Equations - The Starting Point

2.Deriving the Wave Equation

3.The Plane Wave Solution

4.Visualizing Electric & Magnetic Fields

5.Superposition & Interference

6.Standing Waves

7.Wave Packets & Group Velocity

8.Key Equations Summary

1. Maxwell's Equations - The Starting Point

Everything in classical electromagnetism follows from four equations published by James Clerk Maxwell in 1865. In free space (no charges, no currents), they simplify to a beautifully symmetric set:

Maxwell's Equations in Free Space

I.
∇ · E = 0

Gauss's law - no free charges create or terminate field lines in vacuum

II.
∇ · B = 0

Gauss's law for magnetism - magnetic monopoles do not exist

III.
∇ × E = -∂B/∂t

Faraday's law - a changing magnetic field induces an electric field

IV.
∇ × B = μ₀ε₀ ∂E/∂t

Ampere-Maxwell law - a changing electric field creates a magnetic field

Key Insight

Look at equations III and IV together: a changing B creates E, and a changing E creates B. This mutual induction is the engine that sustains electromagnetic waves - the fields regenerate each other as they propagate through space.

Physical Constants

  • ε₀ = 8.854 × 10⁻¹² F/m - permittivity of free space
  • μ₀ = 4π × 10⁻⁷ H/m - permeability of free space
  • c = 1/√(μ₀ε₀) = 2.998 × 10⁸ m/s - speed of light

Notation

  • ∇ · - divergence (how much a field spreads out)
  • ∇ × - curl (how much a field circulates)
  • ∂/∂t - partial derivative with respect to time
SPOT THE ERROR“EM waves need a medium to travel”

The Misconception

Sound needs air, water waves need water - so light must need the “luminiferous aether,” a medium filling all space.

The Reality

The Michelson-Morley experiment (1887) proved no aether exists. Maxwell's equations show E and B regenerate each other - the fields are the medium.

2. Deriving the Wave Equation

We now show that Maxwell's equations in free space imply that both E and B satisfy a wave equation. This is one of the most beautiful results in all of physics.

Step-by-Step Derivation

Step 1: Take the curl of Faraday's law

Apply ∇× to both sides of equation III:

∇ × (∇ × E) = ∇ × (-∂B/∂t) = -∂/∂t (∇ × B)

Step 2: Substitute Ampère-Maxwell law

Replace ∇ × B using equation IV:

∇ × (∇ × E) = -∂/∂t (μ₀ε₀ ∂E/∂t) = -μ₀ε₀ ∂²E/∂t²

Step 3: Use the vector identity

The vector identity ∇ × (∇ × E) = ∇(∇ · E) - ∇²E, and since ∇ · E = 0 (Gauss's law):

-∇²E = -μ₀ε₀ ∂²E/∂t²

Step 4: The wave equation

Rearranging gives:

∇²E = μ₀ε₀ ∂²E/∂t²

This is the electromagnetic wave equation. The same derivation with the roles of E and B swapped gives an identical equation for B.

The Speed of Light Falls Out

Compare with the standard wave equation ∇²f = (1/v²) ∂²f/∂t². The wave speed is v = 1/√(μ₀ε₀). Plug in the measured values of μ₀ and ε₀, and you get v ≈ 3 × 10⁸ m/s - the speed of light. This was Maxwell's remarkable prediction: light is an electromagnetic wave.

SPOT THE ERROR“The wave equation only applies to light”

The Misconception

Students treat the electromagnetic wave equation as a special formula for visible light.

The Reality

The same equation describes radio waves, microwaves, infrared, visible, UV, X-rays, and gamma rays. The only difference is the frequency. The entire electromagnetic spectrum is one phenomenon.

3. The Plane Wave Solution

The simplest solution to the wave equation is the plane wave - a sinusoidal oscillation that extends infinitely in the transverse directions and propagates in one direction:

E(x, t) = E₀ sin(kx - ωt + φ)

E₀ - amplitude (maximum field strength)

k = 2π/λ - wavenumber (spatial frequency)

ω = 2πf - angular frequency

λ - wavelength

f - frequency (cycles per second)

φ - initial phase

The dispersion relation connects them: ω = ck, so c = fλ

To verify that this is indeed a solution, substitute into the wave equation. The spatial second derivative gives -k²E, and the temporal second derivative gives -ω²E. The equation ∇²E = μ₀ε₀ ∂²E/∂t² becomes -k² = -μ₀ε₀ω², which is satisfied when ω/k = 1/√(μ₀ε₀) = c.

Live Lab: Plane Electromagnetic Wave

Visualize E(x,t) = E0 sin(kx - ωt) as a function of position at a fixed time. Try changing the wavelength and amplitude.

Live Code Editor
Code EditorPython
Loading editor...
Live Preview

Preparing preview

Running once automatically on first load

Learn by Experimenting

This is a safe playground for learning! Try changing:

  • Colors: Modify color values to see different palettes
  • Numbers: Adjust sizes, positions, or data ranges
  • Labels: Update titles, axis names, or legends

Edit the code, run it, then open the full data visualization tool to continue with your own dataset.

4. Visualizing Electric & Magnetic Fields

In an electromagnetic wave, the electric field E and the magnetic field B are always perpendicular to each other and to the direction of propagation. This is called a transverse wave.

Transversality

Both E and B oscillate perpendicular to the propagation direction k. If the wave travels along x, then E might point along y and B along z.

In Phase

In vacuum, E and B reach their maxima and zero crossings at the same points in space and time. They are perfectly in phase.

Amplitude Ratio

The magnitudes are related by E₀ = cB₀. Since c is huge, E is much larger in SI units (V/m vs Tesla).

SPOT THE ERROR“E and B fields are 90° out of phase”

The Misconception

Because E and B are perpendicular in space, students conclude they must also be shifted 90° in time (like in an LC circuit).

The Reality

In a plane wave in vacuum, E and B are in phase - they reach zero and peak at the same locations. The spatial perpendicularity is about direction, not timing.

Live Lab: E and B Fields of a Plane Wave

The electric and magnetic fields oscillate perpendicular to each other and to the propagation direction. Edit the code to change the phase or see it at different times.

Live Code Editor
Code EditorPython
Loading editor...
Live Preview

Preparing preview

Running once automatically on first load

Learn by Experimenting

This is a safe playground for learning! Try changing:

  • Colors: Modify color values to see different palettes
  • Numbers: Adjust sizes, positions, or data ranges
  • Labels: Update titles, axis names, or legends

Edit the code, run it, then open the full data visualization tool to continue with your own dataset.

5. Superposition & Interference

The wave equation is linear - if E₁ and E₂ are individual solutions, then E₁ + E₂ is also a solution. This is the principle of superposition, and it explains all interference phenomena.

Constructive Interference

When two waves are in phase (crests aligned with crests), their amplitudes add. The resulting wave has larger amplitude.

Δφ = 0, 2π, 4π, ... → A_total = A₁ + A₂

Destructive Interference

When two waves are out of phase (crests aligned with troughs), they cancel. If equal amplitude, complete cancellation.

Δφ = π, 3π, 5π, ... → A_total = |A₁ - A₂|

Beats

When two waves with slightly different frequencies interfere, the result oscillates at the average frequency with an amplitude that varies slowly at the beat frequency f_beat = |f₁ - f₂|. This is exactly what you hear when tuning a guitar string against a reference.

Live Lab: Superposition of Two Waves

Two waves of slightly different frequencies produce beats. Change f2 to see how the beat pattern changes.

Live Code Editor
Code EditorPython
Loading editor...
Live Preview

Preparing preview

Running once automatically on first load

Learn by Experimenting

This is a safe playground for learning! Try changing:

  • Colors: Modify color values to see different palettes
  • Numbers: Adjust sizes, positions, or data ranges
  • Labels: Update titles, axis names, or legends

Edit the code, run it, then open the full data visualization tool to continue with your own dataset.

6. Standing Waves

When two identical waves travel in opposite directions, their superposition creates a standing wave - a pattern that oscillates in time but does not propagate.

Mathematical Form

Two counter-propagating plane waves:

E₁ = A sin(kx - ωt)   (rightward)
E₂ = A sin(kx + ωt)   (leftward)

Their sum, using the identity sin(a) + sin(b) = 2 sin((a+b)/2) cos((a-b)/2):

E(x,t) = 2A sin(kx) cos(ωt)

Nodes

Points where sin(kx) = 0, so the field is always zero. Located at x = nλ/2.

Antinodes

Points where |sin(kx)| = 1, so the field reaches maximum amplitude. Located at x = (2n+1)λ/4.

Standing waves are fundamental to resonators, laser cavities, and musical instruments. A laser cavity of length L supports only wavelengths satisfying L = nλ/2 - the resonance condition.

Live Lab: Standing Wave

A standing wave forms when two counter-propagating waves interfere. Notice the nodes (zero amplitude) and antinodes (maximum amplitude).

Live Code Editor
Code EditorPython
Loading editor...
Live Preview

Preparing preview

Running once automatically on first load

Learn by Experimenting

This is a safe playground for learning! Try changing:

  • Colors: Modify color values to see different palettes
  • Numbers: Adjust sizes, positions, or data ranges
  • Labels: Update titles, axis names, or legends

Edit the code, run it, then open the full data visualization tool to continue with your own dataset.

7. Wave Packets & Group Velocity

A single plane wave extends infinitely - it has a well-defined frequency but no localization. Real signals (laser pulses, photons, radio bursts) are wave packets: superpositions of many frequencies that form a localized pulse.

Phase Velocity vs Group Velocity

Phase Velocity (v_p)

The speed at which individual wave crests move:

v_p = ω/k

In vacuum, v_p = c for all frequencies.

Group Velocity (v_g)

The speed at which the envelope (and energy) moves:

v_g = dω/dk

In a dispersive medium, v_g ≠ v_p. Information travels at v_g.

Heisenberg's Uncertainty Principle (Classical Version)

A wave packet cannot be simultaneously narrow in space and narrow in frequency. Mathematically: Δx · Δk ≥ 1/2. A shorter pulse requires a broader range of frequency components. This is a mathematical consequence of Fourier analysis - it applies to water waves and radio signals too, not just quantum mechanics.

Live Lab: Wave Packet & Group Velocity

A wave packet is a superposition of many frequencies forming a localized pulse. Try changing the number of components or the spread Δk.

Live Code Editor
Code EditorPython
Loading editor...
Live Preview

Preparing preview

Running once automatically on first load

Learn by Experimenting

This is a safe playground for learning! Try changing:

  • Colors: Modify color values to see different palettes
  • Numbers: Adjust sizes, positions, or data ranges
  • Labels: Update titles, axis names, or legends

Edit the code, run it, then open the full data visualization tool to continue with your own dataset.

Live Lab: Phase Velocity vs Group Velocity

In a dispersive medium, the phase velocity and group velocity differ. Watch how the envelope (group) moves at a different speed than the carrier (phase).

Live Code Editor
Code EditorPython
Loading editor...
Live Preview

Preparing preview

Running once automatically on first load

Learn by Experimenting

This is a safe playground for learning! Try changing:

  • Colors: Modify color values to see different palettes
  • Numbers: Adjust sizes, positions, or data ranges
  • Labels: Update titles, axis names, or legends

Edit the code, run it, then open the full data visualization tool to continue with your own dataset.

SPOT THE ERROR“Group velocity can exceed c”

The Half-Truth

In anomalous dispersion regions, v_g can mathematically exceed c or even become negative. Students conclude information can travel faster than light.

The Full Picture

When v_g > c, the group velocity ceases to represent the signal velocity. The actual signal front always travels at ≤ c (the Sommerfeld-Brillouin result). No information violates causality.

8. Key Equations Summary

ConceptEquation
Wave equation∇²E = μ₀ε₀ ∂²E/∂t²
Speed of lightc = 1/√(μ₀ε₀)
Plane waveE = E₀ sin(kx - ωt)
Dispersion relationω = ck
Standing waveE = 2A sin(kx) cos(ωt)
Phase velocityv_p = ω/k
Group velocityv_g = dω/dk
E-B relationshipE₀ = cB₀

Visualize It Yourself

Upload your own data or describe any physics simulation in plain English. Plotivy generates the Python code and the plot instantly - from wave optics to quantum mechanics.

Up Next in the Photonics Series

Polarization of Light

Linear, circular, and elliptical polarization. Jones vectors, Malus' law, and waveplates - all with interactive simulations.

Coming soon