(A-B)*(A+B) = A*A - B*A + A*B - B*B = (A^2 - B^2) + (A*B - B*A). From this identity, which is valid for all matrices ALWAYS, you can easily conclude that (A-B)*(A+B) = A^2 - B^2 if and only if A*B - B*A = 0. It is the same as to say that (A-B)*(A+B) = A^2 - B^2 if and only if A*B = B*A.