Quadratic Formula Calculator

Solve ax² + bx + c = 0 for x using the quadratic formula, including complex roots.

  • Free to use
  • No registration required
  • Works on all devices
Method
Quadratic formula with discriminant test for real, repeated or complex roots
Last updated
24-09-2026
Enter the coefficients a, b, and c to solve a quadratic equation for x.

Your result

2

Root 1

Root 21
Discriminant1
Nature of rootsTwo distinct real roots

AI explanation

Formula

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

Worked examples

x² − 3x + 2 = 0

Worked example: x² − 3x + 2 = 0
FieldValue
Coefficient a1
Coefficient b-3
Coefficient c2
Root 12
Root 21
Discriminant1
Nature of rootsTwo distinct real roots
  1. Identify a = 1, b = −3, c = 2.
  2. Discriminant = b² − 4ac = (−3)² − 4 × 1 × 2 = 9 − 8 = 1.
  3. The discriminant is positive, so there are two distinct real roots; √1 = 1.
  4. x = (3 + 1) ÷ 2 = 2 and x = (3 − 1) ÷ 2 = 1.

Check: 2² − 3 × 2 + 2 = 0 and 1² − 3 × 1 + 2 = 0, so both roots satisfy the equation.

x² + 2x + 5 = 0 (complex roots)

Worked example: x² + 2x + 5 = 0 (complex roots)
FieldValue
Coefficient a1
Coefficient b2
Coefficient c5
Root 1-1 + 2i
Root 2-1 - 2i
Discriminant-16
Nature of rootsTwo complex conjugate roots
  1. Discriminant = 2² − 4 × 1 × 5 = 4 − 20 = −16.
  2. The discriminant is negative, so the roots are complex: √(−16) = 4i.
  3. x = (−2 ± 4i) ÷ 2 = −1 ± 2i.

The parabola y = x² + 2x + 5 never crosses the x-axis, which is why there is no real solution.

2x² − 4x + 2 = 0 (one repeated root)

Worked example: 2x² − 4x + 2 = 0 (one repeated root)
FieldValue
Coefficient a2
Coefficient b-4
Coefficient c2
Root 11
Root 21
Discriminant0
Nature of rootsOne repeated real root
  1. Discriminant = (−4)² − 4 × 2 × 2 = 16 − 16 = 0.
  2. With a zero discriminant the ± term vanishes: x = 4 ÷ (2 × 2) = 1.

The equation is 2(x − 1)² = 0, so the parabola just touches the x-axis at x = 1.

Assumptions and limitations

This calculator assumes

  • When the discriminant (b² − 4ac) is negative, the roots are complex — reported as text rather than left undefined.

What it does not account for

  • Requires a ≠ 0; with a = 0 the equation is linear, not quadratic.
  • Results are rounded to 8 decimal places, so roots of equations with very large or very small coefficients may show rounding error.

When to use this calculator

  • Checking homework or exam answers for quadratic equations, including complex roots.
  • Finding where a parabola crosses the x-axis, such as when a projectile returns to ground level.

Frequently asked questions

What is the discriminant?

b² − 4ac — its sign tells you the nature of the roots: positive means two real roots, zero means one repeated real root, and negative means two complex conjugate roots.

What if a = 0?

Then the equation isn't actually quadratic — use the Linear Equation Calculator instead for ax + b = 0.

How are complex roots shown?

As text in the form "real ± imaginary i" — for example, "-0.5 + 0.87i".

Related calculators

Related articles

Report a calculation issue