# College Algebra/FOIL and algebraic manipulation

FOIL is an abbreviation for the words first, outer, inner, and last. It is a mnemonic to help with polynomial multiplication.

Take a look at this example of multiplying two linear monomials:

${\displaystyle (x+3)(x+4)\,\;}$

There are 4 distinct products which have to be computed. Here they are highlighted:

first - ${\displaystyle ({\mathbf {x}}+3)({\mathbf {x}}+4)\,\;}$
outer - ${\displaystyle ({\mathbf {x}}+3)(x+{\mathbf {4}})\,\;}$
inner - ${\displaystyle (x+{\mathbf {3}})({\mathbf {x}}+4)\,\;}$
last - ${\displaystyle (x+{\mathbf {3}})(x+{\mathbf {4}})\,\;}$

The product of the highlighted terms gives:

first - ${\displaystyle x^{2}\,\;}$
outer - ${\displaystyle 4x\,\;}$
inner - ${\displaystyle 3x\,\;}$
last - ${\displaystyle 12\,\;}$

${\displaystyle (x+3)(x+4)=x^{2}+7x+12\,\;}$
Multiply ${\displaystyle (a+b+c)\,\;}$ with ${\displaystyle (d+e+f)\,\;}$.
Solution: The easiest way to remember to do all the combinations is to do it systematically. First take ${\displaystyle a\,\;}$ and multiply it with ${\displaystyle (d+e+f)\,\;}$. You get ${\displaystyle (ad+ae+af)\,\;}$. Then multiply ${\displaystyle b\,\;}$ by ${\displaystyle (d+e+f)\,\;}$. You get ${\displaystyle (bd+be+bf)\,\;}$. Finally, multiply ${\displaystyle c\,\;}$ by ${\displaystyle (d+e+f)\,\;}$. You get ${\displaystyle (cd+ce+cf)\,\;}$. Add all three of these results and you get ${\displaystyle (ad+ae+af)+(bd+be+bf)+(cd+ce+cf)\,\;}$. Take out the parenthesis and you get ${\displaystyle ad+ae+af+bd+be+bf+cd+ce+cf\,\;}$.