<s>[INST] Prove that there exist integers $p$ and $q$ such that $\det(A^3+B^3) = p^3+q^3$ 
Let $A$ and $B$ be $3 \times 3$ matrices with integer entries so that $AB = BA$ and $\det(A) = \det(B) = 0$. Prove that there exist integers $p$ and $q$ such that $\det(A^3+B^3) = p^3+q^3$.

I thought about factorizing $A^3+B^3$. We have $$A^3+B^3 = (A+B)(A^2-AB+B^2).$$ Then we have $$\det(A^3+B^3) = \det(A+B)\det(A^2-AB+B^2).$$ How do we use the fact that $A$ and $B$ are $3 \times 3$? For $3 \times 3$ matrices is it true that $\det(A+xB) = x(a+bx)$ where $a,b$ are integers? If so, then we have since $$A^2-AB+B^2 = (A-e^{2\pi i/3}B)(A-e^{-2\pi i/3}B),$$ that $$\det(A^3+B^3) = (a+b)(a-be^{2\pi i/3})(a-be^{-2 \pi i/3}).$$
 [/INST] In general it is not true that $\det(A+xB) = x(a+bx)$, but in this case you can prove it.
Consider the polynomial 
$$P(X)=\det(A+XB)$$
This is a polynomial of degree at most $3$ with integer coefficients (this is an easy exercise, just write out the formula for the determinants). Write it as 
$$
P(x)=aX^3+bX^2+cX+d
$$
You know that $P(0)=\det(A)=0$. Hence, $d=0$.
Moreover, for $x \neq 0$.
$$a+bX+cX^2+dX^3=X^3 P(\frac{1}{X})=  X^3 \det(A+\frac{1}{X}B)=\det(XA+B)$$
Since those polynomials agree for $x \neq 0$, it follows they also agree for $x=0$. Plugging in  $x=0$ you get
$$a=\det(B)=0$$
Therefore, $\det(A)=0$ and $\det(B)=0$ implies $a=d=0$ and hence
$$\det(A+XB)=cX^2+dX$$
Now to complete the proof, use your last formula:
$$\det(A^3+ B^3)=\det(A+B)\det(A+\omega B)\det(A+\omega^2B)\\=(c+d)(c\omega^2+d\omega)(c\omega^4+d\omega^2)=c^3+d^3$$
where $\omega$ is one of the complex roots to 
$$\omega^3+1=0$$
</s>