How to show that the matrix
$$B= \left(\begin{array}(\lambda_1 & a & b \\ 0 & \lambda_1 & c\\ 0 & 0 & \lambda_2\end{array}\right)$$
is diagonalizable when $a\neq0$, when $\lambda_1\neq \lambda_2$. How should I work this out? I tried comparing the algebraic and geometric multiplicities of the eigenvalues of $B$ but I didn't succeed in this approach yet.
It suffices to note that $B - \lambda_1 I$ has nullity (null-space dimension) $1$ when $a \neq 0$ and $2$ when $a = 0$. So, the geometric multiplicity of $\lambda_1$ is $1$ when $a \neq 0$ and $2$ when $a = 0$.