Sub topic 12
Checking Your Solutions
This chapter assumes you can solve quadratics by factoring and by completing the square. It also assumes you can expand binomials and simplify expressions with square roots. Everything here applies after you have candidate roots in hand. The question is whether those roots are actually correct.
What a check proves
A solution of a quadratic equation is a number that makes the equation true. So the only complete test is substitution: put the number in for x and see whether both sides are equal.
Substitution catches mistakes that the solving methods can hide. Some examples:
- A sign error when reading the factors.
- A miscalculated half of b in completing the square.
- A root lost or invented when you rearranged the equation.
It costs one or two lines per root, which is cheap compared with a wrong answer on a test or in a calculation that depends on it.
Always substitute into the original equation, not into a later line of your own work. If you substitute into a factored form you wrote yourself, an error in the factoring will pass the check unnoticed.
Checking by substitution
Move everything to one side so the equation reads ax^2 + bx + c = 0. Then the check for a root r is to compute ar^2 + br + c. This value is called the residual. A root has residual exactly 0.
Integer roots
Suppose you solved x^2 + 5x + 6 = 0 and got x = -2 and x = -3.
- For x = -2: (-2)^2 + 5(-2) + 6 = 4 - 10 + 6 = 0.
- For x = -3: (-3)^2 + 5(-3) + 6 = 9 - 15 + 6 = 0.
Both residuals are zero, so both roots are confirmed.
A check that catches a mistake
A student solves x^2 - 5x + 6 = 0 and writes (x + 2)(x + 3) = 0, so x = -2 and x = -3. Substitute x = -2 into the original equation:
(-2)^2 - 5(-2) + 6 = 4 + 10 + 6 = 20, which is not 0.
The check fails, so the factoring is wrong. The middle term is -5x, so both numbers must be negative, giving (x - 2)(x - 3) and roots 2 and 3. Now 2^2 - 5(2) + 6 = 4 - 10 + 6 = 0, and 3^2 - 5(3) + 6 = 9 - 15 + 6 = 0.
Fraction roots
For 2x^2 - 7x + 3 = 0, factoring gives (2x - 1)(x - 3) = 0, so x = 1/2 and x = 3.
- For x = 1/2: 2(1/4) - 7(1/2) + 3 = 1/2 - 7/2 + 3 = -3 + 3 = 0.
- For x = 3: 2(9) - 21 + 3 = 18 - 21 + 3 = 0.
With fractions, keep the arithmetic exact. Square the fraction first, then multiply by a, then combine over a common denominator.
Irrational roots
Roots from completing the square often contain a square root. Take x^2 + 6x + 2 = 0. Subtract 2 and add 9 to both sides: (x + 3)^2 = 7, so x = -3 ± √7.
Check x = -3 + √7. Expand the square first:
- x^2 = 9 - 6√7 + 7 = 16 - 6√7
- 6x = -18 + 6√7
- x^2 + 6x + 2 = (16 - 6√7) + (-18 + 6√7) + 2 = 0
The √7 terms cancel and the integers sum to zero. The root -3 - √7 works the same way, with the signs of the √7 terms swapped. Do not replace √7 with a decimal here. A decimal check only shows the residual is small, not that it is zero.
A second test: sum and product of roots
For ax^2 + bx + c = 0 with roots r1 and r2:
- r1 + r2 = -b/a
- r1 · r2 = c/a
This follows from expanding a(x - r1)(x - r2). It lets you check both roots at once, without substituting each one.
For 2x^2 - 7x + 3 = 0, the roots 1/2 and 3 give a sum of 7/2, which equals -(-7)/2. Their product is 3/2, which equals c/a = 3/2. Both tests pass.
For the irrational case, the roots -3 ± √7 have sum -6 and product 9 - 7 = 2. These match -b/a = -6 and c/a = 2.
This test is a good second opinion when substitution would be messy. It has one limit: it assumes you copied a, b, and c correctly. Always take them from the original equation.
Repeated roots and no real roots
A repeated root
Solving x^2 + 2x + 1 = 0 gives (x + 1)^2 = 0, so x = -1. Substitution confirms it: 1 - 2 + 1 = 0.
Substitution cannot tell you the root is repeated. The sum and product test can, if you count the root twice: (-1) + (-1) = -2 = -b/a, and (-1)(-1) = 1 = c/a.
No real roots
If you reach (x + h)^2 = k with k negative, there is nothing to substitute. No real number squares to a negative value. The check here is to confirm the conclusion instead:
- Re-do the arithmetic for k. A sign slip here turns a valid equation into a false "no solution".
- For x^2 + 4 = 0, note that x^2 ≥ 0 for every real x, so x^2 + 4 ≥ 4 and can never equal 0.
Roots that fail: extraneous and lost solutions
Substitution into the original equation matters most when you transformed the equation along the way. Squaring both sides or multiplying by an expression containing x can introduce extraneous solutions, which are values that solve the new equation but not the original.
Consider x = √(x + 2). Squaring both sides gives x^2 = x + 2, so x^2 - x - 2 = 0 and (x - 2)(x + 1) = 0. The candidates are 2 and -1.
- For x = 2: the right side is √4 = 2, which equals the left side. The root is valid.
- For x = -1: the right side is √1 = 1, but the left side is -1. The root is extraneous and must be rejected.
The opposite error is a lost solution, and substitution cannot detect it, because a lost root is never in your list. A common cause is dividing by a variable. Solving x^2 = 3x by dividing both sides by x gives x = 3 and loses x = 0. Instead, move everything to one side: x^2 - 3x = 0, so x(x - 3) = 0, and the roots are 0 and 3.
For a pure quadratic that you only rearranged and factored, expect two roots, or one repeated root, or none. If you found only one root and the equation is not a perfect square, ask where the other went.
Checking in code
The same checks can be automated. Use exact arithmetic for rational roots, because Python's Fraction type never rounds.
from fractions import Fraction
def residual(a, b, c, x):
return a * x * x + b * x + c
def check_exact(a, b, c, roots):
"""True if every root makes a*x^2 + b*x + c exactly zero."""
return all(residual(a, b, c, Fraction(r)) == 0 for r in roots)
def check_sum_product(a, b, c, r1, r2):
"""Sum and product test for rational roots (list a repeated root twice)."""
r1, r2 = Fraction(r1), Fraction(r2)
return r1 + r2 == Fraction(-b, a) and r1 * r2 == Fraction(c, a)
print(check_exact(2, -7, 3, [Fraction(1, 2), 3])) # True
print(check_exact(1, -5, 6, [-2, -3])) # False
print(check_sum_product(2, -7, 3, Fraction(1, 2), 3)) # True
print(check_sum_product(1, 2, 1, -1, -1)) # TrueFor irrational roots, floating-point numbers carry rounding error. A true root often gives a residual such as 1e-16 instead of 0, so comparing with == 0 is unreliable. Use a tolerance.
import math
def check_float(a, b, c, roots, tol=1e-9):
"""True if every residual is within tol of zero."""
return all(math.isclose(a * x * x + b * x + c, 0.0, abs_tol=tol) for x in roots)
r = math.sqrt(7)
print(check_float(1, 6, 2, (-3 - r, -3 + r))) # True
print(check_float(1, 6, 2, (-2.0, -4.0))) # FalseA tolerance check is evidence, not proof. For exact irrational answers, do the algebra by hand as in the √7 example.
Common mistakes
| Symptom | Likely cause | Fix |
|---|---|---|
| Residual is not 0 for either root | Sign error when reading factors, or wrong b | Re-expand your factors and compare with the original |
| One root passes, the other fails | Only one factor was set up correctly | Re-check the second factor and the zero product step |
| Residual equals a constant like 2 or -6 | Added or subtracted the wrong number when completing the square | Redo the step where you add (b/2)^2 to both sides |
| Root passes the factored form but fails the original | You substituted into your own factored line | Substitute into the original equation |
| Candidate fails after squaring both sides | Extraneous root | Reject it |
| Only one root when two were expected | Divided by a variable | Move terms to one side and factor |
Exercises
Exercise
Check whether x = -1/3 is a solution of 3x^2 + 4x + 1 = 0. Show the arithmetic.
Show answer
Substitute: 3(-1/3)^2 + 4(-1/3) + 1 = 3(1/9) - 4/3 + 1 = 1/3 - 4/3 + 1 = -1 + 1 = 0. The residual is 0, so x = -1/3 is a solution.
Exercise
A student solves x^2 + 4x + 1 = 0 by completing the square and gets x = -2 ± √3. Verify x = -2 + √3 by substitution, then verify both roots with the sum and product test.
Show answer
x^2 = 4 - 4√3 + 3 = 7 - 4√3 and 4x = -8 + 4√3, so x^2 + 4x + 1 = 7 - 4√3 - 8 + 4√3 + 1 = 0. For the sum and product, the roots add to (-2 + √3) + (-2 - √3) = -4, which equals -b/a. They multiply to 4 - 3 = 1, which equals c/a.
Exercise
A student solves x = √(3x + 4) by squaring both sides and finds x = 4 and x = -1. Which of these is a solution of the original equation?
Show answer
Squaring gives x^2 = 3x + 4, so x^2 - 3x - 4 = 0 and (x - 4)(x + 1) = 0. Check x = 4: √(12 + 4) = √16 = 4, which equals x, so it works. Check x = -1: √(-3 + 4) = √1 = 1, which is not -1, so it is extraneous. Only x = 4 is a solution.