Prove that if A and B are similar nxn matrices, then trace of (A) = trace of (B).

Proof.

Write $\displaystyle A = Q^{-1}BQ$

Then we have QA = BQ, tr(QA) = tr(BQ), since trace is commutative, I have tr(AQ) = tr(BQ).

Now, can I say that tr(A) = tr(B)?