# Why does $\frac{(x^2 + x-6)}{x-2} = \frac{(x+3)(x-2)}{x-2}$?

I'm not the best at algebra and would be grateful if someone could explain how you can get from,

$$\frac{x^2 + x-6}{x-2}$$

to,

$$\frac{(x+3)(x-2)}{x-2}$$

-
You probably know, or once knew, how to factor $x^2+x-6$. – André Nicolas Jun 1 '14 at 20:58

\begin{align} x^2+x-6 = x^2 + \underbrace{3x - 2x} - 6 & = \underbrace{x^2+3x}+\underbrace{{}-2x-6} \\[8pt] & = x(x+3) + (-2)(x+3) \\[8pt] & = x(\cdots\cdots) + (-2)(\cdots\cdots) \\[8pt] & = x(\cdots\cdots) -2(\cdots\cdots) \\[8pt] & = (x-2)(\cdots\cdots) \\[8pt] & = (x-2)(x+3). \end{align}

-

Try working backwards. Notice that the denominator does not change, so let's focus on the numerator:

$$(x+3)(x-2) = x\cdot x-2x+3x-2\cdot 3 \,\,\,\,\,\,\text{FOIL}.$$

If we look at like terms (meaning equal powers of $x$), we see that we have two pieces that have $x$ that we can simplify: $-2x+3x = (-2+3)x = x.$ As for the other bits, we have $x\cdot x$ which we can simplify to $x^2$ and also $2\cdot 3 = 6$. This gives us

$$(x+3)(x-2) = x^2+x-6.$$

-

All that was done was factoring the numerator. Notice that $$x^2+x-6=(x+3)(x-2)$$ because $(x+3)(x-2)=x^2-2x+3x-6=x^2+x-6$. Then it follows that $$\frac{x^2+x+6}{x-2}=\frac{(x+3)(x-2)}{x-2}$$

-

Note that the denominator of $\frac{(x^2 + x-6)}{x-2}$ and $\frac{(x+3)(x-2)}{x-2}$ is the same, so it remains to show that the numerators are the same; i.e. that $x^2+x-6\equiv(x+3)(x-2)$.

Now, $\color{green}{(x+3)(x-2)} \equiv x^2\underbrace{-2x+3x}_{\equiv \ +x}-6 \equiv \color{green}{x^2+x-6},$ as required.

To expand brackets, use the distributive property (i.e. the fact that multiplication is distributive over addition).

-

Key fact: Knowing the roots of a polynomial (where the polynomial equals zero), let us factor it.

So if $n$ and $m$ are two roots of the quadratic $ax^2+bx+c$, then we can factor it as $$ax^2+bx+c=a(x-n)(x-m).$$ The roots of a quadratic can be determined using the quadratic formula: $$x=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a}.$$

To find out the roots of the quadratic $x^2+x-6$ use the above formula and you'll find out that they are: $-3$ and $2$. Therefore we can write our polynomial as: $$x^2+x-6=(x-(-3))(x-2)=(x+3)(x-2).$$ Hence, it follows that: $$\require{cancel}\frac{x^2 + x-6}{x-2} = \frac{(x+3)\color{red}{\cancel{\color{black}{(x-2)}}}}{\color{red}{\cancel{\color{black}{x-2}}}}=x+3.\tag{assuming x\neq2}$$

-