Why Does the Quadratic Formula Work?
Generations of students have memorized it, sometimes to the tune of "Pop Goes the Weasel":
x = (−b ± √(b² − 4ac)) / 2a
But very few are shown where it comes from. That's a shame, because the formula isn't a mysterious rule. It's the result of a single idea, completing the square, which a scholar in Baghdad described with actual geometric squares around 820 AD.
Once you see the derivation, you'll never need to memorize the formula again. You could rebuild it in two minutes.
Every Quadratic Is a Perfect Square in Disguise
An equation like x² + 6x = 7 looks awkward, because x appears twice, once squared and once not. But with one small addition, it becomes a perfect square:
x² + 6x + 9 = 16
(x + 3)² = 16
Now x appears only once, and you can take the square root: x + 3 = ±4, so x = 1 or x = −7.
The quadratic formula is just this trick carried out once, in general, with letters instead of numbers.
The Geometry: Completing a Real Square
The Persian mathematician Muhammad ibn Musa al-Khwarizmi, working at the House of Wisdom in Baghdad, explained this around 820 AD in The Compendious Book on Calculation by Completion and Balancing. The word "algebra" comes from al-jabr in that title.
He solved x² + 10x = 39 with a picture:
- Draw a square of side x (area x²).
- Split the 10x into two rectangles, each 5 × x, and attach them to two sides of the square.
- The shape is now an almost-square with a missing 5 × 5 corner.
- Fill in the corner, adding 25 to both sides: x² + 10x + 25 = 39 + 25 = 64.
- The completed square has area 64, so its side is 8. That side is x + 5, so x = 3.
Al-Khwarizmi worked only with positive lengths, so he found only x = 3. Modern algebra also finds x + 5 = −8, giving x = −13.
The general rule: to complete x² + px, add (p/2)².
The Derivation, Step by Step
Start with the general quadratic equation, where a ≠ 0:
ax² + bx + c = 0
Step 1: Divide by a so the x² term has coefficient 1:
x² + (b/a)x + c/a = 0
Step 2: Move the constant to the other side:
x² + (b/a)x = −c/a
Step 3: Complete the square. Half of b/a is b/2a. Add its square, b²/4a², to both sides:
x² + (b/a)x + b²/4a² = b²/4a² − c/a
Step 4: Factor the left side as a perfect square, and combine the right side over a common denominator:
(x + b/2a)² = (b² − 4ac) / 4a²
Step 5: Take the square root of both sides. Don't forget ±:
x + b/2a = ±√(b² − 4ac) / 2a
Step 6: Subtract b/2a:
x = (−b ± √(b² − 4ac)) / 2a
That's the quadratic formula, and nothing was memorized along the way. See the full set of related identities on the algebra formulas page.
What the Pieces Mean
The formula tells a geometric story about the parabola y = ax² + bx + c:
- −b/2a is the x-coordinate of the vertex, the line of symmetry
- ±√(b² − 4ac)/2a is how far each root sits from that line
The two roots are always symmetric around the vertex. The formula literally says: start at the middle, then step left and right by the same amount.
The Discriminant
The expression under the square root, D = b² − 4ac, is called the discriminant. It decides what kind of answers you get:
| Discriminant | Roots | Parabola |
|---|---|---|
| D > 0 | Two different real roots | Crosses the x-axis twice |
| D = 0 | One repeated real root | Touches the x-axis at the vertex |
| D < 0 | Two complex roots | Never touches the x-axis |
When D < 0, you need the square root of a negative number, which leads to complex numbers. Read more in Why You Can't Take the Square Root of a Negative Number — Or Can You?
An Insider Reference: Po-Shen Loh's Shortcut
In 2019, Po-Shen Loh, a Carnegie Mellon mathematics professor and former coach of the U.S. International Mathematical Olympiad team, popularized a method that sidesteps memorizing the formula.
For x² + bx + c = 0, the roots add to −b and multiply to c. So write them as −b/2 ± u. Then:
(−b/2 + u)(−b/2 − u) = c
b²/4 − u² = c
u = √(b²/4 − c)
Solve x² − 8x + 12 = 0: the midpoint is 4, so 16 − u² = 12, u = 2, and the roots are 2 and 6. Loh noted that the underlying facts go back to the ancient Babylonians, but framing them this way makes quadratics feel natural rather than memorized.
Two Concepts Worth Knowing
Completing the Square
Completing the square rewrites x² + px as (x + p/2)² − (p/2)². It's used to derive the quadratic formula, find a parabola's vertex, and simplify circle equations.
Vieta's Formulas
For ax² + bx + c = 0, the roots r₁ and r₂ satisfy r₁ + r₂ = −b/a and r₁ × r₂ = c/a. They're named after François Viète, a 16th-century French mathematician.
Quick Answer: Where Does the Quadratic Formula Come From?
The quadratic formula comes from completing the square on ax² + bx + c = 0. Divide by a, move c/a across, add (b/2a)² to both sides to make a perfect square, take the square root, and solve for x. The result is x = (−b ± √(b² − 4ac)) / 2a.
Try Them Yourself
- Algebra Formulas: the quadratic formula and related identities
- Square Roots List: evaluate the √ part quickly
- Square Numbers List: spot perfect squares when completing the square
- Scientific Calculator: check your roots numerically
- Analytic Geometry Formulas: parabolas and vertices
- Unlocking the Power of Quadratic Functions: where quadratics show up in real life
Close this page and derive the quadratic formula on a blank sheet of paper. If you get stuck, just remember one instruction: complete the square.