100% free no uploads no sign-up

quadratic equation solver

A quadratic equation ax² + bx + c = 0 has the solutions x = (−b ± √(b² − 4ac)) / (2a). When the roots are whole numbers or fractions it's quicker to factor. Type your equation and the solver picks the right method and shows each step.

mode: solve

Enter solves · Shift+Enter for a new line · put systems on separate lines or separate them with commas

problem
x² − 5x + 6 = 0
answer
x₁ = 2
x₂ = 3

✓ checked: substituting each answer back into the equation makes both sides equal.

step-by-step working

  1. Factor: find two numbers that multiply to 6 and add to −5. They are −2 and −3.

  2. So the equation factors as:

    (x − 2)(x − 3) = 0
  3. Set each factor equal to zero: x − 2 = 0 or x − 3 = 0.

    x = 2 or x = 3

Which method to use

Worked examples

x² − 5x + 6 = 0

answer
x₁ = 2
x₂ = 3

✓ checked: substituting each answer back into the equation makes both sides equal.

step-by-step working

  1. Factor: find two numbers that multiply to 6 and add to −5. They are −2 and −3.

  2. So the equation factors as:

    (x − 2)(x − 3) = 0
  3. Set each factor equal to zero: x − 2 = 0 or x − 3 = 0.

    x = 2 or x = 3

x² + 2x − 1 = 0

answer
x₁ = −1 − √2
x₂ = −1 + √2
≈ −2.41421 and 0.414214

✓ checked: substituting each answer back into the equation makes both sides equal.

step-by-step working

  1. It doesn't factor nicely, so use the quadratic formula x = (−b ± √(b² − 4ac)) / (2a) with a = 1, b = 2, c = −1.

  2. Work out the discriminant: b² − 4ac = (2)² − 4·1·(−1) = 8. It is positive, so there are two real roots.

  3. Simplify the square root: √8 = 2√2.

  4. Substitute and simplify:

    x = −1 ± √2

x² + x + 1 = 0

answer
x₁ = (−1 − i√3)/2
x₂ = (−1 + i√3)/2

✓ checked: substituting each answer back into the equation makes both sides equal.

No real solutions: the two solutions are complex conjugates.

step-by-step working

  1. It doesn't factor nicely, so use the quadratic formula x = (−b ± √(b² − 4ac)) / (2a) with a = 1, b = 1, c = 1.

  2. Work out the discriminant: b² − 4ac = (1)² − 4·1·1 = −3. It is negative, so there are no real roots, only two complex roots.

  3. Substitute and simplify:

    x = (−1 ± i√3)/2

The discriminant tells you what to expect

b² − 4acRootsGraph
positive, a perfect squaretwo rational roots (it factors)crosses the x-axis twice
positive, not a perfect squaretwo irrational roots, like 1 ± √2crosses the x-axis twice
zeroone repeated roottouches the x-axis once
negativetwo complex roots, like 3 ± 2inever meets the x-axis

Common mistakes

Solved equations

Frequently asked questions

What is the quadratic formula?

For ax² + bx + c = 0, x = (−b ± √(b² − 4ac)) / (2a). The ± gives the two roots. It always works, even when the equation doesn't factor.

What if the discriminant is negative?

There are no real solutions: the parabola never crosses the x-axis. In complex numbers there are two roots, written with i = √−1. For example x² − 6x + 13 = 0 has x = 3 ± 2i.

Why does it sometimes factor and sometimes use the formula?

Factoring is shorter and is the method most teachers expect when the roots are whole numbers or fractions. The solver checks the discriminant first: if it's a perfect square, the quadratic factors; otherwise it uses the formula.

Does it give exact answers or decimals?

Both. Roots are shown exactly, with square roots simplified (√8 = 2√2), and irrational roots also come with a decimal approximation.

More math tools