Solution (source code)

= Solution

<Maxwell equations> are
$$
\nabla\cdot E=\rho/\varepsilon_0,\quad \nabla\cdot B=0,
\quad\nabla\times E=-\partial_tB,
\quad\nabla\times B=\mu_0J+\mu_0\varepsilon_0\partial_tE.
$$
Taking the divergence of the <Ampère-Maxwell equation> and using <Gauss's law> gives
$$
\partial_t\rho+\nabla\cdot J=0.
$$
Therefore
$$
\dot Q=-\int_{\partial D}J\cdot n\,dS=0
$$
because $J$ vanishes on the boundary. Componentwise integration by parts also gives
$$
\frac d{dt}\int_Dx\rho\,d^3x=-\int_Dx\nabla\cdot J\,d^3x=\int_DJ\,d^3x,
$$
with the boundary term again zero.