# Alternative way of solving Mahalanobis distance

Mahalanobis distance is given by:

$$(x-\mu)^T \Sigma^{-1}(x-\mu)$$

Apparently the solution to the above formula is equivalent to:

$$Trace(\Sigma^{-1} (x-\mu)(x-\mu)^T)$$

How can you prove that the two are indeed equivalent?

Note: This has nothing to do with university, I just saw the equivalence and was wondering where it came from

• I might be tempted to use induction. You can calculate it in the $1\times 1$ and $2\times 2$ cases. Then you can show that if it holds for the $n\times n$ case then it must hold for the $(n+1)\times(n+1)$ case.
– Dave
Jun 23 at 9:58