I have a question regarding the derivative of the $f: X\rightarrow (X'X)^{-1}$ where $X$ is a $m\times n$ matrix.
Now the differential of $d(X^{-1})= -X^{-1}(dX)X^{-1}$. To get the derivative $D(X'X^{-1})$ , do I need to use the chain rule as it concerns the derivative of $f:$ $X\rightarrow$ $(X'X)^{-1}$ and not the derivative of $f: X\rightarrow X^{-1}$.
In general, I am confused about when to use the chain rule. Can anyone show me the calculations to get the derivative of the first mentioned function. Also an example of using the chain rule for matrix derivatives would be greatly appreciated.