I have been struggling with a problem concerning matrices and their characteristic polynomials. It is known that similar matrices have the same characteristic polynomial, but my calculations aren't showing that.
Suppose we have the following matrix:
$$A=\begin{pmatrix} -5 & 2\\ 4 & 1 \end{pmatrix}$$
Multiplying the first row by $4/5$ and adding it to the second row, we get the similar matrix
$$B=\begin{pmatrix} -5 & 2\\ 0 & \frac{13}{5} \end{pmatrix}$$
However, $\det(A-xI)=x^2+4x-13$, while $\det(B-xI)=x^2+\frac{12}{5}x-13\neq \det(A-xI)$.
Another example with matrix $A$: Multiplying the second column by $-4$ and adding it to the first column, we obtain the similar matrix
$$C=\begin{pmatrix} -13 & 2\\ 0 & 1 \end{pmatrix}$$
Notice that $\det(C-xI)=x^2+12x-13\neq \det(A-xI)$.
I have checked my calculations many times trying to spot an error, and have tried to figure out the wrong usage of some theorem, but I don't know what is going on.
Lesson learned:
a matrix obtained by elementary row (or column) operations
is not necessarily similar to the original matrix.