why the matrix is diagonalizable? show that matrix $$A = \begin{bmatrix} a & b \\
        0 & a
        \end{bmatrix}$$
is diagonalizable iff $b = 0.$
I do not understand why. Cuz if a, b are reals, I can always find a constant: $a = cb$
and row-reduce.
Can anyone explain, please.
 A: If $A=\begin{bmatrix}a&b\\0&a\end{bmatrix}$ is diagonalizable, then because its only eigenvalue is $a$, we must have
$$
P^{-1}AP=\begin{bmatrix}a&0\\0&a\end{bmatrix}
$$
Then we have
$$
P^{-1}(A-Ia)P=\begin{bmatrix}0&0\\0&0\end{bmatrix}
$$
and therefore
$$
A-Ia=\begin{bmatrix}0&0\\0&0\end{bmatrix}
$$
which implies that $b=0$.
A: Suppose $A$ is diagonalizable, then $UAU^{-1}$ is diagonal for some $U$. The eigenvalues are the same, so $UAU^{-1} = a I$, or $A = U^{-1} (a I) U  = aI$. Hence $A$ is diagonal, and $b=0$.
A: If $b=0$, $A$ is diagonalizable because it is already diagonal, so $A=I*A*I^{-1}$ . Suppose $b\neq0$. If A is diagonalizable, $dim(E_{a})=2$ because $p_{A}=(x-a)^2$. Since you are working in a 2 dimensional space, $E_{a}=\mathbb{R}^2$, which means every vector of $\mathbb{R}^2$ is an eigenvector associated to $a$. But, for instance, this is not the case of $(0,1)$, because $A*b= \begin{bmatrix} b \\
        a
        \end{bmatrix}$, which can not be a multiple of $(0,1)$ because the first coordinate is different from zero. 
A: If $b=0$, it's diagonal so that's easy. It remains to show that diagonalisable implies $b=0$.
Now, if $b\neq0$, the matrix has a repeated eigenvalue $a$. Therefore, if it were diagonalisable, what matrix would it have to be similar to, and why is this not possible?
