Prove ${\rm tr}\ (AA^T)={\rm tr}\ (A^TA)$ for any Matrix $A$
I know that each are always well defined and I have proved that, but I am struggling to write up a solid proof to equate them. I know they're equal.
I tried to show that the main diagonal elements were the same but if I say that $A$ is $n\times m$ then $$(AA^T)_{ii} = (a_{11}^2+\dots +a_{1m}^2) + \dots + (a_{n1}^2+\dots +a_{nm}^2)$$ and $$(A^TA)_{ii} = (a_{11}^2+\dots +a_{n1}^2) + \dots + (a_{1m}^2+\dots +a_{nm}^2)$$
By $(AA^T)_{ii}$ you seem to mean the $i$-th term on the diagonal of $AA^T$. But instead what you've writen is already $\mathrm{tr}(AA^T)$. Which is ok. Now, you just have to realize that both sums are the same, up to the order of the addends -which doesn't matter.
For instance: you have $a_{11}^2$ on both sums, haven't you?
Also $a_{1m}^2$ appears on both sums. Also $a_{n1}^2$...
Write a few more terms on both sums. Or write all terms in the particular case $2\times 3$ and you'll see it.