Find, if possible, a nonsingular matrix P such that $\displaystyle P^{-1}AP$ is diagonal.
$\displaystyle
\begin{pmatrix}1 & 1 & 2\\0 & 1 & 0\\0 & 1 & 3\end{pmatrix}
$
First you need to find the eigenvalues so you can find the eigen Basis for the matrix (if it exists)
$\displaystyle
\begin{pmatrix}1-\lambda & 1 & 2\\0 & 1-\lambda & 0\\0 & 1 & 3 -\lambda \end{pmatrix}
$
Expanding along the first column we get
$\displaystyle (1-\lambda)[(1-\lambda)(3-\lambda)-(1)(0)]=(1-\lambda)^2(3-\lambda)$
So the two eigenvalues are $\displaystyle \lambda =1,\lambda=3 $
Using $\displaystyle \lambda =1 $ we get the matrix
$\displaystyle
\begin{pmatrix}0 & 1 & 2\\0 & 0 & 0\\0 & 1 & 2 \end{pmatrix}
$
Reducing we get
$\displaystyle
\begin{pmatrix}0 & 1 & 2\\0 & 0 & 0\\0 & 0 & 0 \end{pmatrix}
$
This implies that there are two parameters in the solution so let
$\displaystyle x=s, z=t$ so the last equation is
$\displaystyle y+2z=0 \iff y+2t=0 \implies y =-2t$
so the solution is
$\displaystyle \begin{pmatrix}
s \\
-2t \\
t
\end{pmatrix} =
s \cdot \begin {pmatrix}
1 \\ 0 \\ 0
\end {pmatrix}
+t \cdot \begin {pmatrix}
0 \\ -2 \\ 1
\end{pmatrix}
$
So these are the first two eigenvectors
Now using the eigen values $\displaystyle \lambda =3$ we get
$\displaystyle
\begin{pmatrix}-2 & 1 & 2\\0 & -2 & 0\\0 & 1 & 0 \end{pmatrix}
$
Reducing we get
$\displaystyle
\begin{pmatrix}1 & 0 & -1\\0 & 1 & 0\\0 & 0 & 0 \end{pmatrix}
$
This has 1 parameter in its solution so let $\displaystyle z=t$
We can see that $\displaystyle y=0$ and $\displaystyle x=z \iff x=t$
So the solution is
$\displaystyle \begin{pmatrix}
t \\ 0 \\ t
\end{pmatrix}=t \cdot \begin{pmatrix} 1 \\ 0 \\ 1 \end {pmatrix}$
The eigenvectors are the columns of the matrix P.