I have a simple question that confuses me for a while:
$$f(X) = \text{tr} \left( [ \log(X) ]^2 \right)$$
where $X$ is an $m \times m$ symmetric positive definite (SPD) matrix and $\log(X)$ is the matrix logarithm of matrix $X$. What is $\frac{\partial f}{\partial X}$?
Using the chain rule, I have
$df = \text{tr}(2ZdZ)$,
where $Z=\log (X)$. I think we should have $dZ = X^{-1}dX$ as a scalor function, so we will have
$\frac{\partial f}{\partial X} = 2\log(X)X^{-1}$,
but I haven't found any related reference.
Any comment or hint will be appreciated!
Careful: most of the standard calculus formulas for differentiation require things to commute. Matrices don't. So $d(Z^2)$ is not $2 Z \; dZ$, it's $Z \; dZ + (dZ)\; Z$. And I don't think there is a closed-form formula for $d(\log Z)$.
However, if $X$ is symmetric, we can assume wlog that it is diagonal. Then you can easily compute $f(X + dX)$ for $dX$ with a single matrix element.