For which $a$ is a matrix $A$ diagonalizable? 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$
 A: 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)$.
A: If you factor the characteristic polynomial, you find it is
$$
(2a^2-6a)-(a^2-7a+4)\lambda+(4-2a)\lambda^2-\lambda^3=
(2-\lambda)(\lambda^2+(2a-2)\lambda+a^2-3a)
$$
If you know this polynomial has three distinct roots, then the matrix is diagonalizable. A root can be repeated only if either


*

*the discriminant of $f(\lambda)=\lambda^2+(2a-2)\lambda+a^2-3a$ is zero, or

*$2$ is also a root of $f(\lambda)$, that is $f(2)=0$.


The first case gives
$$
4(a-1)^2-4(a^2-3a)=0
$$
that is
$$
a^2-2a+1-a^2+3a=0
$$
or
$$
a=-1
$$
The second case gives
$$
4+2(2a-2)+a^2-3a=0
$$
or
$$
4+4a-4+a^2-3a=0
$$
that is,
$$
a^2+a=0
$$
which has the roots $0$ and $-1$.
So, when $a\ne0$ and $a\ne-1$, the matrix is diagonalizable.
For $a=-1$ the characteristic polynomial is $(2-\lambda)^3$ and discussing the eigenspace is easy.
For $a=0$ the eigenvalues are $2$ (double) and $0$ single, so you have to discuss the eigenspace relative to $2$.
