I got the following matrix:
$$ A = \begin{pmatrix} a & 0 & 0 \\ b & 0 & 0 \\ 1 & 2 & 1 \\ \end{pmatrix} $$
I need to answer when this matrix is diagonalizable. Its characteristic polynomial is $ t(t-a)(t-1) $. So its 3 eigenvalues are 0, 1 and a. Both the algebraic and geometry multiplicities of those values are 1 (for all of them).
Let's look at the matrices for those eigenvalues: $$ A - 0I = \begin{pmatrix} a & 0 & 0 \\ b & 0 & 0 \\ 1 & 2 & 1 \\ \end{pmatrix} $$ $$ A - I = \begin{pmatrix} a -1 & 0 & 0 \\ b & -1 & 0 \\ 1 & 2 & 0 \\ \end{pmatrix} $$ $$ A - aI = \begin{pmatrix} 0 & 0 & 0 \\ b & -a & 0 \\ 1 & 2 & 1 - a \\ \end{pmatrix} $$ $\rho (A - 0I) = 2 $
$\rho (A - 1I) = 2 $
$\rho (A - aI) = 2 $
It seems that for every $a$ and $b$ this matrix would be diagonalizable. But it's not. Where am I wrong?
If $\;a\neq0,1\;$ the matrix has three different eigenvalues and is thus diagonalizable. Now, upon substitution in $\;\det(A-\lambda I)\;$ in the other two cases we get the homogeneous systems:
$$a=0:\;\;\begin{cases}bx=0\\x+2y-z=0\end{cases}\;\;\;\text{if}\; b\neq0\;,\;\;\text{then the solution space's}\;\;\left\{\,\begin{pmatrix}0\\y\\2y\end{pmatrix}\,\right\}$$
which is of dimension one and thus the matrix isn't diagonalizable since the algebraic multiplicity of the eigenvalue zero $\;\neq\;$ the geometric one, but if
$$b=0\implies\text{ the solution space's}\;\left\{\,\begin{pmatrix}x\\y\\x+2y\end{pmatrix}\,\right\}$$
of dimension two and thus the matrix is diagonalizable.
Now you try to do something similar with the case $\;a=1\;$ .