[Math] To Prove $x’Ax=\mathrm{tr}(xAx’)=\mathrm{tr}(Axx’)=\mathrm{tr}(xx’A)$

linear algebramatricestrace

To prove,

$x'Ax=\mathrm{tr}(xAx')=\mathrm{tr}(Axx')=\mathrm{tr}(xx'A)$

where 

  • $A$ is a square matrix.
  • $x'$ is the transpose of $x$.
  • For each $x,x'$ are column vector, row vector.

Best Answer

Hint: note that so long as $A$ and $B$ are compatible (that is, $A$ is $m \times n$ and $B$ is $n \times m$), we have trace$(AB) = $ trace$(BA)$, so that $$ \mathrm{tr}(x'(Ax)) = \mathrm{tr}((Ax)x') \\ \mathrm{tr}((xx')A) = \mathrm{tr}(A(xx')) $$ All you have to show then is that $x'Ax = \mathrm{tr}(x'Ax)$.

Related Question