11

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?

shuhalo
  • 7,485

3 Answers3

12

I agree with Tommaso Seneci. This question deserves a better answer. Yes, it is just vector calculus, but there are some non-trivial tricks that deserve to be noted.

Inspired by this note by Piaras Kelly, I can write down that $$ \nabla \cdot (\mathbf{A}\mathbf{v}) = (\nabla \cdot \mathbf{A}) \mathbf{v} + \text{tr}(\mathbf{A}\text{grad}\mathbf{v}) $$ where $$ \text{grad}\mathbf{v} = \begin{pmatrix} \frac{\partial v_1}{\partial x_1} & \frac{\partial v_1}{\partial x_2} & \frac{\partial v_1}{\partial x_3} \\ \frac{\partial v_2}{\partial x_1} & \frac{\partial v_2}{\partial x_2} & \frac{\partial v_2}{\partial x_3} \\ \frac{\partial v_3}{\partial x_1} & \frac{\partial v_3}{\partial x_2} & \frac{\partial v_3}{\partial x_3} \\ \end{pmatrix} $$ and $$ \nabla \cdot \mathbf{A} = [\frac{\partial}{\partial x_1} \quad \frac{\partial}{\partial x_2} \quad \frac{\partial}{\partial x_3}] \mathbf{A} = \begin{pmatrix} \frac{\partial A_{11}}{\partial x_1}+\frac{\partial A_{21}}{\partial x_2}+\frac{\partial A_{31}}{\partial x_3} \\ \frac{\partial A_{12}}{\partial x_1}+\frac{\partial A_{22}}{\partial x_2}+\frac{\partial A_{32}}{\partial x_3} \\ \frac{\partial A_{13}}{\partial x_1}+\frac{\partial A_{23}}{\partial x_2}+\frac{\partial A_{33}}{\partial x_3} \\ \end{pmatrix}^T . $$

The trick to do this calculation is this formula $$ \nabla \cdot \mathbf{v} = \text{tr}(\text{grad}\mathbf{v}). $$

First compute $\text{grad}(\mathbf{A}\mathbf{v})$ by product rule: $$ \text{grad}(\mathbf{A}\mathbf{v}) = [(\frac{\partial}{\partial x_1} \mathbf{A})\mathbf{v} \quad (\frac{\partial}{\partial x_2} \mathbf{A})\mathbf{v} \quad (\frac{\partial}{\partial x_3} \mathbf{A})\mathbf{v}] + \mathbf{A} \text{grad}(\mathbf{v}) $$ Then take trace of the two terms. The trace of first term, by carefully simplifying, becomes $(\nabla \cdot \mathbf{A})\mathbf{v}$.

Please correct me if there is any mistake in the calculation.

Po C.
  • 279
4

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} \, . $$

EditPiAf
  • 20,898
0

Hint:

As the divergence is simply the sum of $n$ partial derivatives, I will show you how to deal with these derivatives.

If you have a matrix valued function $A$ and a vector valued function $\def\b{\mathbf}\b v$, then their product can be differentiated in the following way:

\begin{align} \def\d{\partial} \def\dt{\d t} \def\div{\frac\d\dt} \def\divp#1{\frac{\d #1}\dt} \div A(t)\b v(t) &=\div\sum_{i,j}\b e_iA_{ij}(t)v_j(t)\\ &=\sum_{i,j}\b e_i\left[v_j(t)\divp{A_{ij}(t)}+A_{ij}(t)\divp{v_j(t)}\right]\\ &=\sum_{i,j}\b e_i v_j \divp{A_{ij}(t)}+\sum_{i,j}\b e_i A_{ij}(t)\divp{v_j(t)}\\ &=\divp{A(t)}\b v(t)+A(t)\divp{\b v(t)} . \end{align}

You see it works like the usual product rule. I hope this helps you to find the final formula for the divergence.

M. Winter
  • 29,928
  • 6
    This is not the divergence, this is just an ordinary derivation, he's asking for something like $A:\mathbb{R}^n \to \mathbb{R}^{n\times n}$, $u:\mathbb{R}^n \to \mathbb{R}^n$, compute $\nabla \cdot (Ax)$. – Tommaso Seneci Jan 29 '18 at 19:03
  • @TommasoSeneci I know, and this is not intended to be a complete solution but (as you can see) a hint on how to start with derivatives involving matrix vector products. OP put few work in his question, so this should make him investigate some thoughts into the problem himself. If you think he deserves a better answer, then feel free to add one. Also feel free to remove the downvote if you understand the motivation behind this educational approach. – M. Winter Jan 29 '18 at 19:15
  • @TommasoSeneci Think about it: my answer contains everything which is necessary to compute the divergence. The difference is that for the divergence you simply compute above derivative $n$ times: one partial derivative for each dimension. What else I need to add without (maybe) doing OPs homework? – M. Winter Jan 29 '18 at 19:28
  • I will remove my downvote, but yet you should give and exhaustive answer. – Tommaso Seneci Jan 30 '18 at 07:18
  • 1
    @TommasoSeneci I hopefully made the idea behind the hint a bit clearer in the answer. However, for a question that should have been closed with "missing context", this is as good as it can/should get (in my opinion). – M. Winter Jan 30 '18 at 08:42
  • 1
    Dear @M. Winter, please remind that without the proofs sometimes geniously carried out and gently shared by others before of us, we could at best manage to reach the most elementary operations – Giorgio Pastasciutta Jan 27 '20 at 15:42