Skip to content

Quadratic Equation Solver (ax² + bx + c = 0)

Solve ax² + bx + c = 0: discriminant, real or complex roots, the vertex of the parabola and the sum and product of the roots.

Version 2

Things to keep in mind:

  • A root field showing 0 can also mean that there is no real root; read it together with "Number of real roots".
  • Coefficients can have up to 6 decimals within ±1,000,000. Fractions entered as decimals (0.333333 for 1/3) add rounding error; multiply the equation by the denominator if needed.
  • Cubic and higher-degree equations and inequalities are not solved.

Calculator

Coefficients of ax² + bx + c = 0

Coefficient of x²; must not be 0 for a quadratic (with 0 the linear equation is solved).

Coefficient of x; enter 0 if there is no x term. Use a minus sign for negative values.

Constant term; enter 0 if there is none.

After the first calculation, the result updates automatically when you change a value.

Result

Enter the values and press Calculate to see the result here.

About this tool

The quadratic equation solver solves ax² + bx + c = 0 with the discriminant method and returns the vertex of the parabola.

Formulas

  • Discriminant: Δ = b² − 4ac
  • Δ > 0: two distinct real roots, x₁,₂ = (−b ∓ √Δ) / 2a
  • Δ = 0: one double root, x = −b / 2a
  • Δ < 0: no real roots; complex roots x = −b / 2a ± (√(−Δ) / 2|a|) · i
  • Vertex: V(−b / 2a, −Δ / 4a)
  • Vieta's formulas: x₁ + x₂ = −b / a, x₁ · x₂ = c / a

The roots are sorted (x₁ ≤ x₂). With a = 0 the equation becomes linear, bx + c = 0; for b ≠ 0 its single root x = −c / b is shown in both root fields and the vertex and Vieta values are 0.

Example: for x² − 5x + 6 = 0, Δ = 25 − 24 = 1, so x₁ = (5 − 1) / 2 = 2 and x₂ = (5 + 1) / 2 = 3. The vertex is (2.5, −0.25), the sum of the roots 5 and the product 6.

Complex example: x² + 2x + 5 = 0 has Δ = −16 and the roots −1 ± 2i.

How to use

  1. Bring your equation to the form ax² + bx + c = 0.
  2. Enter a, b and c with their signs; use 0 for a missing term.
  3. Press Calculate.

Notes

Arithmetic uses 64 significant digits and every result is rounded to 8 decimals (HALF_UP). Roots are sorted ascending. Without real roots the root fields show 0 and the complex roots are given as real and imaginary parts. With a = 0 the linear solution is shown; with a = 0 and b = 0 the number of real roots is 0 (if c = 0 every x is a solution).

Frequently asked questions

4 questions
  1. Δ = b² − 4ac decides the number of roots: Δ > 0 two distinct real roots, Δ = 0 one double root, Δ < 0 no real roots (two complex conjugate roots).

Next step

Related tools to continue your calculation.

All tools in Math & Geometry