Put . The continuity equation and the expanded ideal magnetohydrodynamic induction equation are
so . Because , the induction equation permits the magnetic vector potential equation , with an arbitrary scalar electric potential carrying the gauge choice. Using yields
Contracting with and differentiating that factor gives
The last two terms cancel by exchanging their dummy indices. Thus the requested material derivative is
This is material transport of magnetic helicity density.
For a material volume, mass conservation gives . Apply this with , and use and the divergence theorem:
If the magnetic field lines do not penetrate the boundary, , so .
For uniqueness under a regular, single-valued gauge transformation ,
Consequently this magnetic helicity is both conserved and gauge independent. As usual, vector potentials are understood to be globally regular potentials for the same field, rather than unrelated harmonic-circulation choices on a multiply connected restricted domain.