Prove $\det((AB)^{n}-(BA)^{n})$ is a perfect cube. We have $A,B$ two $3×3$ matrices with integer numbers. We know that $(AB)^{2}+BA=(BA)^2+AB$.
a) Show that $\det((AB)^{n}-(BA)^{n})$ is divisible by $det(AB-BA)$.
b) Show that if $\det(AB-BA)=1$, then $\det((AB)^{n}-(BA)^{n})$ is a perfect cube.
I have tried taking the trace in the first  equality but nothing interesting. Maybe will help us rewriting $\det(AB-BA)$ as $Tr((AB-BA)^{3})/3$? It feels like we need to use some induction here but I dont know what is the "induction general form". I see we can rewrite $\det(AB-BA)=\det((AB)^{2}-(BA)^{2})$. I think that perfect cube will come from a determinant rewriting in polynomial form, but I dont know how we can rewrite it as a polynomial.
 A: Since $AB$ is an integer matrix, its characteristic polynomial $\det(xI-AB)$ has integer coefficients. Let us write it as
$$
x^3-a_3x^2-b_3x-c_3.
$$
So, for every $n\ge3$ we have
$$
(AB)^n=a_n(AB)^2+b_nAB+c_nI
$$
where the case $n=3$ is a consequence of Cayley-Hamilton theorem and when $n>3$, $a_n,b_n$ and $c_n$ are integer coefficients obtained by the following recurrence relations:
$$
\begin{aligned}
a_n&=a_{n-1}a_3+b_{n-1},\\
b_n&=a_{n-1}b_3+c_{n-1},\\
c_n&=a_{n-1}c_3.\\
\end{aligned}
$$
As $AB$ and $BA$ have the same characteristic polynomial (Sylvester's secular theorem), we also have
$$
(BA)^n=a_n(BA)^2+b_nBA+c_nI.
$$
Let $f(n)=\det\left((AB)^n-(BA)^n\right)$. Then $f(0)=0$ and $f(1)=\det(AB-BA)$. By the given condition, we have $(AB)^2-(BA)^2=AB-BA$, so that $f(2)=\det(AB-BA)$ too. When $n\ge3$,
$$
\begin{aligned}
f(n)&=\det\left((AB)^n-(BA)^n\right)\\
&=\det\left(a_n\left((AB)^2-(BA)^2\right)+b_n(AB-BA)\right)\\
&=\det\left((a_n+b_n)(AB-BA)\right)\\
&=(a_n+b_n)^3\det(AB-BA).\\
\end{aligned}
$$
Hence the results follow.
