The Quadratic Formula, Derived

The quadratic formula is usually memorised and rarely understood. This guide derives it in five steps, explains the discriminant as a preview of the answer, and tests the ideas on 8,820 computed equations.

The thesis: the piece under the square root predicts the kind of answer before any solving starts.

9 min read · Updated Nov 7, 2026

The Formula Everyone Memorises and Few Understand

Nearly every algebra student can recite the quadratic formula, yet many cannot say where it comes from, what the piece under the square root means, or when to use it instead of factoring. Common frustrations include sign slips with −b, forgetting the 2a in the denominator, and panic when the square root of a negative number appears.

This guide derives the formula in five lines, explains the discriminant as a preview of the answer, and tests the ideas on 8,820 computed equations. A short section also covers a trap that affects calculators and software.

Key Terms Before the Algebra

Quadratic equation. An equation of the form ax² + bx + c = 0 with a ≠ 0. The numbers a, b and c are the coefficients. A quadratic equation has at most two solutions, called roots.

Discriminant. The quantity D = b² − 4ac. The discriminant discriminates between kinds of roots, hence the name.

Completing the square. Rewriting x² + px as (x + p/2)² − p²/4 so that the unknown appears only once. This is the engine behind the formula, and the complete the square calculator shows it step by step.

The Derivation in Five Steps

1. Start with ax² + bx + c = 0 and divide by a: x² + (b/a)x + c/a = 0.

2. Move the constant: x² + (b/a)x = −c/a.

3. Add (b/2a)² to both sides to complete the square: (x + b/2a)² = b²/4a² − c/a.

4. Combine the right side over 4a²: (x + b/2a)² = (b² − 4ac) ÷ 4a². The discriminant has appeared.

5. Take square roots and solve: x + b/2a = ±√(b² − 4ac) ÷ 2a, so x = (−b ± √(b² − 4ac)) ÷ 2a.

The ± appears at step 5 because a positive number has two square roots. The MDN guide to deriving the quadratic formula shows the same steps typeset in MathML.

What the Discriminant Tells You in Advance

Because D sits under the square root, its sign decides the answer before any further work. If D is positive, there are two distinct real roots. If D is zero, there is one repeated real root. If D is negative, there are no real roots, but there are two complex ones.

Example, D > 0. For 2x² − 7x + 3 = 0, D = 49 − 24 = 25. The roots are (7 ± 5) ÷ 4, so x = 3 and x = ½.

Example, D = 0. For x² − 6x + 9 = 0, D = 36 − 36 = 0, so x = 3 only. The parabola touches the x-axis once.

Example, D < 0. For x² + 2x + 5 = 0, D = 4 − 20 = −16. The roots are (−2 ± 4i) ÷ 2 = −1 ± 2i. A negative discriminant means no real solutions, which is different from no solutions.

The Picture Behind the Formula

The graph of y = ax² + bx + c is a parabola. Its axis of symmetry is x = −b/2a, the first part of the formula. The roots sit at equal distances √D ÷ 2a on either side of that axis. A larger discriminant means the roots are further from the axis, and a zero discriminant means they merge on it. When D is negative, the parabola never reaches the x-axis. The graphing notebook makes this easy to see by dragging coefficients.

What 8,820 Equations Reveal

Mathvelo computed the discriminant for every quadratic with integer coefficients a, b and c from −10 to 10 and a ≠ 0, which gives 8,820 equations.

DiscriminantShare of equations
Positive (two real roots)61.5%
Zero (one repeated root)0.7%
Negative (complex roots)37.8%
Perfect square (rational roots)14.6% of all, 23.7% of those with D > 0

Two practical lessons follow. Real roots are the common case here, but complex roots are far from rare, so students should be comfortable with them. And only about one in four equations with real roots has a perfect-square discriminant, which is the case where factoring over the integers works. Factoring is therefore a shortcut for some equations, not a method for all of them.

Formula, Factoring or Completing the Square

Check the discriminant first when time allows. If D is a perfect square, factoring will work and the roots are rational. If a = 1 and b is even, completing the square is quick. If the coefficients are awkward, go straight to the formula. For a quick run through all three, the factoring calculator and the quadratic equation calculator give a second opinion.

A Worked Example With Awkward Numbers

Solve 3x² + 5x − 4 = 0. Here a = 3, b = 5 and c = −4, so D = 25 − 4(3)(−4) = 25 + 48 = 73. This is not a perfect square, so factoring over the integers will not work. The roots are (−5 ± √73) ÷ 6, which are about 0.5907 and −2.2573. The sum check gives 0.5907 − 2.2573 = −1.6667, matching −b/a = −5/3, and the product gives −1.3333, matching c/a = −4/3.

