Solution:
Key idea: Both IA and AI equal A, so the matrices A and I commute, so (A−I)3 and (A+I)3 can be expanded like ordinary binomials. Then the condition A2=I simplifies every power of A.
Step 1 — Find A3 from A2=I.
We write A3 as A2⋅A and use A2=I.
A3=A2⋅A
A3=I⋅A
A3=A
Step 2 — Expand (A−I)3.
The binomial expansion holds because A and I commute. Every power of I is I, and A2I=A2.
(A−I)3=A3−3A2+3A−I
We put A3=A and A2=I.
(A−I)3=A−3I+3A−I
(A−I)3=4A−4I
Step 3 — Expand (A+I)3.
This expansion is the same except that every term is added.
(A+I)3=A3+3A2+3A+I
(A+I)3=A+3I+3A+I
(A+I)3=4A+4I
Step 4 — Combine the terms.
We add the two results and subtract 7A. The I terms cancel.
(A−I)3+(A+I)3−7A=(4A−4I)+(4A+4I)−7A
(A−I)3+(A+I)3−7A=8A−7A
(A−I)3+(A+I)3−7A=A
Therefore, (A−I)3+(A+I)3−7A=A.