The exercise gives two matrices $A$ and $B$ and asks you to show they are similar by showing that they are similar to the same diagonal matrix, and then after that find and invertible matrix $P$ such that $P^{-1}AP=B$.
$$ A = \begin{bmatrix} 1 & 0 & 2\\[0.3em] 1 & -1 & 1\\[0.3em] 2 & 0 & 1\\[0.3em] \end{bmatrix}, % B = \begin{bmatrix} -3 & -2 & 0\\[0.3em] 6 & 5 & 0\\[0.3em] 4 & 4 & -1\\[0.3em] \end{bmatrix} $$
I started with with calculating the eigenvalues of matrix $A$ like so: $$ det(A) = det(\begin{bmatrix} 1-\lambda & 0 & 2\\[0.3em] 1 & -1-\lambda & 1\\[0.3em] 2 & 0 & 1-\lambda\\[0.3em] \end{bmatrix})= \lambda^3-\lambda^2-5\lambda-3 = (\lambda-3)(\lambda+1)^2 $$
Which gives $\lambda = -1, 3$. Taking $\lambda = -1$ gives $$[A--1 \cdot I|0] = \begin{bmatrix} 2 & 0 & 2 & 0\\[0.3em] 1 & 0 & 1 & 0\\[0.3em] 2 & 0 & 2 & 0\\[0.3em] \end{bmatrix}= % \begin{bmatrix} 1 & 0 & 1 & 0\\[0.3em] 0 & 0 & 0 & 0\\[0.3em] 0 & 0 & 0 & 0\\[0.3em] \end{bmatrix} $$
But this is where I get stuck, because $x_2$ is a free variable, and so this gives
$$ E_{-1}=\Bigg\{s \begin{bmatrix} 0\\[0.3em] 1\\[0.3em] 0\\[0.3em] \end{bmatrix}+ % t\begin{bmatrix} -1\\[0.3em] 0\\[0.3em] 1\\[0.3em] \end{bmatrix}\Bigg\} = span % \Bigg(\begin{bmatrix} 0\\[0.3em] 1\\[0.3em] 0\\[0.3em] \end{bmatrix}, % \begin{bmatrix} -1\\[0.3em] 0\\[0.3em] 1\\[0.3em] \end{bmatrix} \Bigg) $$ right? I thought $P =\{E_{-1}, E_{-1}, E_{3}\}$ for example, so how does this work? I might be completely missing the mark, but I thought you had to calculate the eigenvalues of matrix $A$ and $B$, and if they are the same, then they are similar, then after this, calculate the eigenvectors of matrix $A$ to obtain matrix $P$, and then plug these matrices into the formula given above ($P^{-1}AP=B$) to see if it's true or not?
I uploaded pictures of how I've done it here, is that the correct way?