Solution (source code)

= Solution

This is <magnetic flux freezing> in <ideal magnetohydrodynamics>. In addition to the supplied <ideal magnetohydrodynamic induction equation>, a physical <magnetic field> obeys <Gauss's law for magnetism>, $\nabla\cdot\mathbf B=0$.

Parameterize the <material surface> by two particle labels $a,b$, so $d\mathbf S=(\partial_a\mathbf x\times\partial_b\mathbf x)\,da\,db$ and $D\mathbf x/Dt=\mathbf u$. Differentiating these tangents gives the <material surface element evolution> law
$$
\frac D{Dt}d\mathbf S=
\left[(\nabla\cdot\mathbf u)\mathsf I-(\nabla\mathbf u)^{\mathsf T}\right]d\mathbf S,
$$
where $(\nabla\mathbf u)_{ij}=\partial_j u_i$. Thus the <material magnetic-flux transport theorem> is
$$
\frac D{Dt}\int_{S(t)}\mathbf B\cdot d\mathbf S
=\int_{S(t)}\left[\frac{D\mathbf B}{Dt}
+\mathbf B(\nabla\cdot\mathbf u)-(\mathbf B\cdot\nabla)\mathbf u\right]\cdot d\mathbf S.
$$
Expand the <curl> in the <ideal magnetohydrodynamic induction equation>:
$$
\partial_t\mathbf B=(\mathbf B\cdot\nabla)\mathbf u-(\mathbf u\cdot\nabla)\mathbf B
-\mathbf B(\nabla\cdot\mathbf u)+\mathbf u(\nabla\cdot\mathbf B).
$$
Since $D/Dt=\partial_t+\mathbf u\cdot\nabla$ is the <material derivative>, the first three terms cancel the corresponding terms in the surface transport formula. The remaining integrand is $\mathbf u\,\nabla\cdot\mathbf B=0$. Therefore
$$
\boxed{\frac D{Dt}\int_{S(t)}\mathbf B\cdot d\mathbf S=0.}
$$
No <incompressible flow> assumption is needed: the changing <surface> area cancels the compression term. This proof assumes smooth <velocity> and <magnetic field> and a surface carried with the fluid; the <ideal magnetohydrodynamic induction equation> by itself, for an arbitrary non-solenoidal <vector field>, would leave the final divergence term.