I need to calculate $\frac{\partial f(X)}{\partial X}$ for $f(X)=tr \big[ C(X^\top BX)^{-1}\big]$. Where $\{X,B,C\}$ are matrices.
I tried to assume it as $g(U)=tr(CU^{-1})$ when $U=X^\top BX$, then using the chain rule $$\frac{\partial f(X)}{\partial X}=tr\Big(\frac{\partial g(U)}{\partial U}. \frac{\partial U}{\partial X_{ij}} \Big)$$.
I think the first part should be $\frac{\partial g(U)}{\partial U}=-U^{-1}CU^{-1}$, but i'm not sure about how to derive the 2nd part.