Solution (source code)

= Solution

The <divergence theorem> states that, for a continuously differentiable <vector field> $\mathbf H$ on a bounded region $V$ with piecewise smooth boundary $S$ and outward <unit normal> $\hat{\mathbf n}$,
$$
\int_V\nabla\cdot\mathbf H\,dV=\int_S\mathbf H\cdot\hat{\mathbf n}\,dS.
$$
To apply it, first derive the <divergence of a cross product> using the <Levi-Civita symbol> and the <product rule>:
$$
\begin{aligned}
\nabla\cdot(\mathbf F\times\mathbf G)
&=\epsilon_{ijk}\partial_i(F_jG_k)\\
&=\epsilon_{ijk}(\partial_iF_j)G_k+\epsilon_{ijk}F_j\partial_iG_k\\
&=\mathbf G\cdot(\nabla\times\mathbf F)-\mathbf F\cdot(\nabla\times\mathbf G).
\end{aligned}
$$
In the second term the minus sign comes from interchanging the first two indices of the <Levi-Civita symbol>. The <divergence theorem> with $\mathbf H=\mathbf F\times\mathbf G$ now yields
$$
\boxed{\int_V[\mathbf G\cdot(\nabla\times\mathbf F)-\mathbf F\cdot(\nabla\times\mathbf G)]\,dV=\int_S(\mathbf F\times\mathbf G)\cdot\hat{\mathbf n}\,dS.}
$$