Quadratic Equation Solver

Solve ax² + bx + c = 0 with real or complex roots.

Open tool

Overview

The Quadratic Equation Solver finds both roots of ax² + bx + c = 0, whether they are two real numbers, a single repeated real or a complex conjugate pair. Enter a, b and c, and the solver returns the roots along with the discriminant so you can see why you got the case you did.

It is built for algebra students who need a quick check, physicists solving projectile-motion problems and engineers computing root locations in transfer functions. Hand-computing (-b ± sqrt(b² - 4ac)) / 2a is easy to misremember; the calculator removes that risk.

How it works

The discriminant is D = b² - 4ac. If D > 0 the equation has two distinct real roots x = (-b ± sqrt(D)) / 2a. If D = 0 there is a single repeated root x = -b / 2a. If D < 0 the roots are complex conjugates (-b ± i * sqrt(-D)) / 2a.

For better numerical stability when b² >> 4ac, the solver computes one root with the standard formula and the other via the identity x1 * x2 = c / a, which avoids subtracting two nearly equal numbers.

Examples

x² - 5x + 6 = 0  →  x = 2, 3
x² - 2x + 1 = 0  →  x = 1 (repeated)
x² + 1 = 0  →  x = +i, -i
2x² + 3x - 2 = 0  →  x = 0.5, -2

FAQ

What does the discriminant tell me?

Its sign tells you the root structure: positive = two real roots, zero = repeated real, negative = complex conjugates.

What if a is zero?

Then it isn't quadratic. The equation reduces to linear bx + c = 0 with single root x = -c / b.

Why is the standard formula sometimes inaccurate?

When b² >> 4ac, computing -b + sqrt(b² - 4ac) subtracts nearly equal numbers, losing precision. Using Vieta's identity for the second root keeps both digits.

Can the coefficients be negative or fractional?

Yes, any real number. Complex coefficients aren't supported in this tool.

How are complex roots displayed?

In rectangular form α + βi. To get polar form, compute sqrt(α² + β²) and atan2(β, α).

Try Quadratic Equation Solver

An unhandled error has occurred. Reload ×