“Completing the Square” completes the square on any particular quadratic. Doing it on ax² + bx + c = 0, with letters in place of numbers, does it for all of them at once and leaves a formula behind.
Theorem · The quadratic formulaLet a, b and c be real with a ≠ 0. If b² - 4ac ≥ 0, the real solutions of ax² + bx + c = 0 are exactly x = (-b + √(b² - 4ac))/(2a) and x = (-b - √(b² - 4ac))/(2a). If b² - 4ac < 0 there are no real solutions.
Divide through by a, which is allowed because a ≠ 0: x² + (b/a)x + c/a = 0. Move the constant across: x² + (b/a)x = -c/a.
Half the coefficient of x is b/(2a), and its square is b²/(4a²). Add that to both sides: x² + (b/a)x + b²/(4a²) = -c/a + b²/(4a²).
The left side is now (x + b/(2a))². On the right, put both terms over 4a²: since -c/a = -4ac/(4a²), the right side is (b² - 4ac)/(4a²).
4a² is positive, so the right side has the same sign as b² - 4ac. By the square root property there is a real solution exactly when b² - 4ac ≥ 0, and then x + b/(2a) = ±√(b² - 4ac) / √(4a²).
Now √(4a²) = 2|a|, not 2a, because a square root is never negative. But the numerator already carries a ±, so the two numbers produced by dividing by 2|a| are the same two numbers produced by dividing by 2a — listed in the other order when a is negative. Writing 2a is therefore safe, and it is what keeps the formula short.
Subtracting b/(2a) gives x = -b/(2a) ± √(b² - 4ac)/(2a), and the two terms share a denominator: x = (-b ± √(b² - 4ac))/(2a).
□
The quantity b² - 4ac appeared without being asked for, and it decides everything about the answer. “The Discriminant” is about that quantity alone.
Using it
Three things are worth doing in a fixed order every single time: rearrange into standard form, write a, b and c down with their signs, and compute b² - 4ac on its own line before substituting anything else.
2x² - 7x + 3 = 0 a = 2, b = -7, c = 3
b² - 4ac = (-7)² - 4(2)(3) = 49 - 24 = 25
7 ± √25 7 ± 5
x = -------- = ------- → x = 12/4 = 3 or x = 2/4 = 1/2
4 4
-b was -(-7) = 7, and b² was (-7)² = 49. Writing b = -7 on its own line first is what makes both of those automatic rather than remembered.
This one can be checked independently, because it happens to factor: 2x² - 7x + 3 = (2x - 1)(x - 3), giving x = 1/2 and x = 3. Two methods, computed separately, agreeing.
Simplifying the result
The formula frequently hands back an unreduced fraction, and the reduction has to divide every term of the numerator, not the convenient one:
x² + 4x + 1 = 0 a = 1, b = 4, c = 1
b² - 4ac = 16 - 4(1)(1) = 12
-4 ± √12 -4 ± 2√3
x = --------- = ---------- = -2 ± √3 divide BOTH terms by 2
2 2
not -4 ± √3, and not -2 ± 2√3
√12 = 2√3 by Rational and Radical Expressions, and then the 2 underneath divides into -4 and into 2√3 alike. Cancelling from one term only produces a number that is not a solution: substituting -4 + √3 into x² + 4x + 1 gives 4 - 4√3, which is not 0.
A negative leading coefficient
a may be negative and the formula does not mind. -x² + 5x - 6 = 0 has a = -1, b = 5, c = -6, so b² - 4ac = 25 - 4(-1)(-6) = 25 - 24 = 1 and x = (-5 ± 1)/(-2), giving x = 2 and x = 3. Multiplying the equation through by -1 first gives x² - 5x + 6 = 0 and the same two solutions with far less sign handling, which is a free simplification worth taking.
Example · When the formula is the wrong toolx² - 9 = 0 has b = 0, and the formula gives x = ±√36 / 2 = ±3. Correct, and slower than the square root property, which reads x² = 9 and stops.
The formula always works. It is not always the shortest route, and one line of “The Discriminant” usually tells you which route to take.