Solution (source code)

= Solution

Choose a <magnetic vector potential> with $\mathbf B=\nabla\times\mathbf A$. The <resistive induction equation> permits the evolution equation
$$
\partial_t\mathbf A=\mathbf u\times\mathbf B-\eta_m\nabla\times\mathbf B-\nabla\phi.
$$
A <gauge transformation> changes $H=\int_V\mathbf A\cdot\mathbf B\,dV$ by a surface integral of the normal <magnetic field>, which is zero here. Thus the integrated <magnetic helicity> has <gauge invariance> under the stated boundary conditions.

Differentiate both factors in $H$. Use the stated vanishing-boundary assumption to remove the helicity surface flux; this can be implemented in the usual closed-boundary gauge $\mathbf n\times\mathbf A=0$, or by extending the localized field and integrating over all space with sufficient decay. The curl <integration by parts> identity then gives
$$
\dot H=\int_V\partial_t\mathbf A\cdot\mathbf B\,dV+\int_V\mathbf A\cdot\nabla\times\partial_t\mathbf A\,dV
=2\int_V\partial_t\mathbf A\cdot\mathbf B\,dV.
$$
The motional term is zero pointwise because $(\mathbf u\times\mathbf B)\cdot\mathbf B=0$. The scalar-potential term integrates to zero by $\nabla\cdot\mathbf B=0$ and the boundary condition. The <resistive magnetic-helicity balance> is therefore
$$
\boxed{\dot H=-\frac{2\eta}{\mu_0}\int_V\mathbf B\cdot(\nabla\times\mathbf B)\,dV.}
$$
Unlike the resistive <magnetic energy> contribution, this signed <integral> need not have a fixed sign.