How to calculate $\frac{\partial \mathrm{logdet}(I+XX^T)}{\partial X}$? ($X\in\mathbb{R}^{n\times m}$)
I know that $\frac{\partial \mathrm{logdet}(I+X)}{\partial X}=(I+X)^{-T}$, can we use it?
How to calculate $\frac{\partial \mathrm{logdet}(I+XX^T)}{\partial X}$? ($X\in\mathbb{R}^{n\times m}$)
I know that $\frac{\partial \mathrm{logdet}(I+X)}{\partial X}=(I+X)^{-T}$, can we use it?
For typing convenience, define the symmetric matrix
$$\eqalign{A &= I + XX^T}$$
Write the cost function in terms of this matrix.
Then calculate its differential and gradient.
$$\eqalign{
\phi &= \log\det A \\
d\phi &= A^{-T}:dA \\
&= A^{-T}:(dX\,X^T + X\,dX^T) \\
&= (A^{-T}+A^{-1}):dX\,X^T \\
&= 2A^{-1}X:dX \\
\frac{\partial \phi}{\partial X} &= 2A^{-1}X \\
}$$
where a colon has been used to denote the trace/Frobenius product, i.e.
$$\eqalign{A:B = {\rm Tr}(A^TB)}$$
and the cyclic property allows terms in a trace product to be rearranged
$$\eqalign{
A:BC &= BC:A \\&= B:AC^T \\&= A^TB:C^T \\&= etc\\
}$$