Quadratic equation solver

Solve an equation of the form ax² + bx + c = 0

x² + x + = 0

❓ How the calculator works

The calculator solves a quadratic equation of the form ax² + bx + c = 0. First it computes the discriminant D, then determines the roots by its sign. Coefficient a cannot be zero — otherwise the equation is not quadratic.

📐 Formulas

Discriminant

D = b² − 4ac

Roots

x = (−b ± √D) / (2a)

When D = 0: x = −b / (2a)

  • D > 0 — two distinct real roots
  • D = 0 — one root (a double root)
  • D < 0 — no real roots

💡 Calculation example

Equation x² + 5x + 6 = 0 (a = 1, b = 5, c = 6):

  • D = 5² − 4 × 1 × 6 = 25 − 24 = 1
  • x₁ = (−5 + 1) / 2 = −2
  • x₂ = (−5 − 1) / 2 = −3

Check: (x + 2)(x + 3) = 0 — the roots are correct.

✅ Tips

  • Simplify the equation first: divide all terms by a common divisor if there is one.
  • If D is a perfect square, the roots have no fractional part.
  • For D < 0, advanced courses use complex roots: x = (−b ± i√|D|) / (2a).
  • Vieta’s formulas help verify the result: for x² + bx + c = 0 the sum of roots is −b and the product is c.