a) From (A−B)2=O2 follows det(A−B)=0 and Tr(A−B)=0, hence Tr(A)=Tr(B)=:a.
Denote b=det(A)−det(B). Then
{A2−aA+det(A)I2=O2B2−aB+det(B)I2=O2
This shows that det(A2−B2)=det(a(A−B)−bI2). On the other hand, det(a(A−B)−bI2)=a2det(A−B)−abTr(A−B)+b2=b2, whence det(A2−B2)=(det(A)−det(B))2.
b) Let f:R→R be the function given by
f(x)=det(A2−B2+x(AB−BA)),x∈R.
Then f(x)=det(A2−B2)+cx+det(AB−BA)x2, x∈R, where c is a real constant. From f(1)=f(−1)=det(A−B)det(A+B)=0 follows c=0 and det(A2−B2)+det(AB−BA)=0. Now (a) leads to (det(A)−det(B))2=−det(AB−BA), whence the conclusion.