TITLE: Chain rule for Hessian matrix
QUESTION [12 upvotes]: Given $f\colon \mathbb{R}^n\rightarrow \mathbb{R}$ smooth and $\phi \in GL(n)$. What is the Hessian matrix $H_{f\circ \phi} = \left(\frac{\partial ^2 (f\circ \phi)}{\partial x_i\partial x_j}\right)_{ij}$?

REPLY [11 votes]: Denote $H_g(x)$ the Hessian matrix of a function $g$. Denote $g=f\circ \phi$. By the chain rule, we have 
$$D(f\circ\phi)(x)\cdot h=D(f(\phi x))\cdot D\phi\cdot h=D(f(\phi x))\cdot \phi\cdot h$$
hence $D(g)(x)=D(f(\phi x))\cdot \phi$. In particular, 
$$\partial_j g(x)=\sum_{k=1}^n\partial_kf(\phi x)a_{kj},$$
where $a_{kj}$ is the $(k,j)$-th entry of $\phi$.We can do the same, for a fixed $k$, for the map $x\mapsto \partial_kf(\phi x)$. We get 
\begin{align}
\partial_{ij}f(\phi x)&=\sum_{k,l=1}^n(H_f(\phi x))_{lk}a_{li}a_{kj}\\
&=\sum_{k=1}^n(\phi^tH_f(\phi x))_{ik}a_{kj}\\
&=(\phi^tH_f(\phi x)\phi)_{ij}.
\end{align}