Definition

Let $\R^3 \left({x, y, z}\right)$ denote the real Cartesian space of $3$ dimensions..

Let $\left({\mathbf i, \mathbf j, \mathbf k}\right)$ be the standard ordered basis on $\R^3$.

Let $\mathbf f$ and $\mathbf g: \R^3 \to \R^3$ be vector-valued functions on $\R^3$:

$\mathbf f := \left({f_x \left({\mathbf x}\right), f_y \left({\mathbf x}\right), f_z \left({\mathbf x}\right)}\right)$
$\mathbf g := \left({g_x \left({\mathbf x}\right), g_y \left({\mathbf x}\right), g_z \left({\mathbf x}\right)}\right)$

Let $\nabla \mathbf f$ denote the gradient of $f$.

Then:

$\nabla \left({\mathbf f \cdot \mathbf g}\right) = \left({\mathbf g \cdot \nabla}\right) \mathbf f + \left({\mathbf f \cdot \nabla}\right) \mathbf g + \mathbf g \times \left({\nabla \times \mathbf f}\right) + \mathbf f \times \left({\nabla \times \mathbf g}\right)$

where:

$\mathbf f \times \mathbf g$ denotes vector cross product
$\mathbf f \cdot \mathbf g$ denotes dot product

Proof

 $\displaystyle \nabla \left({\mathbf f \cdot \mathbf g}\right)$ $=$ $\displaystyle \nabla \left({f_x g_x + f_y g_y + f_z g_z}\right)$ Definition 1 of Dot Product $\displaystyle$ $=$ $\displaystyle \dfrac {\partial \left({f_x g_x + f_y g_y + f_z g_z}\right)} {\partial x} \mathbf i + \dfrac {\partial \left({f_x g_x + f_y g_y + f_z g_z}\right)} {\partial y} \mathbf j + \dfrac {\partial \left({f_x g_x + f_y g_y + f_z g_z}\right)} {\partial z} \mathbf k$ Definition of Gradient Operator $\displaystyle$ $=$ $\displaystyle \left({f_x \dfrac {\partial g_x} {\partial x} + \dfrac {\partial f_x} {\partial x} g_x + f_y \dfrac {\partial g_y} {\partial x} + \dfrac {\partial f_y} {\partial x} g_y + f_z \dfrac {\partial g_z} {\partial x} + \dfrac {\partial f_z} {\partial x} g_z}\right) \mathbf i$ Product Rule for Derivatives $\displaystyle$  $\, \displaystyle + \,$ $\displaystyle \left({f_x \dfrac {\partial g_x} {\partial y} + \dfrac {\partial f_x} {\partial y} g_x + f_y \dfrac {\partial g_y} {\partial y} + \dfrac {\partial f_y} {\partial y} g_y + f_z \dfrac {\partial g_z} {\partial y} + \dfrac {\partial f_z} {\partial y} g_z}\right) \mathbf j$ $\displaystyle$  $\, \displaystyle + \,$ $\displaystyle \left({f_x \dfrac {\partial g_x} {\partial z} + \dfrac {\partial f_x} {\partial z} g_x + f_y \dfrac {\partial g_y} {\partial z} + \dfrac {\partial f_y} {\partial z} g_y + f_z \dfrac {\partial g_z} {\partial z} + \dfrac {\partial f_z} {\partial z} g_z}\right) \mathbf k$

Then:

 $\displaystyle \mathbf g \times \left({\nabla \times \mathbf f}\right)$ $=$ $\displaystyle \mathbf g \times \left({\left({\dfrac {\partial f_z} {\partial y} - \dfrac {\partial f_y} {\partial z} }\right) \mathbf i + \left({\dfrac {\partial f_x} {\partial z} - \dfrac {\partial f_z} {\partial x} }\right) \mathbf j + \left({\dfrac {\partial f_y} {\partial x} - \dfrac {\partial f_x} {\partial y} }\right) \mathbf k}\right)$ Definition of Curl Operator $\displaystyle$ $=$ $\displaystyle \left({g_y \left({\dfrac {\partial f_y} {\partial x} - \dfrac {\partial f_x} {\partial y} }\right) - g_z \left({\dfrac {\partial f_x} {\partial z} - \dfrac {\partial f_z} {\partial x} }\right)}\right) \mathbf i$ Definition 1 of Vector Cross Product $\displaystyle$  $\, \displaystyle + \,$ $\displaystyle \left({g_z \left({\dfrac {\partial f_z} {\partial y} - \dfrac {\partial f_y} {\partial z} }\right) - g_x \left({\dfrac {\partial f_y} {\partial x} - \dfrac {\partial f_x} {\partial y} }\right)}\right) \mathbf j$ $\displaystyle$  $\, \displaystyle + \,$ $\displaystyle \left({g_x \left({\dfrac {\partial f_x} {\partial z} - \dfrac {\partial f_z} {\partial x} }\right) - g_y \left({\dfrac {\partial f_z} {\partial y} - \dfrac {\partial f_y} {\partial z} }\right)}\right) \mathbf k$ $\displaystyle$ $=$ $\displaystyle \left({g_y \dfrac {\partial f_y} {\partial x} - g_y \dfrac {\partial f_x} {\partial y} - g_z \dfrac {\partial f_x} {\partial z} + g_z \dfrac {\partial f_z} {\partial x} }\right) \mathbf i$ expanding $\displaystyle$  $\, \displaystyle + \,$ $\displaystyle \left({g_z \dfrac {\partial f_z} {\partial y} - g_z \dfrac {\partial f_y} {\partial z} - g_x \dfrac {\partial f_y} {\partial x} + g_x \dfrac {\partial f_x} {\partial y} }\right) \mathbf j$ $\displaystyle$  $\, \displaystyle + \,$ $\displaystyle \left({g_x \dfrac {\partial f_x} {\partial z} - g_x \dfrac {\partial f_z} {\partial x} - g_y \dfrac {\partial f_z} {\partial y} + g_y \dfrac {\partial f_y} {\partial z} }\right) \mathbf k$

