Problem of finding values of $ a $ for which two matrices are similar Problem: Let $A=\left(\begin{array}{ccc}1 & 2 & 3 \\ 1 & 2 & 7-a^{2} \\ 2 & 2+a & 6\end{array}\right) $ , $ B=\left(\begin{array}{lll}0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 9\end{array}\right)$ where $ a \in \mathbb{R} $. Find all the values of $ a $ for which $ A $ is similar to $ B $
Attempt:
We know the necessary conditions for two matrices to be similar are:
Their traces are equal
They have the same determinant
They have the same characteristic polynomial
They have the same eigenvalues
Their ranks are equal
Thus, $ |A| = [ 12 - (7-a^2)(2+a) ] - 2[ 6-2(7-a^2)] + 3[ 2+a - 4 ] =  (2-a)^2\cdot (2+a) $,
$ |B| = 0 $, hence $ |A| = 0 $ and therefore either $ a= 2 $ or $ a = -2 $
The characteristic polynomial of $ B $ is $ \Delta_B(x) = x^2(9-x) $
How do I continue from here? I'm stuck. ( I thought to jordanize $ A $ and $ B $ but that seems to really complicate things [ jordanizing $ A $ seems really hard here ], I also thought I'd find the eigenspaces of the eigenvalues of $ B $ but I still wasen't sure how I'd continue from there )
Thanks in advance for help!

You have $\det(A)=a^3-2a^2-4a+8$. On the other hand, if $a=\pm2$, then the first two line of $A$ will be equal, and therefore $\det(A)=0$. And if you divide $\det(A)$ by $(a+2)(a-2)$, then you will get $a-2$, and therefore $\det(A)=0\iff a=\pm2$. So, since $\det(B)=0$, we only have to consider the cases $a=2$ and $a=-2$. But, if $a=-2$, then the characteristic polynomial of $A$ is $-\lambda ^3+9 \lambda ^2-12 \lambda$, whereas the characteristic polynomial of $B$ is $-\lambda^3+9\lambda^2$. So, the only possibility that remains is that $a=2$ (in which case the characteristic polynomial is $-\lambda^3+9\lambda^2$. The roots of the characteristic polynomial are then $0$ and $9$. Besides, the eigenvectors corresponding to the eigenvalue $9$ are the multiplies of $(1,1,2)$, whereas $(-3,0,1)$ and $(-2,1,0)$ are linearly independent eigenvectors corresponding to the eigenvalue $0$. So, $A$ is similar to $B$ in the case $a=2$.
