[Math] A proof of $x^TAx=\mathrm{tr}(Axx^T)$

linear algebramatricestrace

In this post here my answer was downvoted. Unfortunately, I cannot find the mistake and the downvoter did not comment. The question was to prove that $x^TAx=\mathrm{tr}(Axx^T)$.

The argument I gave was to note that trace is linear hence if trace agrees with $x^TAx$ on the basis vectors then the two must be equal (linear transforms are uniquely determined by what they map the basis vectors to). But it's clear that for the standard basis the equality $x^TAx=\mathrm{tr}(Axx^T)$ holds (I mean, really clear, in the sense that the necessary computation is simple enough so you can do it in your head).

Apparently this is incorrect and I would like to know why. Thank you in advance.

A thought: Of course the maps involved are really bi linear (not just linear) but I believe the argument stays the same.

Best Answer

The key flaw in your argument is that (bi)linearity isn't preserved under duplication of arguments; if $f(x,y)$ is a bilinear function of $x$ and $y$ then that doesn't imply that $g(x)=f(x,x)$ is a linear function of $x$. The easiest way to see this is to specialize to the one-dimensional case and look at $f(x,y)=xy$; this is obviously bilinear in $x$ and $y$, but $g(x)=f(x,x)=x^2$ certainly isn't a linear function of $x$.