# Proof for $df(X)/dX$ $f(X)=\operatorname{trace}{(AX^TB+C)^{-1}D}$

Denote $f(X)=\operatorname{trace}{(AX^TB+C)^{-1}D}$ and A,B,C,D are the constant matrix, X is the $R^{m*n}$ matrix.

How to prove $df(X)/dX=-B(AX^TB+C)^{-1}D(AX^TB+C)^{-1}A$

I don't know the method when X in the block of inverse operator.

-
Welcome to math.SE: since you are new, I wanted to let you know a few things about the site. In order to get the best possible answers, it is helpful if you say in what context you encountered the problem, and what your thoughts on it are; this will prevent people from telling you things you already know, and help them give their answers at the right level. If this is homework, please add the homework tag; people will still help, so don't worry. –  Julian Kuelshammer Oct 28 '12 at 18:05

## 1 Answer

I find it best to resort to indexes, adopting Einstein's notation. First, using $$( A X^\top B +C)^{-1} ( A X^\top B +C) = 1$$ and differentiating with respect to $X_{ij}$:

$$0= \left( \frac{\mathrm{d}}{\mathrm{d} X_{i j}} \left( A X^\top B +C\right)^{-1}_{pq} \right) ( A X^\top B +C)_{qr} + \left( A X^\top B +C\right)^{-1}_{pq} \underbrace{\frac{\mathrm{d}}{\mathrm{d} X_{i j}} ( A X^\top B +C)_{qr}}_{A_{qj} B_{ir}}$$ Hence: $$\left( \frac{\mathrm{d}}{\mathrm{d} X_{i j}} \left( A X^\top B +C\right)^{-1}_{pq} \right) = -\left(\left( A X^\top B +C\right)^{-1} A\right)_{pj} \left(B \left( A X^\top B +C\right)^{-1} \right)_{iq}$$ Therefore: $$\begin{eqnarray} \frac{\mathrm{d} f(X)}{\mathrm{d} X_{ij}} &=& \frac{\mathrm{d} }{\mathrm{d} X_{ij}} \left( A X^\top B +C\right)^{-1}_{pq} D_{qp} \\ &=& -\left(\left( A X^\top B +C\right)^{-1} A\right)_{pj} \left(B \left( A X^\top B +C\right)^{-1} \right)_{iq} D_{qp} \\ &=& -\left(\left( A X^\top B +C\right)^{-1} A\right)_{pj} \left(B \left( A X^\top B +C\right)^{-1} D \right)_{ip} \\ &=& - \left(B \left( A X^\top B +C\right)^{-1} D \left( A X^\top B +C\right)^{-1} A\right)_{ij} \end{eqnarray}$$ In other words: $$\frac{\mathrm{d} f(X)}{\mathrm{d} X} = -B \left( A X^\top B +C\right)^{-1} D \left( A X^\top B +C\right)^{-1} A$$

-
Thanks very much.Do you have some docs talk about Einstein's notation ? –  pl8787 Oct 29 '12 at 6:27