Definition:

Mathematical representation of Equation of continuity:

If $\overrightarrow{J}$ is the current density of a closed surface $\overrightarrow{S}$ then the current through a closed surface is

$i=\oint_{S} \overrightarrow{J}. \overrightarrow{dS} \qquad(1)$

Let $V$ be the volume enclosed by the surface $S$. So the total charge in this volume-

$q=\oint_{V} \rho. dV \qquad(2)$

By the law of conservation of charge i.e. "Charge can neither be created nor destroyed". If some charge flows out from the volume per unit time giving rise to current density, the charge in the volume decreases at the same rate. So the current

$i=-\frac{\partial q}{\partial t}$

$i=-\frac{\partial}{\partial t} (\oint_{V} \rho. dV) \qquad (from \: equation(2) \: )$

$i=-\oint_{V} \frac{\partial \rho}{\partial t} dV \qquad(3)$

from equation $(1)$ and equation $(3)$

$\oint_{S} \overrightarrow{J}. \overrightarrow{dS}= -\oint_{V} \frac{\partial \rho}{\partial t} dV \qquad(4)$

According to Gauss's divergence theorem-

$\oint_{S} \overrightarrow{J}. \overrightarrow{dS}= \oint_{V} (\overrightarrow{\nabla}. \overrightarrow{J}) dV \qquad(5)$

From equation $(4)$ and equation $(5)$

$\oint_{V} (\overrightarrow{\nabla}. \overrightarrow{J}) dV = -\oint_{V} \frac{\partial \rho}{\partial t} dV$

$\oint_{V} (\overrightarrow{\nabla}. \overrightarrow{J}) dV + \oint_{V} \frac{\partial \rho}{\partial t} dV =0 $

$\oint_{V} [(\overrightarrow{\nabla}. \overrightarrow{J}) + \frac{\partial \rho}{\partial t}] dV =0 $

$\overrightarrow{\nabla}. \overrightarrow{J} + \frac{\partial \rho}{\partial t} =0 $

This equation is known as the equation of continuity and it is based on the conservation of charge.

For the study state $\frac{\partial{\rho}}{\partial{t}}=0$

$\overrightarrow{\nabla}. \overrightarrow{J}=0$

This means that in the steady state, there is no source or sink of current.

The mathematical representation of the law of conservation of charge in differential form is called the "continuity equation".