Determine $a$ to make matrix $A$ diagonalizable $$A=\begin{bmatrix}3&a&0\\0&4&1\\0&2&5\end{bmatrix}$$
Find the eigenvalues and eigenvectors and then determine for what value $a$ matrix $A$ is diagonalizable. I have found the eigenvalues: $λ_1 = 6$ ,  $λ_2 = 3$ (double root) 
and the eigenvectors but don't know how to find the value of $a$ to make the matrix diagonalizable.
I know that a matrix is diagonalizable if $\sum_k\dim(Eλ_k) = n$ 
which is $\dim(Eλ_1)+\dim(Eλ_2)=3$ 
but how do I get what $a$ should be from that? 
Thank you!
 A: The matrix $A$ is diagonalisable if and only if the space of the solutions of the system$$A.\begin{bmatrix}x\\t\\z\end{bmatrix}=3\begin{bmatrix}x\\t\\z\end{bmatrix}$$has dimension $2$. So, let us consider the system$$\left\{\begin{array}{l}3x+ay=3x\\4y+z=3y\\2y+5z=3z\end{array}\right.\iff\left\{\begin{array}{l}ay=0\\y+z=0\\2y+2z=0.\end{array}\right.$$The third equation is twice the second one. Therefore the system is equivalent to$$\left\{\begin{array}{l}ay=0\\y+z=0\end{array}\right.$$and the solutions form a $2$-dimensional space if and only if $a=0$.
A: The matrix $A$ is diagonalizable iff the minimal polynomial has no repeated factors. In this case, that means $A$ is diagonalizable iff the minimal polynomial is $(\lambda-6)(\lambda-3)$. Equivalently,
$$
                 (A-6 I)(A-3I) =0, \\
       \begin{bmatrix}-3&a&0\\0&-2&1\\0&2&-1\end{bmatrix} \begin{bmatrix}0&a&0\\0&1&1\\0&2&2\end{bmatrix}=0, \\
    \begin{bmatrix}0&-2a&a\\0&0&0\\0&0&0\end{bmatrix}=0.
$$
So $A$ is diagonalizable iff $a=0$.
