Is this $3 \times 3$ matrix diagonalizable? Is the following matrix diagonalizable?
$$\begin{pmatrix}
    2 & 1 & 0 \\
    0 & 0 & 2 \\
    0 & 3 & -1 \\
    \end{pmatrix}$$
I think it is. I found the eigenvalues that are $2, 2, -3$. Can I say that the matrix is diagonalizable because it is a square matrix $3 \times 3$ and it has $3$ eigenvalues?
 A: 
I found the eigenvalues that are $2, 2, -3$.
Can I say that the matrix is diagonalizable because it is a square matrix $3x3$ and it has $3$ eigenvalues?

Based only on these observations: no, you cannot conclude that (yet).
Because it is a 3x3-matrix, you'll need 3 linearly independent eigenvectors for the matrix to be diagonalizable. Since eigenvectors corresponding to different eigenvalues are known to be linearly independent, you know you'll find at least two of those.
The key is the eigenvalue 2, which is a double root of the characteristic polynomial. If you find:

*

*only 1 eigenvector corresponding to this eigenvalue, the matrix will not be diagonalizable;

*2 (linearly independent) eigenvectors corrsponding to this eigenvalue, the matrix will be diagonalizable.


 You should find only one eigenvector for this eigenvalue and conclude that the matrix is not diagonalizable.

The number of linearly independent eigenvectors corresponding to an eigenvalue is also called the geometric multiplicity of that eigenvalue. This allows the following rephrasing of the criterion: a matrix is diagonalizable if the algebraic multiplicity is equal to the geometric multiplicity for each eigenvalue.
See also Algebraic multiplicity for a related question about the same matrix.
A: You need to check if the polynomial is simply scinded or not, here the eigenvalue $2$ is double however here
$$
\chi_{A}\left(X\right)=\left(X-2\right)^2\left(X+3\right)
$$
The matrix $$A-2I_3$$ is not of rank $1$, so $A$ is not diagonalizable.
A: >>> from sympy import *
>>> A = Matrix([[ 2, 1, 0],
                [ 0, 0, 2],
                [ 0, 3,-1]])
>>> P, J = A.jordan_form()
>>> J
Matrix([
[-3, 0, 0],
[ 0, 2, 1],
[ 0, 0, 2]])

Are all the Jordan blocks $1 \times 1$? If not, what can you conclude with regards to diagonalizability?
A: A matrix is "diagonalizable" if and only if there exist a complete set of eigenvectors.  That is, if and only if there is a basis consisting of eigenvectorsl.  If an n by n matrix has n distinct eigenvalues then it has  n independent eigenvectors so is diagonalizable.  Here, two of the eigenvalues are the same, 2, so we need to see if there are two independent eigenvectors having eigenvalue 2.  If $(x_1, x_2, x_3)$ is an eigenvector with eigenvalue 2 then we must have $2x_1+ x_2= 2x_1$, $2x_3= 2x_2$, and $3x_2- x_3= 2x_3$. Those reduce to $x_2= 0$, $x_3= x_2= 0$, and $0= 0$.  That leaves $x_1$ undetermined.  An eigenvector of this matrix with eigenvalue 2 is of the form $(x_1, 0, 0)$ where $x_1$ can be any number.  But there are not two independent eigenvectors so this matrix is NOT diagonalizable.
