Skip to content

Quadratic Equation Solver

Enter a quadratic equation and get both roots with the discriminant, the method used and a check. Real, repeated and complex roots are all handled.

Your problem will appear here as you type.

How to use the quadratic equation solver

  1. Type the equation, for example 2x^2 + 3x - 4 = 0. Terms can be on either side of the equals sign.
  2. Press Solve. The solver computes the discriminant and picks factoring or the quadratic formula.
  3. Read both roots, open the steps, and look at the parabola to see where it meets the x-axis.

What is a quadratic equation?

A quadratic equation has the form ax² + bx + c = 0 with a ≠ 0. Its graph is a parabola, and the solutions are the x-values where that parabola meets the x-axis. There can be two, one or none of them in the real numbers.

Three ways to solve it

This solver tries factoring first, because it is the clearest to read, and falls back to the formula when the equation does not factor over the integers.

  1. Factoring: fastest when the numbers are small and the roots are whole numbers.
  2. The quadratic formula: always works. x = (−b ± √(b² − 4ac)) / 2a.
  3. Completing the square: useful for finding the vertex form of the parabola.

The discriminant tells you what to expect

Discriminant b² − 4acRootsParabola
PositiveTwo different real rootsCrosses the x-axis twice
ZeroOne repeated real rootTouches the x-axis at its vertex
NegativeTwo complex rootsNever reaches the x-axis

Example: a repeated root

Solve x² − 6x + 9 = 0

  1. The discriminant is (−6)² − 4·1·9 = 36 − 36 = 0, so there is one repeated root.
  2. Recognise a perfect square: x² − 6x + 9 = (x − 3)².
  3. Set (x − 3)² = 0, so x = 3.

Answer: x = 3 (double root)

Example: complex roots

Solve x² + 2x + 5 = 0

  1. Discriminant: 2² − 4·1·5 = 4 − 20 = −16.
  2. Since √(−16) = 4i, the formula gives x = (−2 ± 4i) / 2.
  3. Simplify: x = −1 ± 2i.

Answer: x = −1 + 2i and x = −1 − 2i

Sum and product of roots

For ax² + bx + c = 0 the two roots add up to −b/a and multiply to c/a. It is a quick way to check an answer: for x² − 5x + 6 = 0 the roots 2 and 3 sum to 5 and multiply to 6, exactly as −b/a and c/a predict.

Frequently asked questions

What if a = 0?

Then the equation is linear, not quadratic. Use the linear equation solver or the general equation solver.

Why does the solver sometimes give decimals?

When the roots are irrational, such as (−3 ± √41)/4, the exact form is shown with a decimal approximation next to it.

Other calculators