A solution of matrix problem appears to be as follows

some one explain the following in the solution
why is A cube is eliminated and fourth power of A is obtained?
In the seventh line

In the third term why the power of A is not expressed in variable but in a constant?
Why it is again multiplied by square of A and fourth power of A is eliminated?
someone help me please
following from what @bob.sacamento wrote you will notice that: $$ \begin{align} A^2(A^2-abI) &= A^4-abA^2 \\ &= abA^2+A^3-abA -abA^2\\ &= abA+A^2-abI-abA \\ &=A^2 -abI \end{align} $$ with the help of this identity the inductive step follows easily. thus if $$ A^p-A^{p-2}-A^2+abI =0 $$ we may write this as: $$ A^{p-2}(A^2-I) = A^2 - abI $$ multiplying by $A^2$ and using the result above gives: $$ A^p(A^2-I) = A^2 - abI $$