Quadratic Equation Solver

Every quadratic ax² + bx + c = 0 has a fixed formula for its roots — the trick is the discriminant, which tells you in advance whether those roots are two real numbers, one repeated real number, or a complex pair, before you finish the arithmetic.

Inputs

Result

x₁ = 2, x₂ = 1

How it works

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

  1. 1Discriminant = 1
  2. 2x = (−-3 ± √1) ÷ 2

How the quadratic equation solver works

The quadratic formula: x = (−b ± √(b² − 4ac)) ÷ 2a.

The discriminant, b² − 4ac, decides the outcome: positive gives two distinct real roots, exactly zero gives one repeated real root, and negative gives two complex roots.

When the discriminant is negative, the square root of a negative number becomes an imaginary component, and the two roots are complex conjugates of each other.

Worked example: x² − 3x + 2 = 0

  1. Discriminant = (−3)² − 4×1×2 = 9 − 8 = 1.
  2. Since 1 > 0, expect two distinct real roots.
  3. x = (3 ± √1) ÷ 2 = (3 ± 1) ÷ 2.
  4. x₁ = 4 ÷ 2 = 2, x₂ = 2 ÷ 2 = 1.

Common mistakes to avoid

Forgetting the ± produces two separate answers

A quadratic generically has two roots, not one — dropping the minus branch of ± silently discards half the solution.

Assuming a negative discriminant means an error

It means the roots are complex, not real — a legitimate mathematical outcome, not a broken input. It happens whenever the parabola never crosses the x-axis.

Entering a = 0

With no x² term, the equation is linear, not quadratic — use the Algebra Solver instead, since dividing by 2a with a = 0 is undefined.

Frequently asked questions

What does it mean when the discriminant is exactly zero?

The parabola touches the x-axis at exactly one point — a repeated root, meaning both x₁ and x₂ come out equal.

How do complex roots show up in the result?

As a real part plus or minus an imaginary part, e.g. x = 2 ± 3i, where i represents the square root of −1.

Can I verify a root without redoing the formula?

Substitute it back into ax² + bx + c — if the equation is genuinely satisfied, the result should equal exactly 0.

Does the order of a, b, c matter?

Yes — they must correspond exactly to the coefficients of x², x, and the constant respectively in that order.

Learn more

The Discriminant: Knowing the Answer's Shape Before You Solve

b² − 4ac tells you whether a quadratic has two real roots, one, or none — before you finish the formula.

Related calculators