# How to prove tr AB = tr BA?

there is a similar thread here Coordinate-free proof of $\operatorname{Tr}(AB)=\operatorname{Tr}(BA)$?, but I’m only looking for a simple linear algebra proof.

#### Solutions Collecting From Web of "How to prove tr AB = tr BA?"

Observe that if $A$ and $B$ are $n\times n$ matrices, $A=(a_{ij})$, and $B=(b_{ij})$, then
$$(AB)_{ii} = \sum_{k=1}^n a_{ik}b_{ki},$$
so
$$\operatorname{Tr}(AB) = \sum_{j=1}^n\sum_{k=1}^n a_{jk}b_{kj}.$$
Conclude calculating the term $(BA)_{ii}$ and comparing both traces.

$$\text{Tr}(AB) = \text{Tr}(BA)= \sum a_{ij} b_{ji}$$
$$\text{Tr}( A_1 A_2 \ldots A_m)$$
Assume now $A$,$B$ square. Then certainly $\det(AB) = \det(BA)$, using the multiplicative property of the $\det$.
In fact, the matrices $AB$ and $BA$ have the same characteristic polynomial, so in particular the same trace, and the same determinant.