Step 1

Given that A and B are similar n x n matrices.

Then there exist a non-singular n x n matrix P such that \(B=P^{-1}AP \text{ and } A=PBP^{-1}\)

Step 2

Now

tr(B)=tr(P^{-1}AP)\)

\(= tr(P^{-1}PA) \left[ \because \text{If A,B and C are any matrices } A(B \cdot C)=(AB)C , \text{ provided both sides are defined} \right]\)

\(=tr(IA) , \text{ where I is the identity matrix}\)

\(=tr(A) \left[ \because \text{ for any } n \times n \text{matrix} A,I \cdot A =A \right]

Given that A and B are similar n x n matrices.

Then there exist a non-singular n x n matrix P such that \(B=P^{-1}AP \text{ and } A=PBP^{-1}\)

Step 2

Now

tr(B)=tr(P^{-1}AP)\)

\(= tr(P^{-1}PA) \left[ \because \text{If A,B and C are any matrices } A(B \cdot C)=(AB)C , \text{ provided both sides are defined} \right]\)

\(=tr(IA) , \text{ where I is the identity matrix}\)

\(=tr(A) \left[ \because \text{ for any } n \times n \text{matrix} A,I \cdot A =A \right]