Solution (source code)

= Solution

The <characteristic polynomial> is
$$
\det(A-\lambda I)=(2-\lambda)(4-\lambda)+2=(\lambda-3)^2+1.
$$
Thus the <eigenvalues> and corresponding <eigenvectors> over $\mathbb C$ are
$$
\boxed{\lambda_+=3+i,\ v_+=(-1+i,1)^T;\qquad\lambda_-=3-i,\ v_-=(-1-i,1)^T.}
$$
All nonzero scalar multiples of these vectors are also <eigenvectors>. Distinct <eigenvalues> make them linearly independent. Put them in the columns of
$$
B=\begin{pmatrix}-1+i&-1-i\\1&1\end{pmatrix},\qquad
B^{-1}=\frac1{2i}\begin{pmatrix}1&1+i\\-1&-1+i\end{pmatrix}.
$$
The equations $Av_\pm=\lambda_\pm v_\pm$ are exactly $AB=BC$, giving the <diagonalization>
$$
\boxed{C=B^{-1}AB=\begin{pmatrix}3+i&0\\0&3-i\end{pmatrix}.}
$$
There is no diagonalization over $\mathbb R$, since the matrix has no real <eigenvalues>.