Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

Quadratic formula

The quadratic formula solves any equation of the form ax² + bx + c = 0. Here's how to use it, what the discriminant tells you, and where the formula comes from.

By the Calcist team · Updated October 29, 2026 · About a 6-minute read

The formula

For ax² + bx + c = 0 with a ≠ 0:   x = (−b ± √(b² − 4ac)) / (2a)

The ± means there are usually two answers: one with + and one with −. First move every term to one side so the equation equals 0, then read off a, b and c, including their signs.

The discriminant

The expression under the square root, D = b² − 4ac, tells you what kind of solutions to expect before you finish:

DiscriminantSolutionsGraph of y = ax² + bx + c
D > 0Two different real rootsCrosses the x-axis twice
D = 0One repeated real root, x = −b/(2a)Touches the x-axis at its vertex
D < 0Two complex roots, no real onesNever touches the x-axis

Worked examples

1. x² − 5x + 6 = 0. a = 1, b = −5, c = 6. D = 25 − 24 = 1. x = (5 ± 1)/2, so x = 3 or x = 2. Check: 3² − 15 + 6 = 0.

2. 2x² + 3x − 2 = 0. a = 2, b = 3, c = −2. D = 9 + 16 = 25. x = (−3 ± 5)/4, so x = 1/2 or x = −2.

3. x² − 2x − 1 = 0 (irrational roots). D = 4 + 4 = 8, and √8 = 2√2. x = (2 ± 2√2)/2 = 1 ± √2, about 2.414214 and −0.414214.

4. x² − 4x + 4 = 0 (one root). D = 16 − 16 = 0, so x = 2 only. The equation is (x − 2)² = 0.

5. x² + 2x + 5 = 0 (complex roots). D = 4 − 20 = −16, and √(−16) = 4i. x = (−2 ± 4i)/2 = −1 ± 2i.

6. 3x² − x − 5 = 0. D = 1 + 60 = 61. x = (1 ± √61)/6, about 1.468375 and −1.135042.

A word problem

A ball is thrown upward from 6 ft above the ground at 48 ft/s. Ignoring air resistance, its height after t seconds is h = −16t² + 48t + 6 (the −16 comes from gravity, 32 ft/s², in feet). When does it land?

  1. Set h = 0: −16t² + 48t + 6 = 0, so a = −16, b = 48, c = 6.
  2. D = 48² − 4(−16)(6) = 2,304 + 384 = 2,688.
  3. t = (−48 ± √2,688)/(−32), which gives t = 3/2 ± √42/4, about 3.120 or −0.120.
  4. Time can't be negative here, so the ball lands after about 3.12 seconds.

Rejecting a root that doesn't fit the situation is a normal step in word problems.

Where the formula comes from

It's what you get by completing the square on ax² + bx + c = 0 in general:

  1. 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: (x + b/2a)² = b²/4a² − c/a = (b² − 4ac)/4a².
  4. Take square roots: x + b/2a = ±√(b² − 4ac)/2a.
  5. Subtract b/2a: x = (−b ± √(b² − 4ac))/2a.

Completing the square also gives the vertex form a(x − h)² + k, with h = −b/(2a). Try it with the vertex form calculator.

Useful checks

  • The two roots add to −b/a and multiply to c/a. In example 1, 3 + 2 = 5 and 3 × 2 = 6.
  • If the equation factors easily, factoring is faster; the formula always works.
  • When b² is much larger than 4ac, computing −b + √D on a calculator can lose digits. Calculating one root as 2c/(−b ∓ √D) avoids that.

Common mistakes

  • Not setting the equation equal to 0 first.
  • Dropping the sign of b. If b = −5, then −b = 5 and b² = 25.
  • Dividing only √D by 2a. The whole numerator, −b ± √D, is divided by 2a.

Solve any quadratic with every step shown in the equation solver, find roots of higher-degree polynomials with the polynomial roots calculator, or see the parabola on the graphing calculator.

Sources

Every worked example on this page was checked independently with SymPy.

Questions people ask

What is the quadratic formula?

x = (−b ± √(b² − 4ac))/(2a), the solutions of ax² + bx + c = 0.

What does the discriminant tell you?

b² − 4ac > 0 means two real roots, = 0 means one repeated root, and < 0 means two complex roots.

Can the quadratic formula give complex answers?

Yes. When b² − 4ac is negative, the square root is imaginary. For x² + 2x + 5 = 0, the roots are −1 ± 2i.

How is the quadratic formula derived?

By completing the square on ax² + bx + c = 0.

Does the quadratic formula work if b or c is 0?

Yes. For x² − 9 = 0, b = 0 and x = ±√36/2 = ±3.