The Continuity Equation

Rub a balloon on your hair and it clings to the wall; touch a doorknob after crossing a carpet and a spark jumps to your finger. In every one of these little dramas the star is electric charge — and the one thing charge never, ever does is appear from nowhere or vanish into nothing. It can pile up, drain away, flow from here to there, but the books always balance. This is one of the deepest bookkeeping laws in all of physics: charge is conserved.

This page is about the sharpest possible statement of that law. "The total charge of the universe never changes" is true but toothless — it allows a coulomb to teleport from Mars to your kitchen so long as the grand total stays fixed. Nature is far stricter than that. Charge is conserved locally: for the amount inside any region to change, an exactly matching current must physically flow across that region's boundary. That "no teleporting" rule, written in the language of vector calculus, is the continuity equation:

\nabla \cdot \mathbf{J} = -\,\frac{\partial \rho}{\partial t}.

Everything below unpacks this single line — where it comes from, what each symbol is saying, and why it forbids charge from cheating.

Two kinds of conservation: global vs local

Imagine the total charge of the cosmos is a fixed number, and picture two ways it could stay fixed.

Global conservation only demands that the grand total never changes. Under this weak rule, a coulomb of charge could silently disappear from a lab in Geneva and reappear the same instant in a lab in Tokyo — no wire, no current, nothing in between — and the universe's ledger would still read the same. Physics does not work this way.

Local conservation is the real law, and it is far more demanding. It says charge cannot even take such a shortcut: the only way for the charge inside a region to change is for charge to flow continuously across the boundary of that region. To leave Geneva it must travel, crossing every surface between there and Tokyo, as a current. There are no wormholes for charge. This is exactly what "continuity" means — charge moves through space without gaps or jumps, like an incompressible traffic of little carriers.

The two ingredients we need are the ones you met when we defined current density: the charge density \rho (coulombs per cubic metre, how much charge sits in each little lump of space) and the current density \mathbf{J} (amperes per square metre, the flow of charge — a vector pointing along the current with a magnitude equal to the charge crossing a unit area each second). The continuity equation is the precise contract that ties the changing of \rho to the flowing of \mathbf{J}.

The physical picture: a leaky region

Draw an imaginary closed surface anywhere you like — a sphere, a cube, the surface of a potato — and call the space it wraps the volume V. Inside sits some charge Q. Now suppose current is flowing. Wherever the current density \mathbf{J} pokes outward through the surface, it is carrying charge out of the region; wherever it pokes inward, it carries charge in. Add up the outward flow over the whole surface and you get the net current leaving the region.

Here is the whole idea in one sentence: the net current flowing out through the boundary must equal the rate at which the charge inside is disappearing. If more charge leaves than enters, Q inside falls — and it falls at exactly the rate charge is crossing the wall, not a coulomb more or less. Step through the figure to watch charge drain out of a closed region.

The integral form: counting charge across a boundary

Let us turn that sentence into symbols. The charge inside the volume is the density added up over the interior,

Q(t) = \int_V \rho \, dV,

and the total current escaping through the closed boundary surface \partial V is the flux of \mathbf{J} through it,

I_{\text{out}} = \oint_{\partial V} \mathbf{J} \cdot d\mathbf{A}.

Here d\mathbf{A} is a little patch of the surface, pointing outward, so \mathbf{J}\cdot d\mathbf{A} is positive where current leaves and negative where it enters. "Net current out equals the rate charge inside falls" now reads:

This integral form is already the complete law. It is enormously useful, but it talks about whole regions at once. To get a law that lives at every single point in space — the differential form — we shrink the region down with a single, beautiful theorem.

From integral to differential: the divergence theorem

