# How does the continuity equation mean that the charge is conserved in the neighbourhood of any point?

I am currently studying the textbook Principles of Optics: Electromagnetic Theory of Propagation, Interference and Diffraction of Light, 7th Edition, by Max Born and Emil Wolf. In section 1.1.1 Maxwell's equations, the authors say the following:

$$\dfrac{\partial{\rho}}{\partial{t}} + \text{div} \ \mathbf{j} = 0 \tag{5}$$ By analogy with a similar relation encountered in hydrodynamics, (5) is called the equation of continuity. It expresses the fact that charge is conserved in the neighbourhood of any point.

$$\rho$$ is defined to be the electric charge density, and $$\mathbf{j}$$ is defined to be the electric current density.

So (5) is saying that the change in the electric charge density with respect to time plus the divergence of the electric current density is equal to zero. But how does this mean that the charge is conserved in the neighbourhood of any point?

I'll use their hydrodynamics analogy to provide an answer which might be a little bit easier to visualize. In hydrodynamics, $$\rho$$ represents the density of the fluid, while $$\mathbf{j} = \rho \mathbf{v}$$ is a "mass current", where $$\mathbf{v}$$ is the fluid's velocity. Notice it is sort of a generalization of momentum.

To interpret the equation, let us perform a volume integral over some region $$\mathcal{V}$$ (if you prefer, you can choose this volume to be a neighborhood of some point, to use the same words the authors used). The volume integral is then $$\int_{\mathcal{V}} \frac{\partial \rho}{\partial t} \ \textrm{d}^3 x = -\int_{\mathcal{V}} \mathbf{\nabla\cdot j} \ \textrm{d}^3 x.$$ We can pull the derivative out of the first integral, since we are integrating over space and differentiating with respect to time. Hence, $$\frac{\textrm{d}}{\textrm{d} t} \int_{\mathcal{V}} \rho \ \textrm{d}^3 x = -\int_{\mathcal{V}} \mathbf{\nabla\cdot j} \ \textrm{d}^3 x.$$

However, notice that $$\int_{\mathcal{V}} \rho \ \textrm{d}^3 x$$ is the integral of the density over some volume. In other words, this is simply the total mass contained in the volume $$\mathcal{V}$$. Let us denote it by $$Q$$ (the reason being the fact that in Electrodynamics, this would be just the total charge within $$\mathcal{V}$$). Hence, our equation reads $$\frac{\textrm{d} Q}{\textrm{d} t} = -\int_{\mathcal{V}} \mathbf{\nabla\cdot j} \ \textrm{d}^3 x.$$

This is cool, but what about the RHS? To deal with it, we'll employ the Divergence Theorem (also known as Gauss' Theorem), which states that $$\int_{\mathcal{V}} \mathbf{\nabla\cdot j} \ \textrm{d}^3 x = \int_{\partial\mathcal{V}} \mathbf{j \cdot n} \ \textrm{d}S,$$ where $$\partial \mathcal{V}$$ is the surface enclosing $$\mathcal{V}$$, $$\mathbf{n}$$ is the unit vector normal to this surface and pointing outwards, and $$\textrm{d}S$$ is a surface element. We get $$\frac{\textrm{d} Q}{\textrm{d} t} = - \int_{\partial\mathcal{V}} \mathbf{j \cdot n} \ \textrm{d}S.$$

Let us then understand the meaning of each term of this equation. $$\mathbf{j \cdot n}$$ measures how much $$\mathbf{j}$$ is aligned with $$\mathbf{n}$$ at each point. In other words, it tells us how much the fluid is flowing across the surface at that point. If $$\mathbf{j}$$ and $$\mathbf{n}$$ are orthogonal, the fluid is flowing parallel to the surface, and hence it is not coming in nor going out. If $$\mathbf{j \cdot n} > 0$$, then the two vectors are aligned and fluid is going out. If $$\mathbf{j \cdot n} < 0$$, they are opposed to each other and there is fluid coming in. We then integrate this quantity over the entire surface: $$\int_{\partial\mathcal{V}} \mathbf{j \cdot n} \textrm{d}S$$. This gives us a measure of how much fluid is going out. If we put a negative sign in front of this integral, we get a measure of how much fluid is coming in.

On the LHS, we get $$\frac{\textrm{d} Q}{\textrm{d} t}$$, which measures the change in mass in the volume $$\mathcal{V}$$. If $$\frac{\textrm{d} Q}{\textrm{d} t} > 0$$, then the amount of fluid must be increasing. If $$\frac{\textrm{d} Q}{\textrm{d} t} < 0$$, it is decreasing. If it vanishes, it remains constant. Our equation says $$\frac{\textrm{d} Q}{\textrm{d} t} = - \int_{\partial\mathcal{V}} \mathbf{j \cdot n} \ \textrm{d}S.$$

Hence, in words, it says $$\text{the increase in amount of fluid in the volume} = \text{the amount of fluid coming in through the surface}.$$

That is the idea: the equation states mathematically that the fluid flows in a continuous way. If there is more fluid inside the volume, it can't have come from nowhere: it must have crossed the surface bounding the volume.

The same idea holds for Electrodynamics: if there is a change of charge inside a volume, it must have come by crossing the surface that bounds the volume. It can't appear out of nothing and it can't vanish. In this sense, charge is conserved because it can't be created out of nothing and it can't disappear out of thin air. It can only leave the volume by crossing the surface, and it can only get inside the volume by crossing the surface.

• Thanks for the answer. Where is the $\textrm{d}^3 x$ coming from in $\int_{\mathcal{V}} \frac{\partial \rho}{\partial t} \ \textrm{d}^3 x = -\int_{\mathcal{V}} \mathbf{\nabla\cdot j} \ \textrm{d}^3 x$? Dec 15, 2021 at 9:35
• @ThePointer it is just notation for the volume element. Other people sometimes use $\textrm{d}V$ (similar to the other answer) or $\textrm{d}\tau$ (Griffiths). I just took the volume integral of both sides of the equation. Dec 15, 2021 at 17:20
• $d^3 r$ is more commonly used where there are alot of variables as it specifies that I need to integrate with respect to that variable, Dec 19, 2021 at 16:18
• @jensenpaull I've seen both notations being used in pretty much the same way. It is a matter of personal preference, pretty much in the same way as denoting the position where the field is being evaluated by $\mathbf{x}$ (Jackson's preference for the position vector) or by $\mathbf{r}$ (Griffiths' preference) Dec 19, 2021 at 18:49
• Notice that in both notations, $\textrm{d}^3 x$ and $\textrm{d}^3 r$, the variable being shown still "hides" information on what are the variables being integrated. Namely, both of them mean $\textrm{d}x \ \textrm{d}y \ \textrm{d}z$ (in Cartesian coordinates), or $r^2 \sin\theta \textrm{d}r \ \textrm{d}\theta \ \textrm{d}\phi$ (in spherical). Dec 19, 2021 at 21:48

The integral form of this equation can show this more easily

$$\iint J \cdot da =-d/dt \iiint \rho dv$$

The left integral is a flux integral of current density aka how much charge per second is leaving the volume.

(Q/m^3) (m/s) (m^2) = Q/s

The right integral also represents the amount of charge leaving the volume. But then differentiated with respect to time to show the RATE at which this happens.

Aka any flow of charge through the boundary of some closed surface equals the charge lost in that volume