TITLE: If $A$ and $B$ are $n×n$ matrices such that $AB=B$ and $BA=A$ then find the value of $A^{4} + B^{4} - A^{2} -B^ {2} + I$
QUESTION [8 upvotes]: The given question is

If $A$ and $B$ are $n×n$ matrices such that $AB=B$ and $BA=A$, then find the value of $A^{4} + B^{4} - A^{2} -B^ {2} + I$.

Any hints?

REPLY [12 votes]: Hint: $$A^2=A(BA)=(AB)A=BA=A$$