# Factoring by Grouping

You can sometimes factor a difficult-looking polynomial by making creative use of the distributive property.

Example 1:

Factor $2xy-6xz+3y-9z$.

You can get a clue from the coefficients: we have a $2$ and a $-6$, and we also have a $3$ and a $-9$. There is a proportional relationship here which can be exploited!

Factor $2x$ out of the first two terms:

$2xy-6xz+3y-9z=2x\left(y-3z\right)+3y-9z$

Then factor $3$ out of the second two terms.

$=2x\left(y-3z\right)+3\left(y-3z\right)$

Since the same quantity $y-3z$ appears twice, we can use the distributive property to write this more simply:

$=\left(2x+3\right)\left(y-3z\right)$

Example 2:

Factor ${x}^{2}+xy+3x+3y$.

Group the terms as follows:

${x}^{2}+xy+3x+3y=\left({x}^{2}+3x\right)+\left(xy+3y\right)$

Both groups have $x+3$ as a factor.

$\begin{array}{l}=x\left(x+3\right)+y\left(x+3\right)\\ =\left(x+y\right)\left(x+3\right)\end{array}$