Deep Dive: Charge Conservation, Steady Current, and KCL
The continuity equation is the general mathematical statement of charge conservation. The condition $\nabla\cdot\mathbf{J}=0$ follows only when the charge distribution is steady. The same conservation law will later become Kirchhoff's current law (KCL) when we describe a junction as a circuit node.
Consider a volume $V$ enclosed by a surface $S$. The total charge $Q$ inside this volume is the integral of the charge density $\rho$:
$$ Q(t) = \int_V \rho(\mathbf{r}, t) \, d\tau $$Since charge is conserved, the only way the total charge inside $V$ can decrease is if charge flows out through the surface $S$. Therefore, the current flowing out ($I_{out}$) must equal the rate of decrease of the enclosed charge:
We can rewrite the total current $I_{out}$ using the Divergence Theorem to convert the surface integral into a volume integral:
$$ \oint_S \mathbf{J} \cdot d\mathbf{a} = \int_V (\nabla \cdot \mathbf{J}) \, d\tau $$Simultaneously, we move the time derivative inside the charge integral (assuming the volume $V$ is fixed in space):
$$ - \frac{dq}{dt} = - \frac{d}{dt} \int_V \rho \, d\tau = - \int_V \frac{\partial \rho}{\partial t} \, d\tau $$Equating the two volume integrals from Step 2:
$$ \int_V (\nabla \cdot \mathbf{J}) \, d\tau = - \int_V \frac{\partial \rho}{\partial t} \, d\tau $$Since this must hold true for any arbitrary volume $V$, the integrands themselves must be equal. This yields the Continuity Equation, which is the general law and applies whether or not the current is steady:
Translation: Current flows out of a point ($\nabla \cdot \mathbf{J}$) exactly as fast as the charge density there decreases ($-\partial \rho / \partial t$).
A steady current is defined as a flow where the charge distribution does not change with time. While charge is moving, it is not piling up anywhere.
$$ \text{Steady State} \implies \frac{\partial \rho}{\partial t} = 0 $$Substituting this into the continuity equation:
From a Volume to a Circuit Node
Now surround a circuit junction with a small closed surface. The integral continuity equation says that any imbalance between the currents entering and leaving that node must appear as stored charge:
In the lumped, steady-state circuit limit, the node does not accumulate appreciable charge. Setting $dQ_{\mathrm{node}}/dt\approx0$ gives Kirchhoff's current law:
A charging capacitor plate shows why the general equation matters. Conduction current reaches the plate, but charge cannot cross the dielectric, so the plate charge changes and $dQ/dt\neq0$. This does not violate charge conservation; it is precisely the term that a careless steady-state KCL argument would omit. In a circuit model we define the capacitor current by $I_C=dQ/dt$, so the stored charge is kept in the bookkeeping rather than ignored.
Visualizing the Concept
The simulation below demonstrates this relationship. In Steady State, the inflow equals the outflow, so the density $\rho$ remains constant ($\nabla \cdot \mathbf{J} = 0$). In Accumulation mode, the outflow is restricted, causing $\rho$ to rise over time ($\nabla \cdot \mathbf{J} < 0$).