A Word Problem: When Does It Land?

A ball is thrown upward so that its height in metres after t seconds is h = −5t² + 20t + 1.5. It lands when h = 0. Here D = 400 + 30 = 430 and √430 is about 20.736. The two solutions are t ≈ 4.07 and t ≈ −0.07. A negative time lies before the throw, so only t ≈ 4.07 seconds makes sense. Always return to the story to decide which root belongs. The math word problem solver follows the same pattern.

Using the Discriminant to Find a Parameter

Exam questions often ask for the value of k that gives a repeated root. For x² + kx + 9 = 0, set D = k² − 36 = 0, so k = 6 or k = −6. For two distinct real roots, require k² > 36, which means k > 6 or k < −6. These problems use only the discriminant and never need the full formula.

Sign and Placement Errors to Watch

Three slips cause most lost marks. The first is writing b instead of −b at the start, which turns every root upside down. The second is dividing only the square root by 2a, when the whole numerator, −b ± √D, sits over 2a. The third is mis-signing 4ac when c is negative, so that the discriminant should grow, not shrink. Writing a, b and c with their signs before substituting removes the third error entirely.

Complex Roots Without the Fear

When D is negative, write √D as i√(−D), where i is the number whose square is −1. Complex roots of a real quadratic always come as a conjugate pair, a + bi and a − bi. For x² + 2x + 5 the pair is −1 + 2i and −1 − 2i. They still obey Vieta’s checks: the sum is −2 and the product is (−1)² + 2² = 5. Seeing the checks work reassures many students that complex numbers follow the same rules as everything else.

A Calculator Workflow That Builds Skill

Solve by hand first, writing a, b, c and D. Then compare with the quadratic equation calculator, which lists the discriminant and both roots. If the results differ, compare D first, because an error there explains everything after it. Repeat with five equations a week, mixing perfect-square and awkward cases, and the formula will become automatic. This follows the attempt-before-looking rule from the guide on how to study math.

A Free Check: Sum and Product of the Roots

For any quadratic, the roots add to −b/a and multiply to c/a. These are known as Vieta’s formulas. For 2x² − 7x + 3, the roots 3 and ½ add to 3.5 = 7/2 and multiply to 1.5 = 3/2. This check takes ten seconds and catches almost every sign error, as described in the guide on how to check a math answer.

The Trap in Software: Cancellation

The formula can lose accuracy on a computer. Take x² + 10⁸x + 1 = 0. The true small root is about −1.0 × 10⁻⁸. With ordinary double-precision arithmetic, the textbook formula returns −7.45 × 10⁻⁹, an error of roughly 25%, because −b + √D subtracts two nearly equal numbers. Computing the large root first, then using the product rule c/a to get the small one, gives −1.0 × 10⁻⁸. This is a classic case in Goldberg’s paper on floating-point arithmetic. For ordinary homework numbers the textbook formula is fine.

A Short History

Problems equivalent to quadratics appear on Babylonian clay tablets from around 2000 BC, and al-Khwārizmī’s ninth-century treatise on algebra solved them by completing the square. The symbolic formula in its modern form is much younger. The method has been the same for a very long time, and the five-step derivation above is a direct descendant of it.

What Is Overrated, Underrated and Often Wrong

Overrated: reciting the formula to a tune without knowing where it comes from. Underrated: the discriminant as a planning tool and Vieta’s sum-and-product check, both of which cost seconds. Often wrong: saying a negative discriminant means “no solution”. It means no real solution. Another common error is treating factoring as the default, when the data above shows it applies to a minority of equations.

Quick Answers

What does the discriminant tell you?

Its sign gives the number and type of roots: two real, one repeated, or two complex.

Why does the quadratic formula have a plus-or-minus sign?

A positive number has two square roots, so the equation has two solutions.

Can I use the quadratic formula when a = 1?

Yes. With a = 1 it simplifies to x = (−b ± √(b² − 4c)) ÷ 2.

What if the discriminant is negative?

There are no real roots. The complex roots are (−b ± i√(−D)) ÷ 2a.

How do I check my roots quickly?

Test that they add to −b/a and multiply to c/a, then substitute one into the original equation.

Related Mathvelo Tools

Further Reading and Sources

A note on these guides. The counts were computed with a short script over every integer triple in range, and the floating-point example used standard double precision. Opinions are labelled as opinions. This page is educational and not professional advice.

↑