derivative of product matrix Let $$f(\alpha)= \alpha^{3} A(B+\alpha I)^{-3}C,$$
where A , B and C are square real matrices that do not depend on the scalar $\alpha$ and I is the identity matrix. I need help with computing the derivative of f with respect tot $\alpha$.
 A: For the majority of steps you can use the product rule. Do keep in mind that matrices in general do not commute, so don't alter their order (unless you multiply by a scalar like $\alpha$). Before doing this $f(\alpha)$ can be written into an equivalent form, to which it is easier to find the intermediate derivatives when applying the product rule
$$
f(\alpha) = \alpha^{3} A\,(B + \alpha\,I)^{-1} (B + \alpha\,I)^{-1} (B + \alpha\,I)^{-1} C. \tag{1}
$$
Therefore, the derivative of $(1)$ with respect to $\alpha$ can be expressed as
$$
\frac{d\,f(\alpha)}{d\alpha} = A \left(3\,\alpha^{2}(B + \alpha\,I)^{-3} + \alpha^{3} \frac{d\,(B + \alpha\,I)^{-1} (B + \alpha\,I)^{-1} (B + \alpha\,I)^{-1}}{d\alpha} \right) C, \tag{2}
$$
with
$$
\frac{d\,(B + \alpha\,I)^{-1} (B + \alpha\,I)^{-1} (B + \alpha\,I)^{-1}}{d\alpha} = \frac{d\,(B + \alpha\,I)^{-1}}{d\alpha} (B + \alpha\,I)^{-2} + (B + \alpha\,I)^{-1} \frac{d\,(B + \alpha\,I)^{-1}}{d\alpha} (B + \alpha\,I)^{-1} + (B + \alpha\,I)^{-2} \frac{d\,(B + \alpha\,I)^{-1}}{d\alpha}. \tag{3}
$$
In general the derivative of an expression of the form $(X+\alpha\,Y)^{-1}$ with respect to $\alpha$ can be obtained by applying the product rule to $(X+\alpha\,Y)^{-1} (X+\alpha\,Y) = I$, resulting in
$$
\frac{d\,(X+\alpha\,Y)^{-1} (X+\alpha\,Y)}{d\alpha} = \frac{d\,(X+\alpha\,Y)^{-1}}{d\alpha} (X+\alpha\,Y) + (X+\alpha\,Y)^{-1} \frac{d\,(X+\alpha\,Y)}{d\alpha} = 0, \tag{4}
$$
where it is hopefully clear that the derivative of $X+\alpha\,Y$ with respect to $\alpha$ should equal $Y$. Therefore, solving $(4)$ for the derivative of $(X+\alpha\,Y)^{-1}$ with respect to $\alpha$ yields
$$
\frac{d\,(X + \alpha\,Y)^{-1}}{d\alpha} = -(X+\alpha\,Y)^{-1} Y\,(X+\alpha\,Y)^{-1}. \tag{5}
$$
When using $(5)$ for the derivative of $(B + \alpha\,I)^{-1}$ with respect to $\alpha$ yields
$$
\frac{d\,(B + \alpha\,I)^{-1}}{d\alpha} = -(B + \alpha\,I)^{-1} I\,(B + \alpha\,I)^{-1} = -(B + \alpha\,I)^{-2}. \tag{6}
$$
In this case the matrix $Y$ from $(5)$ is the identity matrix, which always commutes. However, if $Y$ would have been a different matrix it would not simplify as neatly. Substituting $(6)$ in $(3)$ therefore gives
$$
\frac{d\,(B + \alpha\,I)^{-1} (B + \alpha\,I)^{-1} (B + \alpha\,I)^{-1}}{d\alpha} = -3\,(B + \alpha\,I)^{-4}. \tag{7}
$$
Lastly, substituting $(7)$ in $(2)$ yields
$$
\frac{d\,f(\alpha)}{d\alpha} = 3\,A \left(\alpha^{2}(B + \alpha\,I)^{-3} - \alpha^{3} (B + \alpha\,I)^{-4} \right) C. \tag{8}
$$
A: For typing convenience, define the matrices
$$\eqalign{
X &= B+\alpha I \quad&\implies\quad dX &= I\,d\alpha \\
Y &= X^3 \quad&\implies\quad dY &= (dX\,X^2 + X\,dX\,X + X^2dX) &= 3X^2d\alpha \\
X^{-1} &= X^2Y^{-1} \\
Y^{-1} &= X^{-3} \\
}$$
Write the function in terms of these matrices, then calculate its differential and derivative.
$$\eqalign{
 F &= \alpha^{3} AY^{-1}C \\
dF &= d\alpha^{3} AY^{-1}C + \alpha^3A\,dY^{-1}C \\
   &= \left(3\alpha^{2}d\alpha\right)AY^{-1}C
    - \alpha^3A\left(Y^{-1}dY\,Y^{-1}\right)C \\
   &= 3\alpha^{2} AY^{-1}C\,d\alpha - 3\alpha^{3} AY^{-1}X^2Y^{-1}C\,d\alpha \\
   &= 3\alpha^{2}AY^{-1}\left(I - \alpha X^{-1}\right)C\,d\alpha \\
   &= 3\alpha^{2}AX^{-3}\left(I - \alpha X^{-1}\right)C\,d\alpha \\
\frac{dF}{d\alpha}
   &= 3\alpha^{2}A\left(X^{-3} - \alpha X^{-4}\right)C \\\\
}$$

NB: $\,$ This well-known result from Matrix Calculus was used above
$$\eqalign{
&Y^{-1}Y = I \\
&dY^{-1}Y + Y^{-1}dY = 0 \\
&dY^{-1} = -\left(Y^{-1}dY\,Y^{-1}\right) \\
}$$
