# Why can you multiply out?

$$(a+b)(c+d)=ac+ad+bc+bd$$ Why is this? Is there a proof to this? And there is something similar in logic.

$$(A \land B)\lor (C \land D)=(A \lor C)\land(A \lor D)\land(B \lor C)\land(B\lor D)$$ Why is this? I used it all my life but I don't know why it works.

-
The keyword here is "distributivity." See en.wikipedia.org/wiki/Distributive_property . –  Qiaochu Yuan Jul 16 '12 at 0:23
Well, it depends on what number (logic?) system you're working in. But with many such systems - the integers, the rationals, the reals - you have a property called distributivity, which says that $(a+b)(c)$ = $ac + bc$. Apply this twice, and your identity holds in those number systems. –  Chris Jul 16 '12 at 0:23
The greeks had nice graphic proofs for such things. Look at this. –  phg Jul 16 '12 at 8:16

It's called the distributive laws and the associative laws.

For numbers, addition and multiplication satisfy the following properties:

Associativity. For all $x,y,z$, $(x+y)+z = x+(y+z)$ and $(xy)z = x(yz)$.

Distributivity of $\times$ over $+$. For all $x,y,z$, $x(y+z) = (xy)+(xz)$ and $(y+z)x = (yx)+(zx)$.

These are properties that these operations satisfy. Not every operation does. for example, subtraction of numbers is not associative, and $+$ does not distribute over $\times$. Your first equation follows from the properties above: \begin{align*} (a+b)(c+d) &= (a(c+d)) + (b(c+d)) &&\text{(distributivity)}\\ &= \Bigl( (ac)+(ad)\Bigr) + \Bigl((bc) + (bd)\Bigr) &&\text{(distributivity twice)}\\ &= (ac)+(ad) + (bc)+ (bd) &&\text{(associativity allows the drop of parentheses)}\\ &= ac+ad+bc+bd &&\text{(precedence of operations: \times goes before +)} \end{align*}

With logical connectives $\land$ (and) and $\lor$ (or), you have two distributive laws: $\land$ distributes over $\lor$: $$P\land(Q\lor S) = (P\land Q)\lor (P\land S)$$ and $\lor$ distributes over $\land$: $$P\lor(Q\land S) = (P\lor Q)\land (P\lor S).$$

So we have: \begin{align*} (A\land B)\lor (C\land D) &= (A\lor(C\land D)) \land (B\lor(C\land D))\\ &= (A\lor C)\land(A\lor D)\land (B\lor C)\land (B\lor D) \end{align*}

-

This is a consequence of the distributive property. We have that $$\begin{eqnarray} (a+b)(c+d) &=& a(c+d)+b(c+d)\\ &=& ac+ad+bc+bd \end{eqnarray}$$ thanks to left and right-distribution. A similar rule holds in logic, which is discussed in the Wikipedia page I linked to.

-