# Vector calculus identity with trace and function composition

Let $u: \mathbb{R}^{n} \rightarrow \mathbb{R}$ and $f: \mathbb{R}^{n} \rightarrow \mathbb{R}^{n}$. View $f$ as a column vector, $\nabla u$ as a row vector. Why does $$\nabla \cdot \nabla u(f(x)) = \nabla u \cdot \Delta f + \operatorname{tr}((\nabla f)^{t}D^{2}u\nabla f)$$ where $D^{2}u$ is the Jacobian of $u$?

• Did you try anything? What didn't work for you? If you don't share the results of your efforts, then we can't help you. Feb 6, 2014 at 23:43
• I've verified it for $n = 3$, but it was by writing $f = (f_{1}, f_{2}, f_{3})^{t}$ and $x = (x_{1}, x_{2}, x_{3})$. The whole process was fairly tedious, and the process would work for general $n$, however, I was wondering if there was a coordinate free method. Feb 7, 2014 at 0:28

Let n=3 and expand the two sides of the equality by the definitions of Laplace and gradient operators. This will help you understand the process and finally you could plug in n.

We will use Einsteinian notation (it's useful in vector calculus!): we sum with respect the repeating indexes, i.e. instead of writing $\sum_{j=1}^3a_jb_j$ we can write simply $a_jb_j$. Another useful notation: ,j in the subscript means derivative with respect to $j$-th cordinate. In other words, $f_{k,j}$ stands for $\frac{\partial f_k}{\partial x_j}$. As usual, $\vec e_j$ are standard basis vectors. Armed with this, on with the show!

$$\nabla u(f(x)) = u_{,k}f_{k,j}\vec e_j$$ $$\nabla \cdot\nabla u(f(x)) =\nabla\cdot( u_{,k}f_{k,j}\vec e_j) = ( u_{,k}f_{k,j})_{,j} = u_{,ks}f_{s,j}f_{k,j} + u_{,k}f_{k,jj}.$$

The last term is, in fact, $\nabla u\cdot \Delta f$, because

$$\nabla u\cdot \Delta f = (u_{,k}\vec e_k)\cdot(f_{l,jj}\vec e_l) = u_{,k}f_{k,jj}.$$

The first term requires a little bit of tinkering.

$$D^2 u = u_{,ks}\vec e_k \otimes \vec e_s,$$ $$\nabla f = f_{l,m}\vec e_l \otimes \vec e_m,$$ $$\nabla f ^t= f_{p,q}\vec e_q \otimes \vec e_p,$$ therefore

$$(\nabla f)^{t}D^{2}u\nabla f = ( f_{p,q}\vec e_q \otimes \vec e_p)(u_{,ks}\vec e_k \otimes \vec e_s)(f_{l,m}\vec e_l \otimes \vec e_m )$$$$=( f_{k,q} u_{,ks}\vec e_q \otimes \vec e_s)(f_{l,m}\vec e_l \otimes \vec e_m )$$ $$= f_{k,q} u_{,ks} f_{s,m}\vec e_q\otimes \vec e_m .$$ Now, the trace of this matrix is equal to $$tr (f_{k,q} u_{,ks} f_{s,m}\vec e_q\otimes \vec e_m) = u_{,ks} f_{k,m} f_{s,m} ,$$which, up to a change of summation variables, coincides with the first term.