I am interested in the matrix fractional function (from $GL_n(\mathbb{R})$ to $\mathbb{R}$) : $S \mapsto x^\top S^{-1} x$, where $x \in \mathbb{R}^n$ is fixed.
By computing $f(S + E) - f(S)$ for a small $E$ I am able to show that its gradient at $S$ is $-S^{-1} x x^\top S^{-1}$, but I am stuck when it comes to computing its Hessian (which is a fourth order tensor). Any hint ?
EDIT: Pushing the Taylor expansion leads me to: \begin{align}x^\top(S + E)^{-1} x - x^\top S ^{-1} x &= x^\top(Id + S^{-1} E)^{-1} S^{-1} x -x^\top S^{-1} x \\&= x^\top(Id - S^{-1} E + S^{-1} E S^{-1}E) S^{-1} x -x^\top S^{-1} x +o(||E||^2) \\&= -x^\top S^{-1} E S^{-1} x + x^\top S^{-1} ES^{-1} E S^{-1} x \end{align}
and $-x^\top S^{-1} E S^{-1} x = - tr _,x^\top S^{-1} E S^{-1} x = - tr \, S^{-1} x x^\top S^{-1} E$ which gives me the gradient, and the expression of the second order term, but not the Hessian.