When does this equality hold: $(A + B)^2 = A^2 + B^2$? Where $A$ and $B$ are matrices.

Solution 1:

Yes. There are no such values.

For $AB+BA=0$, we must have $$a=2,b=4$$ and $$4a-b+2=0$$ that is simply not possible.