Quadratic equation solver

x = (−b ± √(b² − 4ac)) ÷ 2a. For x² − 3x + 2 = 0 the discriminant is 1 and the roots are x = 2 and x = 1.

x₁ = 2, x₂ = 1
1x² − 3x + 2 = 0
1discriminant b² − 4ac
2 realroots
(1.5, -0.25)vertex
3 / 2sum / product of roots
  1. Discriminant: (-3)² − 4 × 1 × 2 = 9 − 8 = 1
  2. x = (−b ± √D) ÷ 2a = (3 ± √1) ÷ 2
  3. √1 = 1 → x₁ = 2, x₂ = 1

The quadratic formula

x = (−b ± √(b² − 4ac)) / (2a)

What the discriminant tells you

D = b² − 4acRootsGraph
D > 0two different real rootsparabola crosses the x-axis twice
D = 0one repeated real rootvertex touches the x-axis
D < 0two complex conjugate rootsparabola does not reach the x-axis

Examples

EquationDRoots
x² − 5x + 6 = 013, 2
x² + 0x − 9 = 0363, -3
2x² + 4x + 2 = 00-1
x² + 2x + 5 = 0-16-1 ± 2i
3x² − 7x + 2 = 0252, 0.3333
x² − 2x − 1 = 082.4142, -0.4142

The vertex of y = ax² + bx + c is at x = −b/(2a). The sum of the roots is −b/a and their product is c/a (Vieta’s formulas).

Frequently asked questions

What if a = 0?
The equation is linear (bx + c = 0) and has the single solution x = −c/b.
What does i mean in the answer?
i is the imaginary unit, √−1. Complex roots appear when the discriminant is negative.