← All blog posts

Quadratic Equation Solver formula — how it actually works

WhiteUI · A plain-English guide to the Quadratic Equation Solver

Every answer from the Quadratic Equation Solver comes from two formulas. The discriminant decides how many roots there are, and the quadratic formula finds them. Once you see both worked on one equation, the tool stops looking like a black box.

The two formulas

Discriminant: D = b² − 4ac
Quadratic formula: x = (−b ± √D) ÷ 2a

The discriminant is worked out first. If D is positive, the formula gives two real roots. If D is zero, the two roots are the same. If D is negative, there are no real roots, and the roots are complex.

Worked example

Take 2x² + 8x + 6 = 0, so a = 2, b = 8 and c = 6. The discriminant is 8² − 4 × 2 × 6 = 64 − 48 = 16, and √16 = 4. The formula gives x = (−8 ± 4) ÷ 4, which is x = −1 and x = −3.

D = 64 − 48 = 16
x = (−8 ± 4) ÷ 4 → x = −1 and x = −3

Check both: 2 × (−1)² + 8 × (−1) + 6 = 2 − 8 + 6 = 0, and 2 × (−3)² + 8 × (−3) + 6 = 18 − 24 + 6 = 0.

D = b² − 4ac for 2x² + 8x + 6 = 0b² = 8² = 644ac = 4 × 2 × 6 = 4864 − 48 = 16, so D = 16 and √D = 4Two real roots: (−8 ± 4) ÷ 4 = −1 and −3
b² is 64 and 4ac is 48. The gap between them, 16, is the discriminant.

The mistake to avoid

Forgetting the 2a underneath the formula. Here a = 2, so you divide by 4, not by 2. Dividing (−8 ± 4) by 2 gives −2 and −6, which are wrong: check x = −2 and you get 2 × 4 − 16 + 6 = −2, not 0. The 2a is part of the formula, not decoration.

The formula or completing the square — which one to use?

Completing the square is where the quadratic formula comes from, and it is worth doing once so you see the connection. But as a way of solving equations it is slow: you halve b, square it, add it to both sides, factor a perfect square, then take a square root — and one sign slip anywhere in that chain gives a wrong answer. The formula is the same work, already finished, so you only have to put a, b and c in the right places. Take x² + 10x + 21 = 0. By the formula, D = 10² − 4 × 1 × 21 = 100 − 84 = 16, √16 = 4, and the roots are (−10 ± 4) ÷ 2, which are x = −3 and x = −7. Completing the square on the same equation takes twice as many lines to reach the same two numbers.

So learn completing the square for understanding, and use the formula — or the solver — for answers. In an exam, the formula is also the safer choice when the numbers are large: the steps are few, and each one is easy to check.

Square b with its sign inside the brackets

The discriminant starts with b², and b² means the whole of b, sign included, multiplied by itself. In x² − 6x + 8 = 0, b is −6, so b² is (−6)² = 36, and D = 36 − 4 × 1 × 8 = 36 − 32 = 4, giving the roots (6 ± 2) ÷ 2, which are x = 4 and x = 2. Write it as −6² instead — b squared without the brackets — and you get −36, which makes D = −36 − 32 = −68, and the equation wrongly looks as if it has no real roots at all. The brackets are not decoration: they say the minus belongs to the number being squared. Whenever b is negative, write (−6)² in full before you work anything out.

Frequently asked questions

Why is there a ± in the formula?

Because a quadratic has two roots; the plus sign gives one and the minus sign gives the other.

What if the discriminant is negative?

Then √D is not a real number, so there are no real roots. The roots are complex: real part −b ÷ 2a, imaginary part √(−D) ÷ 2a.

Does the formula work when a is negative?

Yes. The signs take care of themselves if you keep them: for −x² + 5x − 6 = 0, a = −1, b = 5, c = −6, and the roots are still 2 and 3.

Where does the formula come from?

From completing the square on ax² + bx + c = 0. It is the same algebra, finished once so you never have to repeat it.

More guides on the Quadratic Equation Solver

Try it yourself

Solve a quadratic equation, see the discriminant and both roots — free, in your browser.

Open the Quadratic Equation Solver