TITLE: A strange matrix equality
QUESTION [10 upvotes]: Let $A$ and $B$ be $n\times n$ real matrices.
When $n=2$, we have the equality
$$A\Big(\mbox{Trace}(B)A-\mbox{Trace}(A)B\Big) B=B\Big(\mbox{Trace}(B)A-\mbox{Trace}(A)B\Big) A.$$

Can we give an interpretation to this equality?
Are there similar equalities when $ n = 3,4,...$?

REPLY [13 votes]: Let us rewrite it using the commutators $[P,Q]=PQ-QP$, as follows:
 $$
tr(B)[A^2,B]=tr(A)[A,B^2].
 $$
Now, for matrices $X$ of size~$2$, we have $X^2=tr(X)X-det(X)I$ (a particular case of Cayley--Hamilton), so
 $$
tr(B)[tr(A)A-det(A)I,B]=tr(A)tr(B)[A,B]=tr(A)[A,tr(B)B-det(B)I],
 $$
since $I$ commutes with everything. 
This might be the most economic proof of your identity; moreover, it is known (Procesi, Razmyslov) that every identity with traces for $n\times n$-matrices does follow from the Cayley--Hamilton identity, so generalisations of your identity should be obtained in a similar way.