Solution (source code)

= Solution

Use the <Einstein summation convention> and the <contraction of two Levi-Civita symbols>. For the first <cross product> term,
$$
\begin{aligned}
[F\times(\nabla\times G)]_i
&=\epsilon_{ijk}F_j\epsilon_{k\ell m}\partial_\ell G_m\\
&=(\delta_{i\ell}\delta_{jm}-\delta_{im}\delta_{j\ell})F_j\partial_\ell G_m\\
&=F_j\partial_iG_j-F_j\partial_jG_i.
\end{aligned}
$$
The last term cancels $(F\cdot\nabla)G_i$. Interchanging $F,G$ gives the analogous cancellation with $(G\cdot\nabla)F_i$. The surviving terms are $F_j\partial_iG_j+G_j\partial_iF_j=\partial_i(F_jG_j)$ by the <product rule>. This proves the <dot-product gradient identity>
$$
\boxed{\nabla(F\cdot G)=(F\cdot\nabla)G+(G\cdot\nabla)F+F\times(\nabla\times G)+G\times(\nabla\times F).}
$$
The proof only requires continuously differentiable <vector fields>; neither field needs to be an <irrotational vector field>.