Quadratic Equation Solver

MATH FREE

Free quadratic equation solver. Find real and complex roots of ax² + bx + c = 0 with the quadratic formula and discriminant. Step-by-step.

Quadratic formula: what this solver returns

A quadratic solver finds the values of x that make ax² + bx + c = 0 true. Enter the three coefficients and it applies the quadratic formula x = (−b ± √(b² − 4ac)) / 2a, then reports whether you have two real roots, one repeated root, or a pair of complex roots.

How the calculation works

The solver reads a, b, and c, then computes the discriminant D = b² − 4ac. That one number decides the shape of the answer before any root is evaluated:

  • D > 0: two distinct real roots, x = (−b + √D) / 2a and x = (−b − √D) / 2a.
  • D = 0: one double real root, x = −b / 2a.
  • D < 0: two complex roots, x = −b/2a ± (√−D / 2a)i.

If a is zero the equation is no longer quadratic, so the solver falls back to the linear equation bx + c = 0 and returns x = −c/b. If a and b are both zero, it reports either “all real numbers” (when c is also zero) or “no solution”.

Worked example using the default values

The form loads a = 1, b = −5, c = 6, which is x² − 5x + 6 = 0. Following the steps:

StepWorkingResult
Discriminant(−5)² − 4 × 1 × 625 − 24 = 1
Square root of D√11
Root one(5 + 1) / (2 × 1)3
Root two(5 − 1) / (2 × 1)2

The two roots are 3 and 2. Check them: 3 × 2 = 6, which is the constant c, and 3 + 2 = 5, which is −b. Those two facts come from factorising the expression as (x − 3)(x − 2), and they are a fast way to confirm any result.

Discriminant and root reference

Equationa, b, cDiscriminantRoots
x² − 5x + 6 = 01, −5, 612 and 3
x² − 4x + 4 = 01, −4, 402 (double)
x² + x + 1 = 01, 1, 1−3−0.5 ± 0.866025i
2x² + 3x − 2 = 02, 3, −2250.5 and −2
3x² − 12 = 03, 0, −121442 and −2

For the complex example the real part is −b/2a = −0.5 and the imaginary part is √3 / 2 ≈ 0.866025, matching the output −0.5 ± 0.866025i. When D is a perfect square the roots are rational; when it is not, they are irrational surds.

Common mistakes

  • Not moving everything to one side. x² + 3x = 10 must be rewritten as x² + 3x − 10 = 0 before you read off a, b, and c.
  • Dropping the sign of b. The formula opens with −b, so b = −5 becomes +5 in the numerator.
  • Taking the root of only part of the numerator. The whole of −b ± √D sits over 2a; evaluate the square root before dividing.
  • Assuming a can never be zero. If a = 0 there is a single linear solution, not a quadratic pair.
  • Rounding the discriminant too early. Keep D exact so the root type is decided correctly when D is very close to zero.

How many solutions can a quadratic have?

At most two roots over the real numbers. A positive discriminant gives two, zero gives one repeated root, and a negative discriminant gives none in real numbers but two complex conjugates. The equation never has three or more real roots.

What does a negative discriminant mean on a graph?

The parabola y = ax² + bx + c does not touch the x-axis, so no real x makes y zero. The roots still exist as the conjugate pair −b/2a ± (√−D / 2a)i.

Does the solver show exact fractions?

No. Roots are printed to six decimal places with trailing zeros removed, so a root of one half appears as 0.5. Use the decimal value for applied work and the working above to recover an exact surd or fraction when you need it.

What if the discriminant is a perfect square?

Then √D is a whole number and both roots are rational, which usually means the quadratic factorises neatly with integer coefficients. A discriminant of 1, 4, 9, 16, and so on is the signal to look for factors.

Right-triangle problems use the same algebra, so the Pythagorean calculator is a natural next step, and the basic calculator covers the arithmetic between the steps above.