Factorization (or factoring) is the reverse of expansion: instead of multiplying out, we write an algebraic expression as a product of simpler ones. For example,
$ x^2 - 2x - 3 = (x-3)(x+1). $We say that $x-3$ and $x+1$ are factors of $x^2-2x-3$.

Quick Reference
| Method | Key Formula or Idea | When to Use |
|---|---|---|
| Common Factor | $ax+ay=a(x+y)$ | Always check this first |
| Difference of Squares | $A^2-B^2=(A+B)(A-B)$ | Two perfect squares with a minus sign |
| Perfect Square Trinomial | $A^2\pm2AB+B^2=(A\pm B)^2$ | Middle term equals $\pm 2AB$ |
| Difference of Cubes | $A^3-B^3=(A-B)(A^2+AB+B^2)$ | Two perfect cubes, minus sign |
| Sum of Cubes | $A^3+B^3=(A+B)(A^2-AB+B^2)$ | Two perfect cubes, plus sign |
| Inspection ($x^2+bx+c$) | Find integers $p,q$ with $p+q=b$ and $pq=c$ | Leading coefficient is 1 |
| Inspection ($ax^2+bx+c$) | Multiply by $a$; find $p+q=b$ and $pq=ac$ | General quadratic trinomial |
| Completing the Square ($x^2+px+q$) | Add and subtract $\tfrac{p^2}{4}$; apply $A^2-B^2$ | Always works, including irrational roots |
| Grouping | Group terms that share common factors | Four or more terms |
Why Is Factorization Important?
If we can write an equation in factored form $P \cdot Q = 0$, solving it reduces to solving two independent equations $P=0$ and $Q=0$. (Recall from Section: Sets of Numbers that if $ab=0$ then $a=0$ or $b=0$.) For example, because $x^2-2x-3=(x-3)(x+1)$, instead of solving
$ x^2-2x-3=0, $
we solve
$ x-3=0 \quad \text{and} \quad x+1=0, $
which gives at once
$ x=3 \quad \text{or} \quad x=-1. $
Similarly, because
$ x^3-8x^2+17x-10=(x-1)(x-2)(x-5), $
we immediately conclude
$ x^3-8x^2+17x-10=0 \iff x=1 \quad \text{or} \quad x=2 \quad \text{or} \quad x=5. $
Evaluating $x^3-8x^2+17x-10$ at those roots also reduces to a handful of arithmetic steps.
Factorization is not always possible, and even when it is, the factors are not always simpler. For example, $x^5-32$ factors into $(x-2)$ and $(x^4+2x^3+4x^2+8x+16)$, but solving $x^4+2x^3+4x^2+8x+16=0$ is harder than the original.
Another application is simplifying rational expressions. For example:
$ \frac{x^2-1}{x^2-2x-3} = \frac{(x-1)\cancel{(x+1)}}{(x-3)\cancel{(x+1)}} = \frac{x-1}{x-3} \qquad (x \neq -1). $
Now let's review the main factorization techniques.
Common Factors
When a factor appears in every term of an expression, factor it out using the distributive property in reverse.
Example. Factor each expression.
- $12x^3-15x^2$
- $4x^5-8x^4-16x^3-20x^2$
- $(2x-5)(3x-7)+4(3x-7)$
Solution
- The greatest common factor of $12x^3$ and $-15x^2$ is $3x^2$: $ 12x^3-15x^2 = 3x^2(4x-5). $
- The greatest common factor of all four terms is $4x^2$: $ 4x^5-8x^4-16x^3-20x^2 = 4x^2(x^3-2x^2-4x-5). $
- The common factor of $(2x-5)(3x-7)$ and $4(3x-7)$ is $(3x-7)$: $ \begin{aligned} (2x-5)(3x-7)+4(3x-7) &= (3x-7)\bigl[(2x-5)+4\bigr] \\ &= (3x-7)(2x-1). \end{aligned} $
Factoring fractional and negative exponents. In calculus, expressions with fractional or negative exponents often need to be factored. In that case, factor out the common base with the smallest exponent.
Example. Factor each expression.
- $x^{3/2}+4x^{1/2}-7x^{-1/2}$
- $(x-4)^{-3/5}+5(x-4)^{2/5}$
Solution
- The common base is $x$ and the smallest exponent is $-\tfrac{1}{2}$: $ x^{3/2}+4x^{1/2}-7x^{-1/2} = x^{-1/2}(x^2+4x-7). $ Check: $x^{-1/2}\cdot x^2 = x^{3/2}$ and $x^{-1/2}\cdot x = x^{1/2}$, as required.
- The common base is $(x-4)$ and the smallest exponent is $-\tfrac{3}{5}$: $ \begin{aligned} (x-4)^{-3/5}+5(x-4)^{2/5} &= (x-4)^{-3/5}\bigl[1+5(x-4)\bigr] \\ &= (x-4)^{-3/5}(5x-19). \end{aligned} $ Check: $(x-4)^{-3/5}\cdot 5(x-4)^1 = 5(x-4)^{2/5}$, using $-\tfrac{3}{5}+1=\tfrac{2}{5}$.
Special Factorization Formulas
When no common factor exists, the following formulas — each the reverse of a special product identity — often apply.
- $A^2-B^2=(A+B)(A-B)$ (Difference of Squares)
- $A^2\pm2AB+B^2=(A\pm B)^2$ (Perfect Square Trinomial)
- $A^3-B^3=(A-B)(A^2+AB+B^2)$ (Difference of Cubes)
- $A^3+B^3=(A+B)(A^2-AB+B^2)$ (Sum of Cubes)
How to remember Sum and Difference of Cubes: the SOAP rule. For a factored cubic $(A\pm B)(\ldots)$, the signs follow Same, Opposite, Always Positive.


