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}).$$
 A: 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$$
A: An alternative, with the additional assumption that both $A$ and $B$ are diagonalizable: Then, since they commute we can write 
$$A=PD_AP^{-1}, B=PD_BP^{-1}$$
where $D_A$ and $D_B$ are diagonal matrices. We have
$$A^{3}=PD_A^{3}P^{-1}, B^{3}=PD_B^{3}P^{-1}$$
and 
$$det(A^{3}+B^{3})=det(P(D_A^{3}+D_B^{3})P^{-1})=det(D_A^{3}+D_B^{3}).$$
Now, let the diagonal of $D_A$ be $(a_1, a_2, a_3)$ and that of $D_B$ analogously. Thus we get
$$det(D_A^{3}+D_B^{3})=(a1^{3}+b_1^{3})(a_2^{3}+b_2^{3})(a_3^{3}+b_3^{3})$$
We know since $det(A)=det(B)=0$ that at least one of $a_1,a_2,a_3$ must be zero. The same holds for $B$. Now, we can identify two cases:


*

*$det(A^{3}+B^{3})=0$   This corresponds to the case when $a_i=b_i=0$ for some $i$ (i.e. the eigenvalue at the same position is zero). Then, $p=q=0$ solves the problem.

*$det(A^{3}+B^{3})\neq 0$. This means that $a_ib_i\neq 0$ for all $i=1,2,3$. W.l.o.g. assume $a_1=0, b_2=0$. Then $det(A^{3}+B^{3})=b_1^{3}a_2^{3}(a_3^{3}+b_3^{3})=(b_1a_2a_3)^{3}+(b_1a_2b_3)^{3}$ proving the second case.
