Construct an example of a 4×4 matrix, with one of its eigenvalues equal to −3, that is not diagonal or invertible, but is diagonalizable Construct an example of a 4×4 matrix, with one of its eigenvalues equal to −3, that is not diagonal or invertible, but is diagonalizable.
I know how to find the eigenvalues, and diagonalizing matrices. I can determine whether it is invertible or not. I know how to find the diagonal of a diagonalizable matrix, but answering this question seems to be a confusing task to do. All I can think of is trial and error, but surely there is a better way than that.
Any takes?
 A: The idea is to construct an upper triangular matrix: its eigenvalues can be read off the diagonal. If these are distinct, the matrix is diagonalizable. If there is one zero, the matrix is singular. For example,
$$
A = \pmatrix{0 & 1 & 0 & 0 \\0 & 1 & 0 & 0 \\0 & 0 & 2 & 0 \\0 & 0 & 0 & -3}.
$$
Another idea is to construct a symmetric matrix with the prescribed properties, as symmetric matrices are diagonalizable. Here, my favorite is
$$
B = \pmatrix{ -1 & -1 & -1 & 0\\ -1 & -1 & -1 & 0\\-1 & -1 & -1 &0\\0 & 0 & 0 & 0}.
$$
It is clearly singular, and has eigenvalue of $-3$.
A: Following the hint of Git Gud, the condition "diagonalisable but not diagonal" suggests that you should first ignore the interdiction of diagonal matrices (an interdiction suggests that there is something interesting that they want to keep away from you) and pay lip service to it later. So if one should ask for a diagonal (and so obviously diagonalisable) matrix with an eigenvalue $-3$ and not invertible (which just means $0$ must be another eigenvalue) then this would be easy: take $-3$ and $0$ as diagonal entries, and choose the remaining two according to your mood, then you will be OK. I would in fact maybe postpone choosing those two entries, call then $a,b$ for now. Now to keep all properties except the diagonal property, just change basis, which means replace the diagonal matrix $D$ by some $P^{-1}DP$. Most bases will do fine to make the result non-diagonal; in fact you should just avoid bases made entirely out of eigenvectors. If you arrange all eigenvalues $-3,0,a,b$ to be distinct, then the eigenvectors are just the scalar multiples of the standard basis; it is not hard to find a basis that is not formed only of such scalar multiples. Choose those basis vectors as columns of $P$, invert and multiply, and you're done.
