# How do you FOIL (x-1)(x+2)(x-3)?

May 24, 2015

The quick answer is "You don't"

FOIL is only suitable for multiplying 2 binomials.

However, inspired by FOIL we can invent a new scheme that will do the job. I'll call it TREFOIL - short for Triple Regular Extension of First Outside Inside Last.

Writing L for Left and R for Right, notice that the pairs of expressions chosen by FOIL in turn are LL, LR, RL, RR.

For TREFOIL, we'll use LLL, LLR, LRL, RLL, LRR, RLR, RRL, RRR.
This is almost like binary counting with 3 digits instead of 2, except that I have reversed the middle pair to improve grouping.

Applying TREFOIL, the separate multiples are:

LLL: $\left(x \cdot x \cdot x\right) = {x}^{3}$
LLR: $\left(x \cdot x \cdot - 3\right) = - 3 {x}^{2}$
LRL: $\left(x \cdot 2 \cdot x\right) = 2 {x}^{2}$
RLL: $\left(- 1 \cdot x \cdot x\right) = - {x}^{2}$
LRR: $\left(x \cdot 2 \cdot - 3\right) = - 6 x$
RLR: $\left(- 1 \cdot x \cdot - 3\right) = 3 x$
RRL: $\left(- 1 \cdot 2 \cdot x\right) = - 2 x$
RRR: $\left(- 1 \cdot 2 \cdot - 3\right) = 6$

$\left(x - 1\right) \left(x + 2\right) \left(x - 3\right)$

$= {x}^{3} - 3 {x}^{2} + 2 {x}^{2} - {x}^{2} - 6 x + 3 x - 2 x + 6$

$= {x}^{3} - 2 {x}^{2} - 5 x + 6$

As a quick check, let's substitute $x = 4$ (not one of the roots) and see if this last expression agrees with the first.

$\left(x - 1\right) \left(x + 2\right) \left(x - 3\right)$

$= \left(4 - 1\right) \left(4 + 2\right) \left(4 - 3\right)$

$= 3 \cdot 6 \cdot 1 = 18$

${x}^{3} - 2 {x}^{2} - 5 x + 6$

$= {4}^{3} - \left(2 \cdot {4}^{2}\right) - \left(5 \cdot 4\right) + 6$

$= 64 - 32 - 20 + 6 = 18$