TITLE: Divergence of matrix-vector product
QUESTION [8 upvotes]: Suppose that $A$ is a matrix field and that $v$ is a vector field. What is the divergence of the matrix-vector product $A \cdot v$, which is a vector field?

REPLY [4 votes]: Let us write the matrix-vector product ${\bf M}\cdot {\bf c}$ in index notation (Einstein convention). Using the product rule, the divergence of $({\bf M}\cdot {\bf c})_{i} = M_{ij} c_j$ satisfies
$$
\nabla\cdot({\bf M}\cdot {\bf c}) = M_{ij,i} c_j + M_{ij} c_{j,i} = {\bf c}\cdot\left(\nabla\cdot({\bf M}^\top)\right) + {\bf M}^\top\! : \nabla{\bf c}\, ,
$$
where ${\bf A}:{\bf B} = \text{tr}({\bf A}^\top\!\cdot{\bf B}) = \text{tr}({\bf A}\cdot{\bf B}^\top)$.
Similarly, one shows that the vector-matrix product $({\bf c}\cdot {\bf M})_{j} = c_i M_{ij}$ satisfies
$$
\nabla\cdot ({\bf c}\cdot{\bf M}) = c_{i,j} M_{ij} + c_i M_{ij,j} = {\bf c}\cdot(\nabla\cdot {\bf M}) + {\bf M} : \nabla{\bf c} \, .
$$