Constant volume charge density (steady-state current)

I am studying the divergence of the current density and it is said that it is zero if the volume charge density is constant. Can anyone explain me why?

This is because of the charge conservation built into Maxwell's equations. It can be expressed as $$\begin{equation} \vec{\nabla}\cdot\vec{J}=-\frac{\partial \rho}{\partial t} \end{equation}$$ As $$\frac{\partial \rho}{\partial t}=0$$ (assuming $$\rho=$$constant), we get $$\vec{\nabla}\cdot\vec{J}=0$$. Physically this means that if charge density in a region is fixed, there can't be a net outflow of charge per unit area per unit time from that region of space (measured by the divergence of current density).

For the derivation of the above equation, refer to this link.

EDIT:

Examples:

1. Constant charge density ($$\vec{\nabla}\cdot\vec{J}=0$$, say $$\vec{J}=J_0\hat{x}$$):

Consider a cube of unit volume placed at the origin housing charge Q. The current enters the cube from the left side (x<0) and the same current exits the cube from the right side (x>0), it doesn't deposit any extra charge in the cube.

2. Variable charge density ($$\vec{\nabla}\cdot\vec{J}\neq 0$$, say $$\vec{J}=J_0x\hat{x}$$):

As $$\vec{\nabla}\cdot\vec{J}= J_0$$ (positive divergence assuming $$J_0>0$$), there is a net outflow of current from the given unit cube with initial charge $$Q(0)$$, that is, $$\rho(t)\sim\rho(0)-J_0t \implies Q(t)\sim Q(0)-J_0t$$ for the unit cube (using the charge conservation equation). Hence, the charge in the unit volume $$Q(t)$$ decreases with time.

• Yes but I want to know with two examples (steady-state current and not) why the charge density is constant or not.
– user248666
Aug 19 '20 at 11:25