The bridge is the divergence theorem (Gauss's theorem), the same tool that turned Gauss's law from surface form into point form. It says the flux of any vector field out through a closed surface equals the integral of its divergence over the enclosed volume:

\oint_{\partial V} \mathbf{J} \cdot d\mathbf{A} = \int_V (\nabla \cdot \mathbf{J}) \, dV.

The divergence \nabla\cdot\mathbf{J} is a scalar that measures, at each point, how much the field is "spreading out" from there — how much more current flows out of a tiny box around the point than flows in. Substitute this into the integral form. On the right-hand side we also pull the time derivative inside the (fixed) volume integral, where it becomes a partial derivative because \rho depends on both position and time:

\int_V (\nabla \cdot \mathbf{J}) \, dV = -\,\frac{d}{dt}\int_V \rho \, dV = -\int_V \frac{\partial \rho}{\partial t} \, dV.

Now comes the punchline. This equality must hold for every volume V we could possibly have chosen — big, small, anywhere. Two integrals that agree over every region can only do so if their integrands agree at every point (otherwise we could draw a tiny box around a place where they differ and get a mismatch). Therefore, point by point:

The steady state: \nabla \cdot \mathbf{J} = 0

A huge fraction of everyday electronics runs in the steady state: currents that do not change with time, charge densities that have settled and stopped shifting. If nothing is piling up or draining anywhere, then \partial \rho/\partial t = 0 everywhere, and the continuity equation collapses to a wonderfully simple statement:

\nabla \cdot \mathbf{J} = 0.

In words: steady current density has no sources or sinks. Whatever flows into any region flows straight back out — the current field is "divergence-free", like an incompressible fluid with no taps and no drains. Field lines of a steady \mathbf{J} never start or stop in mid-air; they close on themselves.

This is Kirchhoff's current law in disguise. Shrink the region down to a single wire junction — a "node" where several wires meet. The integral form \oint \mathbf{J}\cdot d\mathbf{A} = 0 becomes: the sum of currents leaving the node is zero, i.e. the current flowing in equals the current flowing out, \sum I_{\text{in}} = \sum I_{\text{out}}. That humble rule you use to solve every circuit is nothing but local charge conservation applied at a point where wires meet. Kirchhoff's current law is the continuity equation wearing a lab coat.

A striking consequence: charge cannot hide inside a conductor

Combine continuity with Ohm's law in the form \mathbf{J} = \sigma \mathbf{E} (current density proportional to field, with conductivity \sigma) and Gauss's law \nabla\cdot\mathbf{E} = \rho/\varepsilon. Then \nabla\cdot\mathbf{J} = \sigma\,\nabla\cdot\mathbf{E} = \sigma\rho/\varepsilon, and the continuity equation becomes a differential equation for the charge density itself:

\frac{\partial \rho}{\partial t} = -\,\frac{\sigma}{\varepsilon}\,\rho \quad\Longrightarrow\quad \rho(t) = \rho_0\, e^{-t/\tau}, \qquad \tau = \frac{\varepsilon}{\sigma}.

Any lump of net charge placed inside a conductor drains away exponentially to the surface, with a relaxation time \tau = \varepsilon/\sigma. For a good metal like copper this time is astonishingly short — around 10^{-19}\ \text{s} — which is why we can safely say a conductor has no excess charge in its interior. Drag the slider to see how a smaller relaxation time makes the interior charge vanish faster.

Worked examples

Example 1 — reading the sign. Suppose at some point the current density is spreading out with divergence \nabla\cdot\mathbf{J} = +4\ \text{C}/(\text{m}^3\text{s}). What is happening to the charge there? From the continuity equation \partial\rho/\partial t = -\nabla\cdot\mathbf{J} = -4\ \text{C}/(\text{m}^3\text{s}), so the charge density is falling at 4 coulombs per cubic metre each second. Positive divergence ⇒ charge draining away. The minus sign did all the work.

Example 2 — a discharging capacitor plate. A small metal region loses charge at the rate dQ/dt = -0.20\ \text{C/s} (it is discharging). What net current flows out through any surface wrapped around it? The integral form gives

\oint \mathbf{J}\cdot d\mathbf{A} = -\frac{dQ}{dt} = -(-0.20) = +0.20\ \text{A}.

A net 0.20\ \text{A} flows outward — exactly the current draining the charge away.

Example 3 — a wire junction (Kirchhoff). Three wires meet at a node. Two carry current into the node: 3\ \text{A} and 5\ \text{A}. In the steady state, what must the third wire carry, and which way? Steady state means \oint\mathbf{J}\cdot d\mathbf{A}=0 around the node, so total in = total out. With 3+5 = 8\ \text{A} flowing in, the third wire must carry 8\ \text{A} out. No charge accumulates at a junction — it cannot, or the continuity equation would be violated.

Example 4 — steady current in a tapering wire. A steady current I flows through a wire that narrows from cross-section A_1 to A_2. Because \nabla\cdot\mathbf{J}=0, the same current crosses every slice, so J_1 A_1 = J_2 A_2 = I. Where the wire is thinner the current density is higher: J_2 = J_1 (A_1/A_2). The charge does not bunch up at the taper — it just speeds up.

Here is a delicious piece of history. The original Ampère's law says \nabla\times\mathbf{B} = \mu_0 \mathbf{J}. Take the divergence of both sides: the divergence of any curl is identically zero, so this forces \nabla\cdot\mathbf{J} = 0always. But we have just seen that in general \nabla\cdot\mathbf{J} = -\partial\rho/\partial t, which is not zero whenever charge is building up, as on a charging capacitor plate. The old law flatly contradicts charge conservation!

Maxwell spotted this and fixed it by adding the displacement current term \mu_0\varepsilon_0\,\partial\mathbf{E}/\partial t. With that extra piece the divergence of the corrected Ampère law reproduces the continuity equation exactly, restoring charge conservation. In other words, the continuity equation is not just a consequence of Maxwell's equations — historically it was the demand that forced the last equation into its final shape, and with it came the prediction of electromagnetic waves. Charge conservation, taken seriously, gave us light.

The classic mistake: thinking \nabla\cdot\mathbf{J}=0 is always true. It is tempting to remember "current has no divergence" as a permanent rule — but that holds only in the steady state, when nothing is changing in time. In general the right-hand side is -\partial\rho/\partial t, and it is nonzero exactly when charge is accumulating or draining somewhere.

The cleanest counter-example is a charging capacitor. Current flows along the wire and piles charge onto a plate — the charge density there is genuinely rising, so \partial\rho/\partial t \ne 0 and hence \nabla\cdot\mathbf{J} \ne 0 at the plate. If you (wrongly) insist on \nabla\cdot\mathbf{J}=0 there, you conclude no charge can accumulate — which is nonsense, since that is exactly what a capacitor does. Reserve \nabla\cdot\mathbf{J}=0 for steady currents; keep the full \nabla\cdot\mathbf{J} = -\partial\rho/\partial t whenever charge is on the move in time.