Divergence of a tensor product I am working on deriving the Navier-Stokes equation in spherical coordinates for a homework assignment, but I've hit a serious math roadblock. My background in tensors is very minimal and a crucial term in the Navier-Stokes equation involves the divergence of a tensor product,
\begin{equation*}
\nabla \cdot \big(\rho \vec{v}\,\otimes\,\vec{v}\big).
\end{equation*}
I saw on Wikipedia that,
\begin{equation*}
\nabla\cdot\big(\vec{B}\,\otimes\,\hat{A}\big) = \hat{A}\big(\nabla\cdot\vec{B}\big) + \big(\vec{B}\cdot\nabla\big)\hat{A}.
\end{equation*}
I am honestly not sure what $\hat{A}$ means, but I assume it's just another notation for $\vec{A}$. If so, this places me in a predicament because I now have to compute the gradient of a vector, $\nabla\vec{A}$, which I don't know how to do and cannot find any online resources describing how to do this in a way I can understand.
It would help me tremendously to have some kind of example of a tensor product and/or divergence of a tensor product that uses simple cartesian coordinates $x$, $y$, and $z$. I am confident that I can produce the equivalent in spherical coordinates, but as of now I am mathematically (not physically) stumped. Please help!
 A: The equation, 
$$
\nabla\cdot (\rho \textbf v \otimes \textbf v),
$$ 
can be written in index notation as, 
$$ 
\partial_i (\rho v_i v_j),
$$ 
where the dot product becomes an inner product, summing over two indices, 
$$
\textbf a \cdot \textbf b = a_i b_i, 
$$ 
and the tensor product yields an object with two indices, making it a matrix, 
$$
\textbf c \otimes \textbf d = c_i d_j =: M_{ij}.
$$
Now we differentiate using the product rule, 
$$
\partial_i (\rho v_i v_j)=(\partial_i \rho) v_i v_j + \rho (\partial_i v_i) v_j + \rho v_i (\partial_i v_j).
$$
Let’s look at the terms separately:
$\bullet (\partial_i \rho) v_i v_j $: assuming $\rho=\rho(\textbf x)$, the expression within the brackets is the vector $(\partial_x\rho, \partial_y\rho, \partial_z\rho)$, which then gets dot multiplied with the vector $\textbf v$. This yields a number, say $c_1$, which gets multiplied to every component of the vector $v_j$. So the result here is a vector. If $\rho$ is constant, this term vanishes. 
$\bullet\rho (\partial_i v_i) v_j$: Here we calculate the divergence of $\textbf v$, 
$$
\partial_i a_i = \nabla \cdot \textbf a = \text{div }\textbf a,
$$
and multiply this number with $\rho$, yielding another number, say $c_2$. This gets multiplied onto every component of $v_j$. The resulting thing here is again a vector. 
$\bullet\rho v_i (\partial_i v_j)$: Here we construct a matrix with the composition rule,
$$ M_{ij} := \partial_i v_j,
$$
that is for example $M_{13}=\partial_x v_z$. We then multiply a (row)vector $v_i$ to this matrix, yielding a different vector. Finally, every component of this new vector gets multiplied by $\rho$, so we have a vector again. 
A: $\mathbf{v} \cdot \mathbf{u} = \mathbf{v}^{T} \mathbf{u}$ = scalar.
$\mathbf{v} \otimes \mathbf{u} = \mathbf{v} \mathbf{u}^T$ = matrix.
So if $$\mathbf{v} = \left(
\begin{array}{c}
v_x\\
v_y\\
v_z
\end{array}
\right), $$
$$\mathbf{v} \cdot \mathbf{v} = (v_x \,v_y \, v_z) \times \left(
\begin{array}{c}
v_x\\
v_y\\
v_z
\end{array}
\right) = v_x^2 + v_y^2 + v_z^2,$$
$$\mathbf{v} \otimes \mathbf{v} = \left(
\begin{array}{c}
v_x\\
v_y\\
v_z
\end{array}
\right) \times (v_x \,v_y \, v_z) = \left (\begin{array}{c c c}
v_x^2  & v_xv_y & v_xv_z \\
v_y v_x & v_y^2 & v_y v_z\\
v_z v_x & v_z v_y & v_z^2
\end{array}
\right). $$
Now, the gradient operator $\nabla$ is just a vector:
$$\nabla = \left(
\begin{array}{c}
\frac{\partial}{\partial x}\\
\frac{\partial}{\partial y}\\
\frac{\partial}{\partial z}
\end{array}
\right),$$
so
$$ \nabla(\rho \mathbf{v} \otimes \mathbf{v}) = \rho \nabla^T(\mathbf{v} \otimes \mathbf{v}) = \rho \left (\frac{\partial}{\partial x} \, \frac{\partial}{\partial y} \, \frac{\partial}{\partial z} \right) \cdot \left (\begin{array}{c c c}
v_x^2  & v_xv_y & v_xv_z \\
v_y v_x & v_y^2 & v_y v_z\\
v_z v_x & v_z v_y & v_z^2
\end{array}
\right) ,$$
which gives you a vector.
Here I assumed $\rho$ is constant, but it can be easily generalised to the case of it being a function $x, y$ and $z$.
-
The identity you provided can be proved via index notation, let us know whether you need help with that.