Example. Factor each expression.
- $9x^2-49$
- $x^4-16$
- $x^2+10x+25$
- $x^3-27$
- $8x^3+64$
Solution
- Set $A=3x$ and $B=7$, then apply the Difference of Squares formula: $ \begin{aligned} 9x^2-49 &= (3x)^2-7^2 \\ &= (3x-7)(3x+7). \end{aligned} $
- Set $A=x^2$ and $B=4$: $ \begin{aligned} x^4-16 &= (x^2)^2-4^2 \\ &= (x^2-4)(x^2+4). \end{aligned} $ Since $x^2-4 = x^2-2^2$, apply the formula once more: $ \begin{aligned} x^4-16 &= (x^2-4)(x^2+4) \\ &= (x-2)(x+2)(x^2+4). \end{aligned} $
- Set $A=x$ and $B=5$. Since the middle term satisfies $10x = 2AB$, this is a Perfect Square Trinomial: $ x^2+10x+25 = (x+5)^2. $
- Set $A=x$ and $B=3$, then apply the Difference of Cubes formula: $ \begin{aligned} x^3-27 &= x^3-3^3 \\ &= (x-3)(x^2+3x+9). \end{aligned} $
- First factor out the common factor 8, then apply Sum of Cubes with $A=x$ and $B=2$: $ \begin{aligned} 8x^3+64 &= 8(x^3+8) \\ &= 8(x^3+2^3) \\ &= 8(x+2)(x^2-2x+4). \end{aligned} $
Example. Factor $9x^2-12xy+4y^2$.
Solution
Since $9x^2=(3x)^2$ and $4y^2=(2y)^2$, and the middle term satisfies $12xy=2(3x)(2y)$, this is a Perfect Square Trinomial with a negative middle sign: $ 9x^2-12xy+4y^2 = (3x-2y)^2. $Example. Factor $a^2+b^2+c^2+2ab+2ac+2bc$.
Solution
Regroup to reveal a perfect square pattern: $ \begin{aligned} a^2+2ab+b^2+2ac+2bc+c^2 &= (a+b)^2+2(a+b)c+c^2 \\ &= (a+b+c)^2. \end{aligned} $Example. Factor $x^2-y^2-z^2+2yz$.
Solution
$ \begin{aligned} x^2-y^2-z^2+2yz &= x^2-(y^2-2yz+z^2) \\ &= x^2-(y-z)^2 \\ &= (x+y-z)(x-y+z). \end{aligned} $ The last step applies the Difference of Squares formula $A^2-B^2=(A+B)(A-B)$ with $A=x$ and $B=y-z$.Example. Factor $x^4+x^2y^2+y^4$.
Solution
Add and subtract $x^2y^2$ to complete a perfect square, then factor as a difference of squares: $ \begin{aligned} x^4+x^2y^2+y^4 &= x^4+2x^2y^2+y^4-x^2y^2 \\ &= (x^2+y^2)^2-(xy)^2 \\ &= (x^2+y^2+xy)(x^2+y^2-xy). \end{aligned} $More Special Factorization Formulas. For any integer $n$:
- Difference, even exponent: $A^{2n}-B^{2n}=(A^n-B^n)(A^n+B^n)$
- Difference, any exponent: $A^n-B^n=(A-B)(A^{n-1}+A^{n-2}B+\cdots+AB^{n-2}+B^{n-1})$
- Sum, odd exponent: $A^n+B^n=(A+B)(A^{n-1}-A^{n-2}B+\cdots-AB^{n-2}+B^{n-1})$
- Sum, even exponent: $A^n+B^n$ cannot, in general, be factored over the reals.
Replacing $B$ by $-B$ in the difference formula (with $n$ odd) yields the sum formula.
Factoring x2 +bx+c by Inspection
Since
$ (x+p)(x+q) = x^2+(p+q)x+pq, $
a polynomial $x^2+bx+c$ factors over the integers whenever we can find integers $p$ and $q$ with
$ p+q=b \quad \text{and} \quad pq=c. $
By the Rational Root Theorem, when rational roots exist they must be integers, so we do not consider fractions such as $\tfrac{1}{2}$ or $\tfrac{3}{7}$ during inspection. In this section we find $p$ and $q$ by trial and error; a systematic method appears in the section on quadratic equations.
Example. Factor $x^2+13x+42$.
Solution
We seek two integers $p$ and $q$ such that $pq=42$ and $p+q=13$. Since $pq=42$ is positive, $p$ and $q$ must be either both positive or both negative. Since $p+q=13$ is positive, $p$ and $q$ must be both positive. Therefore, we seek two positive integers whose product is 42 and whose sum is 13. The positive factor pairs of 42 are: $42\times1$, $21\times2$, $14\times3$, $7\times6$. The pair with sum 13 is $7$ and $6$. $ x^2+13x+42 = (x+7)(x+6). $Example. Factor $x^2-9x-22$.
Solution
Since $pq=-9$ is negative, $p$ and $q$ have opposite signs. Since $p+q=-22$ is negative, the one with the greater absolute value must be negative. Testing: $-22\times1$, $-11\times2$. The pair $-11$ and $2$ gives $-11+2=-9$. $ x^2-9x-22 = (x-11)(x+2). $Example. Factor $x^2-13x+22$.
Solution
Since $pq=22$ is positive and $p+q=-13$ is negative, both $p$ and $q$ must be negative. Testing negative factor pairs of 22, we find $-11$ and $-2$, since $(-11)+(-2)=-13$. $ x^2-13x+22 = (x-11)(x-2). $Example. Factor each expression.
- $x^2+3x+2$
- $x^2-2x-15$
Solution
- Find $p$ and $q$ with $p+q=3$ and $pq=2$. By trial: $p=2$, $q=1$. $ x^2+3x+2 = (x+2)(x+1). $
- Find $p$ and $q$ with $p+q=-2$ and $pq=-15$. By trial: $p=-5$, $q=3$. $ x^2-2x-15 = (x-5)(x+3). $
Factoring ax2 +bx+c by Inspection
It is sometimes possible to factor $ax^2+bx+c$ by inspection when $a$, $b$, and $c$ are integers.
Multiplying and dividing by $a$, we reduce the expression to the form
$ ax^2+bx+c = \frac{(ax)^2+b(ax)+ac}{a}, $
and then factor the numerator with respect to $ax$ by finding two integers whose product is $ac$ and sum is $b$.
Example. Factor $6x^2+7x-5$.
Solution
Multiply and divide by 6: $ 6x^2+7x-5 = \frac{(6x)^2+7(6x)-5\times6}{6} = \frac{(6x)^2+7(6x)-30}{6}. $ Let $u=6x$, then $ 6x^2+7x-5 = \frac{(6x)^2+7(6x)-30}{6}=\frac{u^2+7u-30}{6}. $ Now let's factor $u^2+7u-30$. We need two integers with product $-30$ and sum $7$. Since $pq$ is negative, the integers have opposite signs; since $p+q$ is positive, the larger in absolute value is positive. Factor pairs of $-30$: $30\times(-1)$, $10\times(-3)$, $6\times(-5)$. The pair $10$ and $-3$ satisfies $10+(-3)=7$. Therefore, $ u^2+7u-30 = (u+10)(u-3). $ Substitute $u=6x$: $ (6x)^2+7(6x)-30 = (6x+10)(6x-3). $ Divide by 6 and simplify: $ \begin{aligned} 6x^2+7x-5 &= \frac{(6x+10)(6x-3)}{6} \\ &= \frac{2(3x+5)\cdot 3(2x-1)}{6} \\ &= (3x+5)(2x-1). \end{aligned} $Example. Factor $2x^2+7x+3$.
Solution
Multiply and divide by 2, then find two integers with product $2\times3=6$ and sum $7$: they are $6$ and $1$. $ \begin{aligned} 2x^2+7x+3 &= \frac{(2x)^2+7(2x)+6}{2} \\ &= \frac{(2x+6)(2x+1)}{2} \\ &= (x+3)(2x+1). \end{aligned} $Example. Factor $abx^2+(a^2+b^2)x+ab$.
Solution
$ \begin{aligned} abx^2+(a^2+b^2)x+ab &= \frac{(abx)^2+(a^2+b^2)(abx)+a^2b^2}{ab} \\ &= \frac{(abx+a^2)(abx+b^2)}{ab} \\ &= (bx+a)(ax+b). \end{aligned} $Example. Factor $16x^2+72x-63$.
Solution
Notice that $16x^2=(4x)^2$ and $72x=18(4x)$, so we can treat $4x$ directly as the variable: $ \begin{aligned} 16x^2+72x-63 &= (4x)^2+18(4x)-63 \\ &= (4x+21)(4x-3). \end{aligned} $
Factoring x2+px+q by Completing the Square
While inspection applies only in particular cases, completing the square is perfectly general. The key identity is:
$ \left(x+\frac{p}{2}\right)^2 = x^2+px+\frac{p^2}{4}, $
so we can make $x^2+px$ a perfect square by adding $\frac{p^2}{4}$ — the square of half the coefficient of $x$. This process is called completing the square.
- Adding and subtracting $\frac{p^2}{4}$ leaves $x^2+px+q$ unchanged, but transforms it into a difference of squares:
$ \begin{aligned} x^2+px+q &= x^2+px+\frac{p^2}{4}-\frac{p^2}{4}+q \\ &= \left(x+\frac{p}{2}\right)^2-\frac{p^2-4q}{4} \\ &= \left(x+\frac{p+\sqrt{p^2-4q}}{2}\right)\!\left(x+\frac{p-\sqrt{p^2-4q}}{2}\right). \quad \text{(i)} \end{aligned} $
- For the general case $ax^2+bx+c = a\!\left(x^2+\frac{b}{a}x+\frac{c}{a}\right)$, substitute $p=\frac{b}{a}$ and $q=\frac{c}{a}$ into (i) and simplify:
$ ax^2+bx+c = a\left(x+\frac{b+\sqrt{b^2-4ac}}{2a}\right)\!\left(x+\frac{b-\sqrt{b^2-4ac}}{2a}\right). $
Example. Factor $x^2-6x+2$.
Solution
$ \begin{aligned} x^2-6x+2 &= x^2-6x+3^2-3^2+2 \\ &= (x-3)^2-7 \\ &= (x-3+\sqrt{7})(x-3-\sqrt{7}). \end{aligned} $Example. Factor $3x^2-5x+1$.
Solution
$ \begin{aligned} 3x^2-5x+1 &= 3\!\left[x^2-\tfrac{5}{3}x+\tfrac{1}{3}\right] \\ &= 3\!\left[x^2-\tfrac{5}{3}x+\left(\tfrac{5}{6}\right)^2-\left(\tfrac{5}{6}\right)^2+\tfrac{1}{3}\right] \\ &= 3\!\left[\left(x-\tfrac{5}{6}\right)^2-\tfrac{13}{36}\right] \\ &= 3\!\left(x-\tfrac{5}{6}+\tfrac{\sqrt{13}}{6}\right)\!\left(x-\tfrac{5}{6}-\tfrac{\sqrt{13}}{6}\right). \end{aligned} $Example. Factor $x^2+8x+20$.
Solution
$ \begin{aligned} x^2+8x+20 &= x^2+8x+4^2-4^2+20 \\ &= (x+4)^2+4 \\ &= (x+4)^2-(2\sqrt{-1})^2 \\ &= (x+4+2\sqrt{-1})(x+4-2\sqrt{-1}). \end{aligned} $ Here the sum of squares $(x+4)^2+4$ leads to complex numbers: $\sqrt{-1}=i$ in the complex number system. We treat this factorization symbolically for now and return to complex numbers later.
Factoring by Grouping
Sometimes a polynomial has no common factor shared by all terms, but can still be factored by grouping terms that share a common factor. This strategy works best for polynomials with four or more terms.
For example:
$ \begin{aligned} x^3+3x^2+4x+12 &= (x^3+3x^2)+(4x+12) \\ &= x^2(x+3)+4(x+3) \\ &= (x+3)(x^2+4). \end{aligned} $
Example. Factor $2x^3+x^2-18x-9$.
Solution
Group the first two and last two terms: $ \begin{aligned} 2x^3+x^2-18x-9 &= (2x^3+x^2)-(18x+9) \\ &= x^2(2x+1)-9(2x+1) \\ &= (2x+1)(x^2-9) \\ &= (2x+1)(x-3)(x+3). \end{aligned} $ The last step uses the Difference of Squares formula on $x^2-9=x^2-3^2$.