Current density is the total amount of current flowing per unit cross-sectional area. So, the total current passing through a cross-sectional area can be expressed as the surface integral of the current density. Now, charge conservation requires that the total current flowing out of a given volume equals the rate of decrease of charge within that volume. Expressing the total charge in terms of the volume charge density, the equation gets modified. Since the charge density is a space function, using the Leibniz rule, its time derivative can be moved inside the integral. Applying the divergence theorem to the left-hand side of the equation converts the closed surface integral to a volume integral. This relation holds for any volume; as a result, the integrands are equal. The divergence of the current density equals the negative rate of change of volume charge density. This mathematical statement of local charge conservation is called the continuity equation. For steady currents, the charge density is invariant with time. So, the divergence of the current density is zero.