I have matrices $A \in \mathbb{K}^{n \times m}$ and $B \in \mathbb{K}^{m \times n}$
What is the best way to prove that tr(AB) = tr(BA). I found a prove in Matrix Analysis by Horn and Johnson, but they only prove it if $n \leq m$.
I have matrices $A \in \mathbb{K}^{n \times m}$ and $B \in \mathbb{K}^{m \times n}$
What is the best way to prove that tr(AB) = tr(BA). I found a prove in Matrix Analysis by Horn and Johnson, but they only prove it if $n \leq m$.
Either you have $n\leq m$ or $m\leq n$. If it is the latter, exchange $n$ with $m$ and $A$ with $B$, and the same proof works.