Sub topic 13
Choosing the Right Method
This chapter assumes you can already solve a quadratic by factoring (including the zero product property) and by completing the square, and that you can expand products such as (x − 3)(x + 2). The earlier chapters taught each method on its own. Here you will learn to pick one before you start, and to recognize when you have picked badly.
Why the choice matters
Every quadratic equation with real coefficients can be solved by completing the square. Factoring is faster when it works, but it only works when the roots are rational numbers. Choosing well comes down to two questions.
- Does the equation have a shape that makes a shortcut obvious?
- If not, will integer factoring succeed, or will it send you hunting for a pair of numbers that does not exist?
You can answer both before doing any real work.
Step 1: Look for shortcuts
Put the equation in standard form, ax² + bx + c = 0, and look at which coefficients are zero.
- b = 0. The equation has the form ax² + c = 0. Isolate x² and take square roots. This is the square root method, and it is usually the fastest option.
- c = 0. The equation has the form ax² + bx = 0. Factor out x, giving x(ax + b) = 0, and apply the zero product property. The roots are 0 and −b/a.
- A common factor in all terms. Divide it out first. For 3x² + 12x + 9 = 0, dividing by 3 gives x² + 4x + 3 = 0, which factors quickly.
- A special pattern. A difference of squares such as x² − 49 or a perfect square trinomial such as x² + 10x + 25 can be factored on sight.
If none of these applies, move to the next step.
Step 2: Decide whether integer factoring can succeed
For a quadratic with integer coefficients, the quantity b² − 4ac decides the question:
- If b² − 4ac is a perfect square (0, 1, 4, 9, 16, …), the roots are rational and the trinomial factors over the integers.
- If b² − 4ac is positive but not a perfect square, the roots are irrational. No integer factorization exists, so use completing the square.
- If b² − 4ac is negative, there are no real roots.
You have not yet seen where this number comes from. It appears naturally when completing the square on the general equation, which is the last chapter in this tutorial. For now, treat it as a test you can compute in seconds. It is the same quantity that shows up under the square root when you complete the square, so it agrees with everything you already know.
Worked comparisons
The table shows five equations and the method that fits each.
| Equation | b² − 4ac | Best method | Roots |
|---|---|---|---|
| x² − 49 = 0 | 196 | Square root | 7, −7 |
| 3x² + 12x = 0 | 144 | Factor out 3x | 0, −4 |
| x² + 5x + 6 = 0 | 1 | Factor | −2, −3 |
| 2x² + 7x + 3 = 0 | 25 | Factor | −1/2, −3 |
| x² + 6x + 2 = 0 | 28 | Complete the square | −3 ± √7 |
For 2x² + 7x + 3 = 0, the discriminant 25 is a perfect square, so factoring will work. Search for the factor pair: (2x + 1)(x + 3) expands to 2x² + 6x + x + 3 = 2x² + 7x + 3. Setting each factor to zero gives x = −1/2 and x = −3.
For x² + 6x + 2 = 0, the value 28 is not a perfect square, so do not look for integers that add to 6 and multiply to 2. Complete the square instead:
- Move the constant: x² + 6x = −2.
- Add (6/2)² = 9 to both sides: x² + 6x + 9 = 7.
- Write the left side as a square: (x + 3)² = 7.
- Take square roots: x = −3 ± √7.
When a is not 1 and the roots are irrational, the same plan works after dividing by a. For 2x² + 8x − 3 = 0, the value 64 + 24 = 88 is not a perfect square. Divide by 2 to get x² + 4x = 3/2, add 4 to get (x + 2)² = 11/2, and so x = −2 ± √(11/2), which equals −2 ± √22/2.
Encoding the decision in code
This function applies the procedure above. It assumes integer coefficients.
import math
def choose_method(a, b, c):
"""Suggest a method for a*x^2 + b*x + c = 0 with integer a, b, c and a != 0."""
if a == 0:
raise ValueError("a must be nonzero for a quadratic equation")
if b == 0:
return "square root method"
if c == 0:
return "factor out x"
d = b * b - 4 * a * c
if d < 0:
return "no real roots"
if math.isqrt(d) ** 2 == d:
return "factoring"
return "completing the square"
for coeffs in [(1, 0, -49), (3, 12, 0), (1, 5, 6), (2, 7, 3),
(1, 6, 2), (1, -3, 5), (1, 2, 1)]:
print(coeffs, "->", choose_method(*coeffs))The output is:
(1, 0, -49) -> square root method
(3, 12, 0) -> factor out x
(1, 5, 6) -> factoring
(2, 7, 3) -> factoring
(1, 6, 2) -> completing the square
(1, -3, 5) -> no real roots
(1, 2, 1) -> factoringThe last case, x² + 2x + 1 = 0, has b² − 4ac = 0. It is a perfect square trinomial, (x + 1)² = 0, with one repeated root, x = −1.
Common failure modes
Applying the zero product property when the right side is not zero
The equation (x − 3)(x + 2) = 6 looks factored, but you cannot set each factor equal to 6. The zero product property only works when the product equals zero. Expand first and move everything to one side:
- (x − 3)(x + 2) = 6 becomes x² − x − 6 = 6.
- Subtract 6: x² − x − 12 = 0.
- Factor: (x − 4)(x + 3) = 0.
- Roots: x = 4 and x = −3.
Check x = 4: 16 − 4 − 12 = 0. Check x = −3: 9 + 3 − 12 = 0.
Losing a root by dividing by x
For x² = 5x, dividing both sides by x gives x = 5 and drops the root x = 0. Move terms instead: x² − 5x = 0, so x(x − 5) = 0, and the roots are 0 and 5. Dividing by a variable expression is only safe if you first confirm it is never zero.
Searching for factors that do not exist
If you spend more than a minute looking for factor pairs, compute b² − 4ac. A non-square result tells you at once to switch methods. This single check removes most wasted effort.
Fractions and decimals
If the coefficients are fractions or decimals, multiply the whole equation by a common denominator or power of ten to get integer coefficients. For example, x²/2 + 3x/2 + 1 = 0 becomes x² + 3x + 2 = 0 after multiplying by 2. Then the discriminant test applies directly.
Large coefficients
Factoring ax² + bx + c with large a and c means checking many factor pairs. The discriminant test tells you whether any pair exists. If it does, factoring may still be tedious, and completing the square (or the quadratic formula that follows from it) has a fixed number of steps no matter how large the numbers are.
Trade-offs between the methods
| Property | Factoring | Completing the square |
|---|---|---|
| Works for every real quadratic | No, only rational roots | Yes |
| Speed when it applies | Fast | Moderate |
| Number of steps | Varies with the search | Fixed |
| Risk of arithmetic slips | Low | Higher with fractions |
| Shows the vertex form | No | Yes |
| Leads to the quadratic formula | No | Yes |
Completing the square also gives you something factoring does not: the form a(x + h)² + k, which shows the vertex of the parabola and explains why the number of real roots is zero, one, or two.
Checking whichever method you chose
After solving, substitute each root into the original equation, not the rearranged one. This catches both method errors and copying errors. For x² + 6x + 2 = 0 with x = −3 + √7:
- x² = 9 − 6√7 + 7 = 16 − 6√7.
- 6x = −18 + 6√7.
- Sum with 2: 16 − 6√7 − 18 + 6√7 + 2 = 0.
The check passes. Checking the other root, −3 − √7, works the same way.
Exercise
For each equation, state which method you would use and why, using the shortcut tests and b² − 4ac, and then give the roots: (a) 5x² − 45 = 0, (b) x² − 4x − 1 = 0, (c) 6x² + 5x − 4 = 0.
Show answer
(a) b = 0, so use the square root method. 5x² = 45, x² = 9, x = 3 or x = −3. (b) b² − 4ac = 16 + 4 = 20, which is not a perfect square, so complete the square: x² − 4x = 1, add 4 to get (x − 2)² = 5, so x = 2 ± √5. (c) b² − 4ac = 25 + 96 = 121 = 11², a perfect square, so factor: (3x + 4)(2x − 1) = 0, giving x = −4/3 or x = 1/2. Check: 6x² + 8x − 3x − 4 = 6x² + 5x − 4.
Exercise
A student solves (x + 1)(x − 5) = 7 by setting x + 1 = 7 and x − 5 = 7, getting x = 6 and x = 12. Explain the error and find the correct roots.
Show answer
The zero product property requires the product to equal zero, and here it equals 7. Expand and move 7 to the left: x² − 4x − 5 = 7 becomes x² − 4x − 12 = 0. This factors as (x − 6)(x + 2) = 0, so x = 6 or x = −2. The student's x = 6 is correct only by accident, and x = 12 is wrong: (13)(7) = 91, not 7.