#rough https://www.mashupmath.com/blog/how-to-factor-polynomials
To factor a [[polynomial]] means to rewrite the expression as a product of factors. Recognizing patterns is an important skill in factoring a polynomial.
## ac test of factorability
If in polynomials on the form
$\begin{align}
ax^2+bx+c && \text{or} && ax^2 +bxy + cy^2
\end{align}$
the product $ac$ has two integer factors $p$ and $q$ whose sum is the coefficient $b$ of the middle term; that is, if integers $p$ and $q$ exist such that
$\begin{align}
pq = ac && \text{and} && p + q = b
\end{align}$
then the polynomials have first-degree factors with integer coefficients. If not, we can say that the polynomial is **not factorable in the integers**.
Create a factor table for the product $ac$ to enumerate all factors, and test each one to see if the sum is $b$.
For example, in the polynomial $3x^2 + 8xy + 4y^2$, the product $ac = 12$ which has factors
| p | q | sum |
| --- | --- | --- |
| 1 | 12 | 13 |
| 2 | 6 | 8 |
| 3 | 4 | 7 |
The polynomial is factorable. We can split the middle term using $b = p + q$ and complete the factoring by grouping.
$\begin{align}
3x^2 + 8xy + 4y^2 &= 3x^2 + 2xy + 6xy + 4y^2 \\
&= (3x^2 + 2xy) + (6xy + 4y^2) \\
&= x(3x + 2y) + 2y(3x + 2y) \\
&= (x + 2y)(3x + 2y)
\end{align}$
## special factoring formulas
Some common factors include
- **Perfect square:** $u^2 + 2uv + v^2 = (u + v)^2$
- **Perfect square (difference):** $u^2 - 2uv + v^2 = (u - v)^2$
- **Difference of squares:** $u^2 - v^2 = (u-v)(u+v)$
- **Difference of cubes:** $u^3 - v^3 = (u - v)(u2 + uv + v^2)$
- **Sum of cubes:** $u^3 + v^3 = (u + v)(u^2 - uv + v^2)$
## factoring strategies
### group like terms
Group (add or subtract) any terms of the same degree (those raised to the same power).
### greatest common factor
If all terms share a common factor, extract it.
### difference of two squares
The difference of two squares can be factored as
$(a^2 - b^2) = (a+b)(a-b)$
## factoring a trinomial where a=1
For a polynomial with three terms where the coefficient of the first term is $1$, if the coefficient for $x$ is the sum of two numbers whose product is the constant, you can factor the polynomial. For example
$(x^2 + 6x + 8) = (x + 2)(x + 4)$
## Factoring a squared polynomial
When factoring a polynomial that is squared, square both factors.
$f(x) = (x^2 - 1)^2 = (x + 1)^2(x - 1)^2$