Let $h(X)=\|\log(X)\|_{F}^2$ where $X\in\mathbb{S}_{++}^d$ is a $d$ by $d$ symmetric positive definite matrix, $\log$ is the matrix logarithm and $F$ stands for the common Frobenius norm. In section 6.3.2 of [1], the authors calculate the directional derivative of $h$ as follows (note that [1] has a different notation on norms): $$ D h(X)[Y] = 2\langle X^{-1}\log X, Y\rangle $$ where $Y$ is any symmetric matrix.
My question is that, how is this calculated? In particular, I know that $$ \frac{d}{d t} \log(X(t)) = X^{-1}(t) X'(t) $$ only when $X$ and $X'$ commute, and I'm not sure how to handle the general case.
[1] Bhatia, Rajendra. Positive definite matrices. Princeton university press, 2009.
$ \def\o{{\tt1}} \def\BR#1{\big[#1\big]} \def\LR#1{\left(#1\right)} \def\op#1{\operatorname{#1}} \def\f#1{f\LR{#1}} \def\ff#1{f'\!\LR{#1}} \def\trace#1{\op{Tr}\LR{#1}} \def\frob#1{\big\| #1 \big\|_F} \def\qiq{\quad\implies\quad} \def\p{\partial} \def\grad#1#2{\frac{\p #1}{\p #2}} \def\c#1{\color{red}{#1}} \def\X{X^{-1}} \def\L{\log(X)} \def\LL{\BR{\log(X)}^2} $The Frobenius product is very useful in Matrix Calculus. It has these properties $$\eqalign{ A:B &= \sum_{i=1}^m\sum_{j=1}^n A_{ij}B_{ij} \;=\; \trace{A^TB} \\ I:A &= \trace A \\ A:A &= \frob{A}^2 \qquad \{ {\rm Frobenius\;norm} \}\\ A:B &= B:A \;=\; B^T:A^T \\ \LR{AB}:C &= A:\LR{CB^T} \;=\; B:\LR{A^TC} \\ }$$ The Matrix Cookbook tells us (on page 12) how to differentiate the trace of a function applied to a matrix argument $$\eqalign{ \phi &= \trace{\f A} \;=\; I:\f A \\ d\phi &= \BR{\ff{A}}^T:dA,\quad\;\; \ff x \equiv \frac{df}{dx} \\ }$$ This follows from the $\sf Daleckii$-$\sf Krein$ Theorem. It can also be proved by differentiating the Taylor series. For example, here is the calculation for the cubic term $$\eqalign{ I:d\LR{A^3} &= I:\LR{\c{dA}\:AA + A\:\c{dA}\:A + AA\:\c{dA}} \\ &= \LR{A^2}^T:\c{dA} + \LR{A^2}^T:\c{dA} + \LR{A^2}^T:\c{dA} \\ &= \LR{3A^2}^T:\c{dA} \\ }$$
Write the current problem using the above notation to obtain $$\eqalign{ h &= \L:\L \;=\; I:\LL \\ dh &= 2\X\L:dX \\ \grad hX &= 2\X\L \\ }$$ where the symmetry of $X$ allows us to omit all the transposes.