Show that $B$ is invertible if $B=A^2-2A+2I$ and $A^3=2I$ If $A$ is $40\times 40$ matrix such that $A^3=2I$ show that $B$ is invertible where $B=A^2-2A+2I$. 
I tried to evaluate $B(A-I)$ , $B(A+I)$ , $B(A-2I)$ ...  but I couldn't find anything.

A few manipulations:
$$B=A^2-2A+2I$$
$$A^3 = 2I$$
then,
$$AB = A^3 -2A^2+2A \\= 2I -2A^2+2A \\= -2(A^2-2A+2I)-2A+6I \\= -2B -2A+6I$$
Now, the fact that $A^3 = 2I$ means $A$ is invertible, because $\det(A) \neq 0$
Thus,
$$B = -2A^{-1}B-2I+6A^{-1} $$
Take $B$ to one side:
$$B(I+2A^{-1}) = -2I+6A^{-1}$$
Multiply both side with $A$:
$$B(A+2I) = -2A+6I$$
I suppose those quantities will be similar. 
