<s>[INST] What will be the value of $\det(A^2+B^2)$? Let $A$ and $B$ be two $n\times n$ matrices such that $A \not=B, A^3 = B^3$ and $A^2 B = B^2 A$. Then what is the value of $\det \left( A^2 + B^2 \right)$?
Here I have done something.
$$A^3 = B^3 \implies(A-B)(A^2+B^2+AB)=0$$
Is my work right? Then how to do further? Well, I did mistakes here. But how can find the value of $\det(A^2+B^2)$?
 [/INST] the following observation may help:
set $X=A^2+B^2$
then
$$
XA=A^3+B^2A = B^3 + A^2B = XB
$$
so
$$
X(A-B) = 0
$$
</s>