I don't see how to differentiate $ABA^T$ with respect to $A$ where $A$ and $B$ are $n\times n$ matrices. I know it's going to be a rank-4 tensor, but what exactly will it be?
The inspiration for this comes from having to find the derivative of the covariance matrix $\operatorname{Cov}(TX)$ with respect to $T$.
So I'll tell you all what I've done so far and maybe you can help.
I was working with the squared Bures distance $d_H^2(Cov(TX),\Sigma_v) = tr(Cov(TX) + \Sigma_v - 2(Cov(TX))^{1/2}\Sigma_v Cov(TX)^{1/2})^{1/2})$.
First I computed the derivative of $d_H^2(A,B)$ for positive matrices $A$ and $B$, which turned out to be $tr(I-A_{\#}B^{-1})$. Here we define $A_{\#}B=(AB^{-1})^{1/2}B.$
So now I was using the chain rule to compute the derivative of $d_H^2(Cov(TX),\Sigma_v)$. But in order to do that, I need to differentiate $Cov(TX)$ w.r.t. $T$. That's where I'm stuck.
=========
Ultimately, I'm looking to find the gradient with respect to $T$ of $$ \lambda \left\|TX-X\right\|^2 + \left\|T\right\|_{HS} + d_H^2(Cov(TX),\Sigma_v). $$ and calculate its roots.
Assuming I didn't make any mistakes, the derivatives of the first two terms are $2(TX-X)X^T$ and $T/\left\|T\right\|_{HS}$ respectively -- feel free to correct me if I'm wrong here. So the last term is what's causing problems for me when I differentiate.