Continuity equation

Suppose a physical quantity is conserved locally, which means that if the total quantity inside some region $V$ decreases at some rate, then the flux out of the region should be at that rate.

More specifically, if $\rho(\v x,t)$ is the density and $\v J(\v x,t)$ is the current density, $$ \pdd t \int_V \rho\,dV = -\int_{\partial V}\v J\cdot d\v S. $$ Using the divergence theorem, we obtain the continuity equation $$ \pdfd\rho t + \nabla\cdot\v J = 0. $$