Find all the real values of $a,b,c,e,d,f$ for which $A$ is diagonalizable $\newcommand{\span}{\text{span}}$
The matrix in question is:
$$A=\begin{pmatrix}
 2&0&0&0\\
    a&-1&0&0\\
    b&c&-1&0\\
    d&e&f&2
\end{pmatrix}$$
This was on a test that I had and I got it wrong because I needed to add more conditions, what I did was:
Since A is a upper triangular matrix the eigenvalues of A are the values on the diagonal so $$\lambda_1=\lambda_4=2 \qquad \lambda_2=\lambda_3=-1$$
For $$\lambda_1=\lambda_4=2$$ we have:
$(A-2I)=\begin{pmatrix}
 2&0&0&0\\
    a&-1&0&0\\
    b&c&-1&0\\
    d&e&f&2
\end{pmatrix}-\begin{pmatrix}
     2&0&0&0\\
0&2&0&0\\
0&0&2&0\\
0&0&0&2
\end{pmatrix}=
\begin{pmatrix}
 0&0&0&0\\
    a&-1&0&0\\
    b&c&-1&0\\
    d&e&f&0
\end{pmatrix}$
Since we need that the geometric multiplicity equals the algebraic multiplicity (which is $2$) we need to have 2 linearly independent vectors on each solution for the eigenvalues, so by making $a=b=c=d=e=f=0$ we get:
$$\begin{pmatrix}
 0&0&0&0\\
    0&-1&0&0\\
    0&0&-1&0\\
    0&0&0&0
\end{pmatrix}$$
The will give us the eigenspace $E_{2}=\span\left(\begin{bmatrix}1\\0\\0\\0\end{bmatrix},\begin{bmatrix}0\\0\\0\\1\end{bmatrix}\right)$
By a similar process for $\lambda_2=\lambda_3=-1$ we get $E_{-1}=\span\left(\begin{bmatrix}0\\1\\0\\0\end{bmatrix},\begin{bmatrix}0\\0\\1\\0\end{bmatrix}\right)$
What are the remaining conditions, or values, that I need on $a,b,c,d,e,f$ for $A$ to be diagonalizable. Any help would be really appreciated.
 A: The geometric multiplicity of the eigenvalue $\lambda$ is the dimension of the solution space of $(A - \lambda I) {\bf x} = 0$, that is, the nullity of $A - \lambda I$.
Example For our $A$, the geometric multiplicity of the eigenvalue $2$ of $A$ is the nullity of $$A - 2I = \pmatrix{0&0&0&0\\a&-3&0&0\\b&c&-3&0\\d&e&f&0} ,$$ or just as well (by the Rank-Nullity Theorem) $4$ less the rank of that matrix. So, the geometric and algebraic multiplicities of the eigenvalue $2$ are equal if and only $\operatorname{rank}(A - 2 I) = 4 - 2 = 2$. The second and third columns of $A - 2 I$ are always linearly independent (the $2 \times 2$ minor consisting of their second and third entries has determinant $9 \neq 0$), so $\operatorname{rank}(A - 2I) = 2$ if and only if the first column is a linear combination of the second and third columns, but in this case that condition is equivalent to the vanishing of the determinant of the lower-left $3 \times 3$ minor, which is a cubic condition in $a, \ldots, f$.
Repeating the process for the eigenvalue $+1$ gives another necessary set of cubic conditions, and in this case our system of conditions is equivalent to a system consisting of one quadratic condition and one linear condition in $a, \ldots, f$.
A: Ummm. A matrix is diagonalizable if and only if the minimal polynomial  is squarefree.
Your characteristic polynomial is $ (\lambda +1)^2 (\lambda - 2)^2.$  Both factors occur in the minimal polynomial with exponent either $1$   or $2.$   We need both exponents $1,$    so that the minimal poly becomes $ (\lambda +1) (\lambda - 2)= \lambda^2 - \lambda - 2.$
This happens when
$$  A^2 - A - 2I = 0  $$
calculating
$$
A^2 - A - 2 I =
\left(
\begin{array}{cccc}
0&0&0&0 \\
0&0&0&0 \\
ac&-3c&0&0 \\
ae+bf+3d& cf&0&0 
\end{array}
\right)
$$
