To show two matrices are conjugate to each other Given two matrices A and B
$$
A = 
\begin{pmatrix} 1 & 0 & 0 \\ 1 & 3 & 0 \\ 1 & 2 & 1 \end{pmatrix}, \quad
B =
\begin{pmatrix} 3 & 0 & 4 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} 
$$
I have checked  basic properties such as trace, charatersitic polynomial and  are same .
I also realise that i need to find the  P
Such that $A=P^{-1}BP $
But how do i find P ? Thanks

Compute the eigenvalues of $A$ and $B$. These are of course $1, 1, 3$.
Compute eigenvectors of $A$. These are
$$
\begin{bmatrix}-2\\1\\0\end{bmatrix},
\begin{bmatrix}0\\0\\1\end{bmatrix},
\begin{bmatrix}0\\1\\1\end{bmatrix},
$$
where the first two are relative to $1$, and the third to $3$.
Simlarly for $B$ one has
$$
\begin{bmatrix}0\\1\\0\end{bmatrix},
\begin{bmatrix}-2\\0\\1\end{bmatrix},
\begin{bmatrix}1\\0\\0\end{bmatrix}.
$$
Then you build matrices with the eigenvectors as columns
$$
\alpha
=
\begin{bmatrix}-2&0&0\\1&0&1\\0&1&1\end{bmatrix},
$$
and
$$
\beta
=
\begin{bmatrix}0&-2&1\\1&0&1\\0&1&0\end{bmatrix}.
$$
You will have
$$
\alpha^{-1} A \alpha 
=
\begin{bmatrix}1\\&1\\&&3
\end{bmatrix}
=
\beta^{-1} B \beta,
$$
where I have omitted zeroes.
Therefore
$$
B = (\alpha \beta^{-1})^{-1} A \alpha \beta^{-1}.
$$
