Solution (source code)

= Solution

Use the <Levi-Civita symbol> and the <contraction of two Levi-Civita symbols> in <Cartesian coordinates>. With repeated indices summed,
$$
\begin{aligned}
[\nabla\times(\mathbf A\times\mathbf B)]_i
&=\epsilon_{ijk}\epsilon_{klm}\partial_j(A_lB_m)\\
&=(\delta_{il}\delta_{jm}-\delta_{im}\delta_{jl})\partial_j(A_lB_m)\\
&=\partial_j(A_iB_j)-\partial_j(A_jB_i)\\
&=B_j\partial_jA_i+A_i\partial_jB_j-B_i\partial_jA_j-A_j\partial_jB_i.
\end{aligned}
$$
The last line is the <product rule>. Reading its four terms in vector notation proves the <curl of a cross product> identity:
$$
\boxed{\nabla\times(\mathbf A\times\mathbf B)=(\mathbf B\cdot\nabla)\mathbf A-\mathbf B(\nabla\cdot\mathbf A)-(\mathbf A\cdot\nabla)\mathbf B+\mathbf A(\nabla\cdot\mathbf B).}
$$