Say I have a matrix $A_a$ with
$$A_a:= \left(\begin{array}{c} 2 & a+1 & 0 \\ -a & -3a & -a \\ a & 3a+2 & a+2 \end{array}\right)$$
I was wondering if there was an easy way to determine for which $a$ the matrix would be diagonalizable.
I tried to determine its eigenvalues first.
$det(A_a - \lambda I_3) = 0$ gave me a rather complex formula, from where on I don't know how to continue.
$0 = 7a \lambda - 6a - 4 \lambda + 4 \lambda^2 - 2a\lambda^2 - \lambda^3 - a^2\lambda + 2a^2$
Given:
$$A_a:= \left(\begin{array}{c} 2 & a+1 & 0 \\ -a & -3a & -a \\ a & 3a+2 & a+2 \end{array}\right)$$
We find the eigenvalues using $|A_a - \lambda I| = 0$, yielding:
$$-a^2 \lambda +2 a^2-2 a \lambda ^2+7 a \lambda -6 a-\lambda ^3+4 \lambda ^2-4 \lambda = 0 \implies (\lambda-2)(\lambda - (1-a-\sqrt{a+1}))(\lambda - (1-a+\sqrt{a+1}))=0$$
This gives us the three eigenvalues:
$$\lambda_{1,2,3} = 2,-a-\sqrt{a+1}+1,-a+\sqrt{a+1}+1$$
Hint: try the cases $a = 0$ and $a = -1$ (one is good and the other is not)! Do you see why those two values were chosen? Think algebraic multiplicity of the eigenvalues.
Generally, the eigenvectors are found by $[A-\lambda_i I]v_i = 0$, so for $\lambda_1 = 2$, the RREF is:
$$\left( \begin{array}{ccc} 1 & 0 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \\ \end{array} \right)v_1=0$$
This gives $v_1 = (-1,0,1)$.
For $\lambda_2 = -a-\sqrt{a+1}+1$, the RREF is:
$$\left( \begin{array}{ccc} 1 & 0 & \frac{-a+\sqrt{a+1}-1}{a} \\ 0 & 1 & 1 \\ 0 & 0 & 0 \\ \end{array} \right)v_2=0$$
This gives $v_2 = \left(-\dfrac{-a+\sqrt{a+1}-1}{a},-1,1\right)$.
We can immediately write (due to conjugates) $v_3 = \left(-\dfrac{-a-\sqrt{a+1}-1}{a},-1,1\right)$.