Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $A,B,X$ be n-by-n matrices, $X$ is nonsingular so $X^{-1}$ exist.

What will $\frac{\partial Tr(XAX^{-1}B)} {\partial X}$ be?

share|cite|improve this question
up vote 2 down vote accepted

From Wikipedia or the matrix cookbook, we have

$$ \def\Tr{\operatorname{Tr}} \frac{\partial \Tr\left(X^{-1}M\right)}{\partial X}=-\left(X^{-1}MX^{-1}\right)^\top\;, $$


$$ \frac{\partial\Tr\left(XAX^{-1}B\right)}{\partial X}=\frac{\partial\Tr\left(X^{-1}BXA\right)}{\partial X}=\left(AX^{-1}B\right)^\top-\left(X^{-1}BXAX^{-1}\right)^\top\;. $$

Note that at $X=I$ this is the transpose of the commutator $AB-BA$.

share|cite|improve this answer
Could you elaborate more on how you do matrix derivative of Trace? I have read the matrix cookbook but I don't really get what "scalar derivative" means. Thank you! – Rein Mar 6 '13 at 12:31
One more question, if the matrix $Q$ is othogonal, i.e. $Q^T=Q^{-1}$, from matrix cookbook we have $\frac{\partial Q^TBQA}{\partial Q} = BQA+B^TQA^T$. Yet by plugging $Q^T$ into $Q^{-1}$ we cant yield the same formulation. Is there any problem on directly plugging $Q^T$ into $Q^{-1}$? – Rein Mar 6 '13 at 12:51
Correction: Should be $\frac {\partial Tr(Q^TBQA)} {\partial Q}$ – Rein Mar 6 '13 at 13:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.