I was looking over the solution of a problem and don't understand how they expanded the determinant.
The problem:
Let $A$, $B$ be square $2 \times 2$ real matrices, such that $(A-B)^2 =O$ (where $O$ is the $2 \times 2$ matrix with all elements $0$). Prove that $\det (A^2-B^2)=(\det(A)-\det(B))^2$.
So far I can prove that: $\det(A-B) =0$, $Tr(A-B) =0$ so $Tr(A) =Tr(B) := a.$
We let $b :=\det A-\det B$.
From Cayley-Hamilton we have
$A^2-aA+\det(A)I=O$
$B^2-aB+\det(B)I=O$
It follows that $\det(A^2-B^2)=\det(a(A-B)-bI)$.
I looked over the given solution and to arrive at the needed conclusion they expanded the determinant in the following manner:
$\det(a(A-B)-bI)=a^2\det(A-B)-abTr(A-B)+b^2=b^2$
I suppose they used a form of Cayley-Hamilton again but I can't figure out how.
Note: $I$ represents the $2 \times 2$ identity matrix