Quadratic Equation Solver
Solve any quadratic equation ax² + bx + c = 0. See both roots, the discriminant, the vertex, and whether the solutions are real or complex.
How the quadratic equation solver works
Every quadratic equation can be written in the standard form ax² + bx + c = 0, where a ≠ 0. The quadratic formula — x = (−b ± √(b² − 4ac)) / 2a — gives both solutions directly from the three coefficients, without factoring or completing the square. This tool evaluates the formula and also reports the discriminant, the vertex of the parabola, and whether the roots are real or complex.
The formula, written out
The plus-minus sign in the formula generates two solutions. The core of the formula is the discriminant, D = b² − 4ac, which sits under the square root. Its sign tells you everything about the nature of the roots:
- D > 0: two distinct real roots. The parabola crosses the x-axis at two points.
- D = 0: one repeated real root. The parabola touches the x-axis at its vertex.
- D < 0: two complex conjugate roots. The parabola does not cross the x-axis at all. The roots are p + qi and p − qi, where p = −b/(2a) and q = √(−D)/(2a).
Worked example
Solve x² − 5x + 6 = 0. Here a = 1, b = −5, c = 6.
- Discriminant: D = (−5)² − 4(1)(6) = 25 − 24 = 1. Positive, so two real roots.
- Square root of discriminant: √1 = 1.
- Roots: x = (5 ± 1) / 2 = 3 or 2.
The equation factors as (x − 2)(x − 3) = 0, which agrees. The vertex of the parabola y = x² − 5x + 6 is at (h, k) where h = −b/(2a) = 2.5 and k = c − b²/(4a) = 6 − 6.25 = −0.25.
A complex-roots example
Solve x² + 2x + 5 = 0. Here a = 1, b = 2, c = 5.
- Discriminant: D = 4 − 20 = −16. Negative, so complex roots.
- p = −b/(2a) = −1. q = √16/(2·1) = 2.
- Roots: −1 + 2i and −1 − 2i.
These are complex conjugates — a pair of numbers that mirror each other across the real axis in the complex plane. Every quadratic with real coefficients has roots that come either as two reals or as a conjugate pair.
The vertex
The vertex is the maximum or minimum point of the parabola y = ax² + bx + c. Its x-coordinate is always −b/(2a) — the midpoint of the two roots when they are real. Its y-coordinate is c − b²/(4a), obtained by substituting the x back into the equation. If a > 0 the parabola opens upward and the vertex is the minimum; if a < 0 it opens downward and the vertex is the maximum.
The vertex appears in the completed-square form of the equation: y = a(x − h)² + k, where (h, k) is the vertex. This form makes it visually obvious where the parabola's turning point is.
Edge cases
a = 0. Not a quadratic. The equation becomes bx + c = 0, a linear equation with root x = −c/b. This calculator flags a = 0 rather than dividing by zero.
Very small coefficients. Floating-point rounding can make the discriminant appear slightly non-zero when it should be exactly zero. Roots may come out as, say, 2.0000001 instead of 2. This is numerical noise, not a different answer. If you need exact symbolic roots, use a computer algebra system.
Non-real coefficients. This solver handles real a, b, c. Quadratics with complex coefficients require more general techniques.
What this calculator is not
This tool solves one quadratic at a time. It does not factor polynomials of higher degree, solve systems of equations, or handle inequalities. It also does not show symbolic steps — it gives numerical answers only. For symbolic manipulation or step-by-step algebra, a computer algebra system is more appropriate.