Sub topic 2
Special patterns: difference of squares and perfect squares
Some quadratics factor quickly because they match a known pattern. This chapter assumes you can expand binomials and factor out a greatest common factor (GCF).
Special patterns
A difference of squares is a binomial such as x^2 - 9. The rule is a^2 - b^2 = (a - b)(a + b), so x^2 - 9 = (x - 3)(x + 3).
A perfect square trinomial is a trinomial that equals the square of a binomial. The rules are a^2 + 2ab + b^2 = (a + b)^2 and a^2 - 2ab + b^2 = (a - b)^2. For example, x^2 + 6x + 9 = (x + 3)^2.
Factoring ax^2 + bx + c when a is not 1
When a is not 1, find two integers m and n whose product is a*c and whose sum is b. Split the middle term using m and n, then factor by grouping.
For 2x^2 + 7x + 3, a*c = 6, and 1 + 6 = 7, so m = 1 and n = 6. Then 2x^2 + x + 6x + 3 = x(2x + 1) + 3(2x + 1) = (x + 3)(2x + 1).
Solving equations by factoring
Write the equation in standard form, ax^2 + bx + c = 0, factor the left side, and set each factor to zero. This works because of the zero product property: if a product equals 0, at least one factor equals 0.
For x^2 - 9 = 0, the factored form is (x - 3)(x + 3) = 0, so x = 3 or x = -3.
The square root method
If the equation has the form (x + h)^2 = k, take the square root of both sides. Include both the positive and negative roots: x = -h ± √k. If k is negative, there are no real solutions.
import math
def solve_square_root(h, k):
"""Solve (x + h)^2 = k over the real numbers."""
if k < 0:
return ()
root = math.sqrt(k)
return tuple(sorted({-h - root, -h + root}))
print(solve_square_root(3, 4)) # (-5.0, -1.0)
print(solve_square_root(3, 0)) # (-3.0,)
print(solve_square_root(3, -4)) # ()Exercise
Solve x^2 - 16 = 0.
Show answer
Factor to (x - 4)(x + 4) = 0, so x = 4 or x = -4.