and similarly:

 $\displaystyle \mathbf f \times \left({\nabla \times \mathbf g}\right)$ $=$ $\displaystyle \mathbf f \times \left({\left({\dfrac {\partial g_z} {\partial y} - \dfrac {\partial g_y} {\partial z} }\right) \mathbf i + \left({\dfrac {\partial g_x} {\partial z} - \dfrac {\partial g_z} {\partial x} }\right) \mathbf j + \left({\dfrac {\partial g_y} {\partial x} - \dfrac {\partial g_x} {\partial y} }\right) \mathbf k}\right)$ Definition of Curl Operator $\displaystyle$ $=$ $\displaystyle \left({f_y \left({\dfrac {\partial g_y} {\partial x} - \dfrac {\partial g_x} {\partial y} }\right) - f_z \left({\dfrac {\partial g_x} {\partial z} - \dfrac {\partial g_z} {\partial x} }\right)}\right) \mathbf i$ Definition 1 of Vector Cross Product $\displaystyle$  $\, \displaystyle + \,$ $\displaystyle \left({f_z \left({\dfrac {\partial g_z} {\partial y} - \dfrac {\partial g_y} {\partial z} }\right) - f_x \left({\dfrac {\partial g_y} {\partial x} - \dfrac {\partial g_x} {\partial y} }\right)}\right) \mathbf j$ $\displaystyle$  $\, \displaystyle + \,$ $\displaystyle \left({f_x \left({\dfrac {\partial g_x} {\partial z} - \dfrac {\partial g_z} {\partial x} }\right) - f_y \left({\dfrac {\partial g_z} {\partial y} - \dfrac {\partial g_y} {\partial z} }\right)}\right) \mathbf k$ $\displaystyle$ $=$ $\displaystyle \left({f_y \dfrac {\partial g_y} {\partial x} - f_y \dfrac {\partial g_x} {\partial y} - f_z \dfrac {\partial g_x} {\partial z} + f_z \dfrac {\partial g_z} {\partial x} }\right) \mathbf i$ expanding $\displaystyle$  $\, \displaystyle + \,$ $\displaystyle \left({f_z \dfrac {\partial g_z} {\partial y} - f_z \dfrac {\partial g_y} {\partial z} - f_x \dfrac {\partial g_y} {\partial x} + f_x \dfrac {\partial g_x} {\partial y} }\right) \mathbf j$ $\displaystyle$  $\, \displaystyle + \,$ $\displaystyle \left({f_x \dfrac {\partial g_x} {\partial z} - f_x \dfrac {\partial g_z} {\partial x} - f_y \dfrac {\partial g_z} {\partial y} + f_y \dfrac {\partial g_y} {\partial z} }\right) \mathbf k$

Next:

 $\displaystyle \left({\mathbf g \cdot \nabla}\right) \mathbf f$ $=$ $\displaystyle \left({g_x \dfrac \partial {\partial x} + g_y \dfrac \partial {\partial y} + g_z \dfrac \partial {\partial z} }\right) \mathbf f$ Definition of Del Operator, Definition of Dot Product $\displaystyle$ $=$ $\displaystyle g_x \dfrac {\partial f_x} {\partial x} \mathbf i + g_y \dfrac {\partial f_y} {\partial y} \mathbf j + g_z \dfrac {\partial f_z} {\partial z} \mathbf k$ Definition of Gradient Operator

and:

 $\displaystyle \left({\mathbf f \cdot \nabla}\right) \mathbf g$ $=$ $\displaystyle \left({f_x \dfrac \partial {\partial x} + f_y \dfrac \partial {\partial y} + f_z \dfrac \partial {\partial z} }\right) \mathbf g$ Definition of Del Operator, Definition of Dot Product $\displaystyle$ $=$ $\displaystyle f_x \dfrac {\partial g_x} {\partial x} \mathbf i + f_y \dfrac {\partial g_y} {\partial y} \mathbf j + f_z \dfrac {\partial g_z} {\partial z} \mathbf k$ Definition of Gradient Operator