TITLE: Prove the matrix is not diagonalizable
QUESTION [5 upvotes]: For any reals, $a, b$ show that 
$$D = \begin{bmatrix}
a & 1\\ 
0 &  b
\end{bmatrix}$$
  Is not diagonalizable.

I got that the eigenvalues are $\lambda_1 = a, \lambda_2 = b$
However, for $a \ne b$, there are $2$ distinct eigenvalues so $D$ must be diagonalizable right?
So what about $a= b$?

REPLY [5 votes]: In the case where $a = b$, we have only one eigenvalue $\lambda = a$. In order for the matrix to be diagonalisable, the algebraic multiplicity (let's denote it $\mu$) of the eigenvalue $\lambda$, where $\mu = 2$ in our example, must be equal to its geometric multiplicity $\gamma.$
We know by definition that $ \gamma = \dim \ker (D-\lambda I),$ with $$\ker (D-\lambda I) = \{ x \in \mathbb R^2: (D-\lambda I)x = 0\}.$$
However:
$$D-\lambda I = \begin{bmatrix} 0 & 1 \\ 0 & 0  \\ \end{bmatrix}.$$
We can easily notice that $\operatorname{rank} (D-\lambda I) = 1 \implies \dim \ker (D-\lambda I) = \gamma = 1$ (according to the rank-nullity theorem).
Thus, we have that $2 = \mu \neq \gamma = 1.$ Thus, whenever $a=b( = k)$, matrix $D$ is not diagonalisable, regardless the value of $k$.