A continuity equation in physics is a differential equation that describes the transport of some kind of conserved quantity. Since mass, energy, momentum, electric charge and other natural quantities are conserved, a vast variety of physics may be described with continuity equations.
Continuity equations are the (stronger) local form of conservation laws. All the examples of continuity equations below express the same idea, which is roughly that: the total amount (of the conserved quantity) inside any region can only change by the amount that passes in or out of the region through the boundary. A conserved quantity cannot increase or decrease, it can only move from place to place.
Any continuity equation has a "differential form" (in terms of the divergence operator) and an "integral form" (in terms of a flux integral). In this article, only the "differential form" versions will be given; see the article divergence theorem for how to express any of these laws in "integral form".
Contents 
The general form for a continuity equation is
where is some quantity, ƒ is a function describing the flux of , and s describes the generation (or removal) rate of . This equation may be derived by considering the fluxes into an infinitesimal box. If is a conserved quantity, the generation or removal rate is zero:
This general equation may be used to derive any continuity equation, ranging from as simple as the volume continuity equation to as complicated as the Navier–Stokes equations. This equation also generalizes the advection equation.
In electromagnetic theory, the continuity equation can either be regarded as an empirical law expressing (local) charge conservation, or can be derived as a consequence of 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,
One of Maxwell's equations, Ampère's law, states that
Taking the divergence of both sides results in
but the divergence of a curl is zero, so that
Another one of Maxwell's equations, Gauss's law, states that
Substitute this into equation (1) to obtain
which is the continuity equation.
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.
In fluid dynamics, the continuity equation is a mathematical statement that, in any steady state process, the rate at which mass enters a system is equal to the rate at which mass leaves the system. ^{[1]} In fluid dynamics, the continuity equation is analogous to Kirchhoff's Current Law in electric circuits.
The differential form of the continuity equation is:
where ρ is fluid density, t is time, and u is fluid velocity. If density (ρ) is a constant, as in the case of incompressible flow, the mass continuity equation simplifies to a volume continuity equation:
which means that the divergence of velocity field is zero everywhere. Physically, this is equivalent to saying that the local volume dilation rate is zero.
Further, the NavierStokes equations form a vector continuity equation describing the conservation of linear momentum.
In quantum mechanics, the conservation of probability also yields a continuity equation. If P(x, t) be a probability density function,
where j is probability flux.
Conservation of a current (not necessarily an electromagnetic current) is expressed compactly as the Lorentz invariant divergence of a fourcurrent:
where
so that since
then
implies that the current is conserved:
