Let \(A = \begin{bmatrix} 4 & -1 & -1\\2 & 1 & -1\\0 & 0 & 2\end{bmatrix}\).
Is \(A\) diagonalizable?
The answer is “Yes”.
The eigenvalues of \(A\) are \(2\) and \(3\) whose geometric multiplicities
are \(2\) and \(1\), respectively. Since the geometric multiplicities
add up to \(3\), \(A\) is diagonalizable.
In particular, we can set
\(P = \begin{bmatrix} 1 & 0 & 1\\ 0 & 1 & 1\\ 2 & -1 & 0\end{bmatrix}\) and
\(D = \begin{bmatrix} 2 & 0 & 0\\ 0 & 2 & 0\\ 0 & 0 & 3\end{bmatrix}\).
One can then check that
\(P^{-1}=\begin{bmatrix} -1 & 1 & 1\\ -2 & 2 & 1\\ 2 & -1 & -1\end{bmatrix}\)
and \(A = PDP^{-1}\).