JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Maxwell, Diffusion in Imaging, and Beyond

Two faces of the same toolkit. Maxwell's equations bundle all of electricity, magnetism, and light into a hyperbolic wave system; and the very same heat equation that smooths temperature is quietly denoising your photographs — until someone teaches it to stop smoothing across edges.

Maxwell: four equations that turned out to be a wave

By now you have seen PDEs model heat, vibrating strings, fluids, quantum amplitudes, and option prices. Maxwell's equations are the grandest application of all, because a single first-order system for two vector fields — the electric field E and the magnetic field B — turns out to contain all of classical electricity, magnetism, and optics. Two of the four equations are constraints (the divergence of B is zero; the divergence of E is the charge density), and two are evolution laws coupling the fields in time: a changing magnetic field drives a curling electric field, and a changing electric field plus any current drives a curling magnetic field. That mutual coupling is the whole story.

Here is the moment that made Maxwell famous. Take the curl equations in empty space, with no charges and no currents, and differentiate one in time and substitute the other. The cross-coupling closes on itself, and each component of E (and of B) is found to obey the wave equation u_tt = c^2 (u_xx + u_yy + u_zz). A system you wrote down to describe magnets and batteries has, with no extra physics, predicted self-sustaining waves — and the speed c that drops out is built from two laboratory constants of electricity and magnetism. Maxwell computed it and got the speed of light. Light is an electromagnetic wave; that is a theorem of this PDE system, not an assumption fed into it.

When you drop the clock: Helmholtz

Most of the time we do not want a single travelling pulse; we want steady oscillation at one frequency — a laser of fixed colour, a radio antenna humming at one station, an MRI coil ringing at one rate. So we feed the wave equation a solution of the form u(x,t) = v(x) cos(omega t): one fixed spatial shape v(x), breathing in and out at angular frequency omega. Substitute it and the time derivatives turn into a factor of -omega^2, the clock cancels out, and what remains is a pure spatial equation with no t in sight.

wave eqn:    u_tt = c^2 (u_xx + u_yy + u_zz)
ansatz:      u(x,t) = v(x) cos(omega t)
=>           -omega^2 v = c^2 (Laplacian v)
let k = omega/c :

   Laplacian v + k^2 v = 0      (Helmholtz)

compare  Laplacian v = 0       (Laplace, k = 0)
A time-harmonic wave collapses to the Helmholtz equation — Laplace's equation with an extra k^2 v term that injects oscillation instead of pure equilibrium.

That equation, Laplacian v + k^2 v = 0, is the Helmholtz equation, and it is the spatial heart of every steady-state wave problem: acoustics, optics, electromagnetic scattering, antenna design. It looks one small term away from Laplace's equation — and that one term changes everything. Laplace's solutions only equilibrate and never wiggle (their maximum principle forbids interior peaks); Helmholtz solutions oscillate, with the k^2 v term acting like a restoring force that lets v overshoot and ring. The price is that the friendly maximum principle is gone, and for many frequencies the boundary-value problem can fail to have a unique solution at all — those special frequencies are exactly the resonances, the normal modes you met on the vibrating string, now in space.

The heat equation, moonlighting as a denoiser

Now the second face of the toolkit, and it costs no new equation at all. Think of a grayscale image as a function u(x, y): brightness over a flat sheet. Camera noise makes that function jittery — a fine speckle of random ups and downs on top of the real picture. You already know an operation that destroys fine wiggles while leaving broad features: the smoothing effect of the heat equation. So treat the image as an initial temperature and let it diffuse: run u_t = k (u_xx + u_yy) — the diffusion equation — for a short artificial 'time' t. High-frequency noise, which decays fastest, melts away first; the photo cools into a cleaner version of itself. This is Gaussian blur, and the heat kernel you met as the response to a point of heat is literally the blur kernel of image processing.

Beautiful — and useless on its own. The heat equation is isotropic: it smooths equally in every direction, with no idea where the meaningful edges are. Blur away the noise and you blur away the cheekbone, the text, the boundary between sky and roof, in exactly the same stroke. This is the smoothing effect biting back: the same infinite-speed averaging that erases speckle erases structure. Honest diffusion does not know an edge from a glitch; both are just steep gradients, and it irons them all flat.

Perona-Malik: teach the diffusion to respect edges

The fix is one of the prettiest ideas in applied PDE. Keep the diffusion, but make its conductivity depend on the image itself. Where the picture is flat (small gradient), let heat flow freely and wash out the noise; where the gradient is steep — an edge — clamp the conductivity down to nearly zero so heat refuses to cross. The result is Perona-Malik diffusion: a nonlinear, anisotropic heat equation that smooths along edges but not across them. You feed it the noisy photo, it diffuses the flat regions clean while leaving the boundaries crisp, and it stops where the smoothing would do harm.

  1. Read the image as a function u(x, y), brightness over the plane, and measure the gradient magnitude |grad u| at every pixel — large where an edge is, small where the region is flat.
  2. Choose a conductivity c(|grad u|) that is near 1 for small gradients and tends to 0 for large ones — for instance c = 1/(1 + (|grad u|/lambda)^2), where lambda is your 'how steep counts as an edge' threshold.
  3. Evolve u_t = div( c(|grad u|) grad u ) for a short time: this is the heat equation with a brake, diffusing freely on flat patches and shutting off at edges.
  4. Stop early. Unlike pure diffusion, you do not run to equilibrium — a few steps remove noise; too many over-process the image into cartoonish blobs.

Beyond: curves that move by PDE

Image processing wants more than denoising — it wants to find the boundary of an object and trace it. The trouble is that a moving curve can do nasty things: it can pinch off, split into two, or merge, and tracking the points of a curve through a split is a bookkeeping nightmare. The level-set method sidesteps the whole mess with a lovely change of viewpoint. Instead of following the curve directly, embed it as the zero contour of a function phi(x, y, t) defined on the whole plane — the curve is wherever phi = 0 — and evolve phi by a PDE. When the surface phi slides up or down, its zero contour moves, splits, and merges automatically, with no special handling, because a contour line of a smooth surface can break apart while the surface itself stays perfectly smooth.

Which PDE drives phi depends on how you want the boundary to move, and the choices are old friends. Move every point at constant speed along its normal and phi obeys the eikonal equation |grad phi| = 1/F — the same first-order equation that governs wavefronts and shortest arrival times, solved by the characteristics you met long ago. Move each point at a speed equal to the local curvature and you get mean-curvature flow, a geometric cousin of the heat equation that smooths a wiggly curve the way diffusion smooths a wiggly graph. The frontier of imaging, computer vision, and computer graphics runs on these — segmentation, shape tracking, simulating flames and water surfaces — and every one of them is a PDE on a level set.

Step back and the lesson of this whole rung comes into focus. There were never really five separate equations for fluids, quanta, money, and pictures — there were a handful of PDE types, reused. Diffusion smooths (heat, denoising, mean-curvature flow); waves propagate at finite speed (Maxwell, acoustics, the eikonal front); equilibrium balances (Laplace, Helmholtz at rest). When a new field hands you a phenomenon, the first question is no longer 'what is the equation' but 'which type is this' — and the answer tells you in advance whether information will smooth or sharpen, travel at finite or infinite speed, and what data you are even allowed to prescribe. That single habit of mind is the real payoff of climbing this ladder.