Prove an equality of complex matrixes 
If $A \in M_2(\mathbb{C})$ a matrix so that $$\det\left(A^2 + A +
 I_2\right)=\det\left(A^2 - A + I_2\right)=3 \tag1$$ then $$A^2\left(A^2 + I_2\right)=2I_2. \tag2$$


I tried to use Cayley-Hamilton theorem, without success. I think one step might be to prove $A$ is invertible.
Meanwhile I found (2) is equivalent to:
$\left(A^2 -I_2\right)\left(A^2 +2I_2\right)=O_2. \tag3$
 A: Hint: Equation $(1)$ implies that either $tr(A)=0$ or $\det(A)=-1$. Using Cayley-Hamilton, we obtain in both cases (together with $(1)$ again) that $(A^2-I)(A^2 +2I)=0$.
A: First of all, observe that if $A$ satisfies either (1) or (2), then so does $TAT^{-1}$. Thus it suffices to discuss this for $A$ in Jordan normal form, and this we can do by a brute force calculation. We have the conditions
$$
(\lambda_1^2+\lambda_1+1)(\lambda_2^2+\lambda_2+1)= (\lambda_1^2-\lambda_1+1)(\lambda_2^2-\lambda_2+1)= 3 \quad\quad\quad\quad (3)
$$
on the eigenvalues of $A$. It's easy to check that these can not be satisfied with $\lambda_2=\lambda_1$, so $A$ is in fact diagonalizable. If we write $\lambda_2=d/\lambda_1$ and subtract the two resulting order $4$ equations for $\lambda_1$, we see that $\lambda_1=0$ or $\lambda_1^2=-d$. We can easily rule out the first alternative. It then follows that $\lambda_2=-\lambda_1$, so, returning to (3), we obtain that
$$
(\lambda^2+\lambda+1)(\lambda^2-\lambda+1)= 3 ,
$$
or, equivalently $\lambda^2(\lambda^2+1)=2$
for both $\lambda_1$ and $\lambda_2$, and this is what we wanted to show.
