FOIL Method - Generalizations

Generalizations

The FOIL rule cannot be directly applied to expanding products with more than two multiplicands, or multiplicands with more than two summands. However, applying the associative law and recursive foiling allows one to expand such products. For instance,

Alternate methods based on distributing forgo the use of the FOIL rule, but may be easier to remember and apply. For example,

\begin{align}
(a+b+c+d)(x+y+z+w)&=(a+(b+c+d))(x+y+z+w) \\
&=a(x+y+z+w)+(b+c+d)(x+y+z+w) \\
&=a(x+y+z+w)+(b+(c+d))(x+y+z+w) \\
&=a(x+y+z+w)+b(x+y+z+w) \\
&\qquad +(c+d)(x+y+z+w) \\
&=a(x+y+z+w)+b(x+y+z+w) \\
&\qquad +c(x+y+z+w)+d(x+y+z+w) \\
&=ax+ay+az+aw+bx+by+bz+bw \\
&\qquad +cx+cy+cz+cw+dx+dy+dz+dw.
\end{align}

Read more about this topic:  FOIL Method