So i'm trying to solve this problem from Jin Ho Kwak's book on linear algebra: Find all the solutions for the equation $\det (AB)=0$ where \begin{align}A&=\begin{pmatrix}x+2 &3x\\3 &x+2\end{pmatrix}\\ \\ B&=\begin{pmatrix} x &0\\5&x+2\end{pmatrix}\end{align}
I can't seem to get the right answer, acoording to the answer sheet at the end it should be $\{-2,0,1,4\}$ but what I get by just trying to use that $\det(AB)=\det(A)\det(B)$ doesn't match. I don't understand what I should be doing.
Thanks for any help, sorry, I don't know how to write out the matrices properly.
Recall that $\det(AB)=\det(A)\det(B)$. So $\det(AB)=0$ if and only if at least one of $\det A$ and $\det B$ is zero. We compute $$\det A = \begin{vmatrix}x+2 & 3x\\ 3 & x+2\end{vmatrix} = (x+2)^2-9x=x^2-5x+4=(x-4)(x-1) $$ and $$\det B = \begin{vmatrix}x & 0 \\ 5 & x+2\end{vmatrix} = x(x+2). $$ From this it follows that $\det A=0$ for $x=4$, $x=1$ and $\det B=0$ for $x=0$, $x=-2$.