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.

Here's something I call the "miracle method" for this type of problem. Suspend your disbelief for a moment and suppose $A$ and $B$ were scalars, not matrices. Then, we would simply be looking for
$$ \frac{1}{B} = \frac{1}{A^2 - 2A - 2} = \frac{1}{2}+\frac{A}{2}+\frac{A^2}{4}-\frac{A^4}{8}-\frac{A^5}{8} + \cdots$$
where in the power series expansion, the coefficient of $A^n$ is
$$ c_n = \frac{1+i}{2^{n+2}} \left((1-i)^n-i (1+i)^n\right). $$
But we know that $A^3 = 2$, so this becomes
$$ \frac{1}{2}+\frac{A}{2}+\frac{A^2}{4}-\frac{A^4}{8}-\frac{A^5}{8} + \cdots = \frac{1}{2}+\frac{A}{2}+\frac{A^2}{4}-\frac{A}{4}-\frac{A^2}{4} + \cdots $$
and by summing the resulting coefficients on $1$, $A$, and $A^2$, we find that
$$ \frac{1}{B} = \frac{2}{5} + \frac{3}{10}A + \frac{1}{10}A^2. $$
Now, what we've just done should be total nonsense if $A$ and $B$ are really matrices, not scalars. But try setting $B^{-1} = \frac{2}{5}I + \frac{3}{10}A + \frac{1}{10}A^2$, and you'll find that, miraculously, this answer works!
