Quadratic equation calculator: discriminant, roots, vertex, and parabola graph in one tool
This quadratic equation calculator — also called a quadratic formula calculator — solves any equation of the form ax² + bx + c = 0. Type in the three coefficients, a, b and c, and it instantly returns the discriminant, both roots (real or complex), the vertex of the parabola and its axis of symmetry, the sum and product of the roots, the vertex form and factored form of the equation, and an interactive graph of the parabola with the vertex and roots marked on it.
Most quadratic calculators online split this into separate tools: one for the discriminant, another for the roots, another for the vertex, another for the parabola graph. Here it’s one equation, one set of coefficients, one page — every piece of information you’d need for homework, a test, or a quick engineering check, worked out at once.
How to use the quadratic equation calculator
- Enter coefficient a — the number multiplying x². It can be any positive or negative number except zero.
- Enter coefficient b — the number multiplying x. Leave it at 0 if your equation has no linear term.
- Enter coefficient c — the constant term. Leave it at 0 if your equation has no constant.
- Read the results: the discriminant, the roots x₁ and x₂ (real, a repeated real root, or complex), the vertex coordinates, the sum and product of the roots, and the graph.
If you set a = 0, the calculator tells you so instead of guessing — ax² + bx + c = 0 stops being a quadratic equation the moment a is zero (more on that below).
How the calculator works
The discriminant (the “delta”)
The discriminant of a quadratic equation is Δ = b² − 4ac. Its sign alone tells you how many real solutions the equation has, before you calculate anything else:
| Discriminant | What it means |
|---|---|
| Δ > 0 | two distinct real roots |
| Δ = 0 | one real root, repeated (a double root) |
| Δ < 0 | no real roots — two complex conjugate roots instead |
For x² − 5x + 6 = 0 (a=1, b=−5, c=6): Δ = (−5)² − 4·1·6 = 25 − 24 = 1. Since Δ > 0, the equation has two distinct real roots.
Finding the roots with the quadratic formula
The quadratic formula gives the roots directly from the coefficients: x = (−b ± √Δ) / (2a). What happens next depends on the sign of Δ:
- Δ > 0: x₁ = (−b − √Δ)/(2a) and x₂ = (−b + √Δ)/(2a) — two different real numbers. For x² − 5x + 6 = 0, √Δ = √1 = 1, so x₁ = (5 − 1)/2 = 2 and x₂ = (5 + 1)/2 = 3.
- Δ = 0: a single formula, x = −b/(2a), with nothing to take the square root of. For x² − 4x + 4 = 0, Δ = 16 − 16 = 0, so x = 4/2 = 2 (a double root — the parabola just touches the x-axis at this one point, exactly at its vertex).
- Δ < 0: there’s no real number whose square is negative, so the roots become complex roots (also called imaginary roots), written as a ± bi. The real part is −b/(2a); the imaginary part is √(−Δ)/(2a). For x² + 2x + 5 = 0, Δ = 4 − 20 = −16, so x = −1 ± i·√16/2 = −1 + 2i and −1 − 2i.
Internally, the calculator uses a numerically stable version of this formula for the Δ > 0 case (avoiding the precision loss that a naive implementation suffers when b² and 4ac are close in size), so the two roots stay accurate even for extreme coefficients.
The vertex of the parabola and the axis of symmetry
Every quadratic equation ax² + bx + c = 0 corresponds to a parabola y = ax² + bx + c, and every parabola has a single turning point: its vertex. The coordinates are xᵥ = −b/(2a) and yᵥ = c − b²/(4a). The vertical line x = xᵥ is the parabola’s axis of symmetry — the parabola is a mirror image of itself on either side of it.
For x² − 5x + 6 = 0: xᵥ = −(−5)/(2·1) = 2.5, yᵥ = 6 − 25/4 = −0.25. So the vertex sits at (2.5, −0.25), and the axis of symmetry is the line x = 2.5 — exactly halfway between the two roots, 2 and 3.
When a > 0, the parabola opens upward and the vertex is a minimum. When a < 0, it opens downward and the vertex is a maximum. Either way, the roots — when they exist — are always the same distance from the axis of symmetry, one on each side.
Vieta’s formulas: sum and product of the roots
Vieta’s formulas connect the roots directly to the coefficients, without solving the equation first: x₁ + x₂ = −b/a and x₁ · x₂ = c/a. They hold even when the roots are complex — the imaginary parts cancel out in the sum, and the product always comes out as a real number, so both quantities are useful checks on any answer.
For x² − 5x + 6 = 0: x₁ + x₂ = 2 + 3 = 5, and indeed −b/a = 5. x₁ · x₂ = 2 · 3 = 6, and indeed c/a = 6. For the complex-root example above, x² + 2x + 5 = 0: (−1+2i) + (−1−2i) = −2 = −b/a, and (−1+2i)(−1−2i) = 1 + 4 = 5 = c/a.
Vertex form and factored form
The vertex form of a quadratic equation rewrites it as y = a(x − h)² + k, where (h, k) is the vertex — a form that makes the maximum or minimum obvious at a glance. For x² − 5x + 6 = 0, the vertex form is y = 1·(x − 2.5)² − 0.25.
The factored form, y = a(x − x₁)(x − x₂), only exists when Δ ≥ 0, since it needs real roots to write down. For x² − 5x + 6 = 0, that’s y = (x − 2)(x − 3). At Δ = 0 it becomes a squared factor, like y = (x − 2)² for x² − 4x + 4 = 0; at Δ < 0 there’s no real factored form, so the calculator doesn’t show one.
What if a = 0?
By definition, a quadratic equation requires a ≠ 0 — that coefficient is what makes the x² term exist in the first place. If you set a to 0, the equation collapses to bx + c = 0, a straight line, not a parabola. The calculator flags this instead of returning a discriminant or roots, and if b isn’t zero either, it points you to the linear solution x = −c/b. For 3x − 6 = 0 (a=0, b=3, c=−6), that hint is x = −(−6)/3 = 2.
Step-by-step examples
Example 1: two distinct real roots — x² − 5x + 6 = 0
Here a=1, b=−5, c=6.
- Δ = (−5)² − 4·1·6 = 25 − 24 = 1. Since Δ > 0, expect two real roots.
- √Δ = 1, so x₁ = (5 − 1)/2 = 2 and x₂ = (5 + 1)/2 = 3.
- Vertex: xᵥ = 2.5, yᵥ = 6 − 6.25 = −0.25. Axis of symmetry: x = 2.5.
- Check with Vieta: sum = 2 + 3 = 5 = −b/a ✓; product = 2 · 3 = 6 = c/a ✓.
- Factored form: y = (x − 2)(x − 3). Vertex form: y = (x − 2.5)² − 0.25.
Example 2: a repeated (double) root — x² − 4x + 4 = 0
Here a=1, b=−4, c=4.
- Δ = (−4)² − 4·1·4 = 16 − 16 = 0 → a single, repeated real root.
- x = 4/2 = 2 (used for both x₁ and x₂).
- Vertex: xᵥ = 2, yᵥ = 4 − 4 = 0 — the vertex sits exactly on the x-axis, because the double root and the vertex are the same point here.
- Factored form: y = (x − 2)².
Example 3: complex (imaginary) roots — x² + 2x + 5 = 0
Here a=1, b=2, c=5.
- Δ = 2² − 4·1·5 = 4 − 20 = −16. Negative, so there are no real roots.
- Real part: −b/(2a) = −1. Imaginary part: √16/2 = 2. Roots: x = −1 + 2i and x = −1 − 2i.
- Vertex: xᵥ = −1, yᵥ = 5 − 1 = 4. Since a > 0 and the vertex sits above the x-axis (yᵥ = 4 > 0), the whole parabola stays above the x-axis — consistent with there being no real roots.
- No factored form exists over the real numbers; the graph still draws the full parabola, just without root markers.
Example 4: irrational roots — x² − 2 = 0
Here a=1, b=0, c=−2.
- Δ = 0 − 4·1·(−2) = 8. √8 = 2√2 ≈ 2.8284.
- x₁ = −√2 ≈ −1.4142, x₂ = √2 ≈ 1.4142 — neither root is a whole number, so the calculator shows the rounded decimal value.
- Vertex: xᵥ = 0, yᵥ = −2 — since b = 0, the vertex sits directly on the y-axis and the parabola is symmetric around it.