Find $k$ so the matrix is similar to a diagonal matrix I have the matrix
$$A=\begin{bmatrix}
2 && -2 && k \\
-1 && 2 && 0 \\
-2 && 0 && 2
\end{bmatrix}$$
Now I need to calculate the parameter $k$ so the matrix is similar to a diagonal matrix. After I have found $k$ I need to calculate the matrix $P$ so that the matrix $P^{-1}AP$ is a diagonal matrix.
I calculated the characteristic polynomial of the matrix $A$: $(2 - \lambda)(\lambda^2 - 4 \lambda + 2k + 2)$ (correct me if I'm wrong here). From the polynomial I can se that one eigenvalue is $2$. Now I need to find other eigenvalues from the second part of the polynomial. Here I get kind of stuck. I know that the polynomial is equal to $0$ if $2k + 2 = 0$. From here I get $k=-1$. Now how do I get the eigenvalues? Can I return the calculated $k$ to the characteristic polynomial and then calculate $\lambda^2 - 4\lambda = 0$. Then I would get $\lambda=0$ and $\lambda=4$. Hereby, my matrix $A$ would have 3 different eigenvalues and would be similar to the a diagonal matrix and $P$ would be a matrix formed of eigenvectors I guess. I just need someone to correct me if I'm wrong, or propose a different solution. And also, is this the only possible value of $k$? Thanks
 A: So, the problem is to find $k$ such that the matrix is diagonalizable. From the characteristic polynomial , $(\lambda-2)(\lambda^2-4\lambda+2k+2)$ we get 2 as one eigenvalue. So, next to find the value of $k$ for which $\lambda^2-4\lambda+2k+2$ does not give us the same root. $i.e.\quad k\neq1$.
Moreover, we can see that for $k=1$, the characteristic polynomial becomes $(\lambda-2)^3$. $i.e.$ 2 is an eigenvalue with algebraic multiplicity 3.But $Null(A-2I)=1$. Hence $A$ no diagonalizable.
NOTE: Please add if I have missed something. 
A: You did not say which is the field that you are working with. I shall assume that it happens to be $\mathbb R$.
If the polynomial $P(\lambda)=\lambda^2-4\lambda+2k+2$ has two real roots, none of which is $2$, then your matrix is similar to a diagonal matrix. Since $P(2)=2k-2$, you want to have $k\neq1$. Furthermore, $P(\lambda)$ has $2$ real roots distinct if and only if $8-8k>0$, that is, if and only if $k<1$. Therefore, your matrix is similar to a diagonal matrix if $k<1$ and it is not similar to a diagonal matrix if $k>1$.
If $k=1$, then the only eigenvalue is $2$. Since your matrix is not twice the identity matrix, it is not similar to a diagonal matrix.
