# Factoring
When you **factor** an expression you are trying to find what you would multiply to get the original expression. Example:
- Ex: $x^2+
---
## Special Factoring Cases
#### Perfect-Square Trinomials
A **perfect-square trinomial** is any trinomial in one of the following forms:
$a^2+2ab+b^2=(a+b)(a+b)=(a+b)^2$
$a^2-2ab+b^2=(a-b)(a-b)=(a-b)^2$
#### Difference of Squares
A **difference of squares** occurs if the following form is present:
$a^2+b^2=(a+b)(a-b)$
> [!help] Examples
> **Perfect-Square Trinomials:**
> $\begin{aligned}
x^2-12x+36 \\
x^2-12x+6^2 \\
x^2-2(x)(6)+6^2 && a^2-2ab+b^2\\
(x-6)^2 && (a-b)^2
\end{aligned}$
> ---
> $\begin{aligned}
4x^2+20x+25 \\
(2x)^2+20x+5^2 \\
(2x)^2+2(2x)(5)+5^2 && a^2+2ab+b^2\\
(2x+5)^2 && (a+b)^2
\end{aligned}$
> ---
> **Difference of Squares:**
> $\begin{aligned}
z^2-9 \\
z^2-3^2 \\
(z+3)(z-3) && (a+b)(a-b)\\
z^2-3z+3z-9
\end{aligned}$
> ---
> $\begin{aligned}
24g^2-6 \\
6(4g^2-1) \\
6((2g)^2-1^2)\\
6(2g+1)(2g-1)
\end{aligned}$
---
## Factoring by Grouping
You can utilize the factoring by grouping technique when a polynomial contains four or more terms:
1. Divide the polynomial into two groups: 1st half and 2nd half.
$(2x^3-10x^2)+(3x-15)$
2. Factor the GCF (Greatest Common Factor)
$2x^2(x-5)+3(x-5)$
3. You should have a common binomial/trinomial factor
$2x^2(x-5)+3(x-5)$
4. Factor out the common binomial/trinomial factor.
$(x-5)(2x^2+3)$
> [!help] Examples
> $\begin{aligned}
3n^3-12n^2+2n-8 \\
(3n^3-12n)+(2n-8) \\
3n^2(n-4)+2(n-4)\\
(n-4)(3n^2+2)
\end{aligned}$
> ---
> *Sometimes you can factor out a GCF in the entire expression before the first step to make the process simpler:*
> $\begin{aligned}
4q^4-8q^3-12q^2+24q \\
4q((q^3-2q^2)+(-3q+6)) \\
4q(q^2(q-2)-3(q-2))\\
4q(q-2)(q^2-3)
\end{aligned}$
---