Let
matrix A have compnents A
ij, and B have components B
ij. Then AB has components A
ikB
kj, where singular occurances of an index are free and repeated ones are summed over (
a convention which saves time). So:
Tr(AB)=AikBki=BkiAik=Tr(BA)
And that's all there is to it (remember that Tr(C)=C
ii, the sum of the diagonal entries).
A very useful result for one so easy to prove, and important consequence being that
conjugate matricies have the same trace
Tr(QAQ-1)=Tr(QQ-1A)=Tr(A)
so that the trace of a linear map is independent of its matrix representation.