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. 
 A: 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*}$$
A: 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.
