8

Let $A$ and $B$ be square matrices, so that it is possible to add or multiply them with themselves and with each other.

Can algebraic identities such as $(A+B)^2=A^2+2AB+B^2$ apply to them?

Mateen Ulhaq
  • 1,211
Rav Rk
  • 83
  • 2
    Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to. – José Carlos Santos Jul 16 '22 at 12:33
  • 4
    $(A+B)^2 = A^2+B^2+AB+BA$, whether $AB=BA$ depends on the particular matrices. – peterwhy Jul 16 '22 at 12:35
  • 1
    @peterwhy Do you mean that if commutative property holds true, only then the matrices follow identities – Rav Rk Jul 16 '22 at 12:39
  • 2
    @RavRk The identity is $(A+B)^2 = A^2+B^2+AB+BA$, which holds regardless of whether $AB=BA$. – peterwhy Jul 16 '22 at 12:41
  • 1
    @peterwhy AB and BA have to exist, and in my case they of course exist because A and B are square matrices . And if AB =BA,then i can use 2AB – Rav Rk Jul 16 '22 at 12:48
  • 2
    @RavRk If the matrices commute, then all the power identities, i.e. $(A+B)^2, (A+B)^3$ all the way upto the general binomial theorem for positive integral index, all hold true. – insipidintegrator Jul 16 '22 at 12:50
  • 1
    Since you haven't accepted the answer yet, I'll add my two cents. Yes, you can do algebraic manipulation to expressions involving matrices, assuming matrices satisfy all the step-by-step rules applied. That's what we're doing when we write $(A + B)^2 = (A + B)(A + B) = A^2 + AB + BA + B^2$, we're using the distributive law. It's not always true that $AB = BA$ for matrices, so it's not true that $(A + B)^2 = A^2 + 2AB + B^2$ for them either. (1/2) – user3002473 Jul 16 '22 at 21:21
  • 1
    You could even take a step back and ask yourself "how do I know $A + B = B + A$ holds for matrices?" It's a matter of knowing which rules do and don't work for them (if you want a full list, the set of square matrices forms a "ring"). But "identities" are just concise ways of grouping a bunch of basic algebraic rules together: $(a + b)^2 = a^2 + 2ab + b^2$ (in a commutative setting) is just two applications of distributivity, and an application of commutativity of multiplication (and addition). You'll get the hang of it the more you work with matrices. (2/2) – user3002473 Jul 16 '22 at 21:24
  • 1
    @user3002473 I feel like if you want to get really technical in this case you actually also used distributivity in reverse to get $ab+ab=(1+1)ab=2ab$. – Fishbane Jul 17 '22 at 04:35
  • Another difference to watch is that not all non-zero matrices have an inverse. You cannot deduce $B=C$ from $AB=AC$ even if you know $A \neq 0$. – badjohn Jul 17 '22 at 06:02
  • @Fishbane that's a good point to include, as we might end up with a different identity in a ring of characteristic 2 (in which case $(a + b)^2 = a^2 + b^2$), though I figured that might've been a little outside the scope of OP's question. Nonetheless an important detail to include for the punctilious reader, so thanks! – user3002473 Jul 18 '22 at 18:50

2 Answers2

13

Matrix multiplication is not (in general) commutative.

So $(A+B)^2=(A+B)(A+B)=A^2+AB+BA+B^2$.

You can't (generally) combine the $AB$ and $BA$ terms, since this step would require $BA=AB$.

paw88789
  • 40,402
  • 1
    But what is showcased in the answer is that distributivity does hold for square real or complex matrices. – qwr Jul 16 '22 at 23:56
6

The algebra of matrices is not the same as the algebra of (real or complex) numbers. The two main differences are

  1. Any two numbers can be multiplied, but only matrices of "compatible dimension" can be multiplied

  2. The product of any two numbers is independent of the order, but only some pair of matrices have this property

If you limit yourself to square matrices, you can eliminate the first issue, but they still may not commute in general.

This is a great motivation for understanding proofs. If you can carefully prove that $(A+B)^2 = A^2 + 2AB + B^2$ for real numbers $A$ and $B$, you can repeat that proof for an algebra which is not commutative and see not only where it falls apart, but what the adjusted identity should be -- in this case, $(A+B)^2 = A^2 + AB + BA + B^2$.

As you advance in math, you will come across various different algebras that have different combinations of properties such as associativity, commutativity, invertibility, etc.; instead of memorizing a whole sheet of identities for each and every one, it would behoove you to be able to derive those properties from the ones given by definition. An introductory text on abstract algebra would be a great place to start if you're interested in learning more.

Alex Jones
  • 8,990
  • 13
  • 31