Let $A$ and $X$ be two symmetric (semi)positive definite matrices, I was wondering how to calculate the gradient with respect to $X$ of
$$ X \mapsto \log\det(A+X),$$
where $\det$ is the determinant of a matrix.
In the second order case, let $X\in \mathbb{R}^{m\times n}$ ($m>n$) be a rectangle matrix, $A$ and $B$ are $m\times m$ and $n\times n$ symmetric (semi)positive definite matrices. Then, what is the gradient of
$$ X \mapsto \log \det \left( X B X^\top + A \right) $$
with respect to $X$?