# Show that similar matrices have same trace

If $A$ and $B$ are $n\times n$ matrices of a field $F$, then show that $\text{trace}(AB)=\text{trace}(BA)$. Hence show that similar matrices have the same trace.

I've done the first part (proving that $AB$ and $BA$ have the same trace). I can show that here if you say so. But I'm stuck on the 'Hence show' part. Please give me some ideas.

• Write up what it means for matrices to be similar and use what you have just shown. Jul 1, 2016 at 7:02

Hint: By very definition, two matrices $A,B$ are similar iff there exists an invertible matrix $S$ such that $A=SBS^{-1}$. Now apply the trace on both sides, and conclude using associativity of the matrix product.

• Thanks a lot. $A=SBS^{-1} \implies \text{trace}(A) = \text{trace}\left((SB)(S^{-1})\right) = \text{trace}\left((S^{-1})(SB)\right) = \text{trace}\left((SS^{-1})B\right) = \text{trace}(B)$. Is this correct? Jul 1, 2016 at 7:05
• That's it. Well done. Jul 1, 2016 at 7:06
• Why does $\text{trace}\left((SB)(S^{-1})\right) = \text{trace}\left((S^{-1})(SB)\right)$? Or maybe I should ask... why does $(SB)(S^{-1}) = (S^{-1})(SB)$? Dec 4, 2021 at 1:18
• @grisaitis It's due to the first part of the exercise, where one shows that $\text{trace}(AB)=\text{trace}(BA)$ i.e that you can commute matrix products inside of the trace operator. Dec 4, 2021 at 6:42

You can use the characteristic polynomials. If $A$ is similar to $B$, then their characteristic polynomials $f_A(x)$ and $f_B(x)$ are identical. Since $$f_A(x)=x^n-tr(A)x^{n-1}+\ldots\pm\det(A)\\$$ and $$f_B(x)=x^n-tr(B)x^{n-1}+\ldots\pm\det(B)$$ it follows in particular that $tr(A)=tr(B)$.

Suppose that $$A$$ is similar to $$B$$. Then there exist $$C$$ such that: $$B=CAC^{-1}$$. So: $$tr(B)=tr(CAC^{-1})$$, now let me call $$X=CA$$, and $$Y=C^{-1}$$, then $$tr(B)=tr(XY)=tr(YX)=tr(C^{-1}CA)=tr(A)$$.

It is very clear if you focus on the component. Let's say $$M = ABC$$then the trace in tensor notation is $$M^i_i = A^i_jB^j_kC^k_i$$ now you can see you can interchange them to form even permutation (so its $ABC,CAB, BCA$)without changing the invariant. Of course this works for any numbers of matrix multiplication as long as you got them in the right order
In so you push the $S^{-1}$ to the front and combine it with $S$, you will get identity and solve our problem