Calculation of $ga:\triangledown^2 f$ I am reading a online note about the adjoint operator. One of the example uses multivariate calculus computation involving the gradient operator $\triangledown$. The equation on the note is
\begin{equation}
ga:\triangledown^2f = \triangledown\cdot (ga\cdot \triangledown f) - \triangledown\cdot(f\triangledown\cdot(ga)) + f\triangledown\cdot\triangledown\cdot(ga)
\end{equation}
In the above equation, $f$ and $g$ are $\mathbb{R}_n$ to $\mathbb{R}$ function. $a$ is a matrix value function, which has domain $\mathbb{R}_n$ and takes value in $\mathbb{R}_{n\times n}$.
I do know how to verify the above equation by writing out entries in each term with taking derivatives and doing the matrix multiplication, which I think is really tedious. So my question is: is there any arithmetic rule that I could follow, so that I could calculate the above equation in a straightforward way?
Hope my question is clear and thanks in advance!
 A: To simplify notation let $A=ga$ a function from $\mathbb{R}_{n}\to\mathbb{R}_{n\times n}$
$$
A:\nabla^2 f=\sum_{ij}A_{ij}\partial_i\partial_j f\\
$$
We have the classic Leibniz rule.
$$
\sum_{ij}\partial_i(A_{ij}\partial_j f)=\sum_{ij}A_{ij}\partial_i\partial_j f+\sum_{ij}(\partial_i A_{ij})(\partial_j f)\\
$$
$$
\sum_{ij}\partial_j (f(\partial_i A_{ij}))=\sum_{ij}(\partial_j f)(\partial_i A_{ij})+\sum_{ij}f(\partial_j \partial_i A_{ij})
$$
Then you could stick the two equations together
$$
\sum_{ij}A_{ij}\partial_i\partial_j f=\sum_{ij}\partial_i(A_{ij}\partial_j f)-\sum_{ij}(\partial_i A_{ij})(\partial_j f)\\
=\sum_{ij}\partial_i(A_{ij}\partial_j f)-\sum_{ij}\partial_j (f(\partial_i A_{ij}))+\sum_{ij}f(\partial_j \partial_i A_{ij})
$$
If you like we can rewrite it in the vector form
$$
A:\nabla^2f=\nabla\cdot (A\nabla f）-\nabla\cdot(f\nabla\cdot A) +f\nabla\cdot\nabla\cdot A
$$

Personally I think the $\cdot$ symbol is really confusing and sometimes ambiguous in multi dimensional calculus, stick with subscripts / contraction can keep things clear.
