# Continuity equation

All the examples of continuity equations below express the same idea. Continuity equations are the (stronger) local form of conservation laws.

## Electromagnetic theory

In electromagnetic theory, the continuity equation is derived from two of Maxwell's equations. It states that the divergence of the current density is equal to the negative rate of change of the charge density,

${\displaystyle \nabla \cdot \mathbf {J} =-{\partial \rho \over \partial t}}$

### Derivation

One of Maxwell's equations, Ampère's law, states that

${\displaystyle \nabla \times \mathbf {H} =\mathbf {J} +{\partial \mathbf {D} \over \partial t}.}$

Taking the divergence of both sides results in

${\displaystyle \nabla \cdot \nabla \times \mathbf {H} =\nabla \cdot \mathbf {J} +{\partial \nabla \cdot \mathbf {D} \over \partial t}}$,

but the divergence of a curl is zero, so that

${\displaystyle \nabla \cdot \mathbf {J} +{\partial \nabla \cdot \mathbf {D} \over \partial t}=0.\qquad \qquad (1)}$

Another one of Maxwell's equations, Gauss's law, states that

${\displaystyle \nabla \cdot \mathbf {D} =\rho .\,}$

Substitute this into equation (1) to obtain

${\displaystyle \nabla \cdot \mathbf {J} +{\partial \rho \over \partial t}=0,\,}$

which is the continuity equation.

### Interpretation

Current density is the movement of charge density. The continuity equation says that if charge is moving out of a differential volume (i.e. divergence of current density is positive) then the amount of charge within that volume is going to decrease, so the rate of change of charge density is negative. Therefore the continuity equation amounts to a conservation of charge.

## Fluid dynamics

In fluid dynamics, a continuity equation is an equation of conservation of mass. Its differential form is

${\displaystyle {\partial \rho \over \partial t}+\nabla \cdot (\rho \mathbf {u} )=0}$

where ${\displaystyle \rho }$ is density, t is time, and u is fluid velocity.

## Quantum mechanics

In quantum mechanics, the conservation of probability also yields a continuity equation. Let P(xt) be a probability density and write

${\displaystyle \nabla \cdot \mathbf {j} =-{\partial \over \partial t}P(x,t)}$

where J is probability flux.