All the examples of continuity equations below express the same idea. Continuity equations are the (stronger) local form of conservation laws.
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,
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.
where ρ is density, t is time, and u is fluid velocity.
where J is probability flux.