<s>[INST] What is a condition on my parameter for this matrix to be diagonalizable? I am looking for a condition on $b$ so that the matrix $B$ below can be diagonalized:
$$B=\begin{pmatrix}2b+1 &-2b-2 &b-2\\ 2b-1&-2b&b-2\\ -6&6&-1\end{pmatrix}.$$
I know that if $B$ has $3$ linearly independent eigenvectors, $B$ is diagonalizable, but I want to avoid going all the way to get eigenvalues and eigenvectors of $B$.
Do we have any other easier ways?
 [/INST] Observe that the first two rows of $B$ are nearly identical and the first two columns of $B$ are almost the negative of each other. This motivates one to inspect the following matrix that is similar to $B$:
$$
C=\pmatrix{1&-1&0\\ 0&1&0\\ 0&0&1}
\pmatrix{2b+1&-2b-2&b-2\\ 2b-1&-2b&b-2\\ -6&6&-1}
\pmatrix{1&1&0\\ 0&1&0\\ 0&0&1}
=\left(\begin{array}{c|cc}2&0&0\\ \hline2b-1&-1&b-2\\ -6&0&-1\end{array}\right).
$$
The only repeated eigenvalue of $C$ is the eigenvalue $-1$ of multiplicity $2$. Hence $B$ and $C$ are diagonalisable if and only if $\operatorname{nullity}(C+I)=2$, i.e. if and only if $b=2$.
</s>