Does $P^{-1} A P = P P^{-1} A$

linear algebramatricestrace

I hung up on the following step in a derivation I'm following and could use some guidance as to why it's true. I'm trying to show that the trace of a matrix is invariant under any similarity transformation, and I'm not sure why this step is legal.

\begin{align}
\text{Tr} (\mathbf{B}) = \text{Tr} (\mathbf{P}^{-1}\mathbf{AP}) =\text{Tr} (\mathbf{PP}^{-1}\mathbf{A})
\end{align}

From there, it's simply the identity matrix and therefore the matrix $\mathbf A$ is invariant under similarity transformations. But, matricies are not commutative. So, I'm not sure the right hand side is true.

Best Answer

It is true because, for any two $n\times n$ matrices $A$ and $B$, $\operatorname{tr}(AB)=\operatorname{tr}(BA)$.

Related Question