🧮 Quadratic Equation Solver
Solves ax² + bx + c = 0. Enter a, b and c below — roots update live, including complex roots when the discriminant is negative.
The quadratic formula, and what the discriminant decides
Roots come from the standard formula. The part under the square root is checked first, because its sign settles how many real answers exist:
D = b² − 4ac
x = (−b ± √D) / 2a vertex x = −b / 2a
D > 0 two real roots D = 0 one double root
D < 0 a conjugate pair, −b/2a ± (√−D / 2a) i
The defaults a = 1, b = −3, c = 2 give D = 9 − 8 = 1, so the roots are (3 ± 1) / 2: 2 and 1. The vertex sits at x = 1.5, which substituted back gives y = −0.25.
Reading the rest of the card
- Roots are where the curve meets the x-axis. A negative discriminant means it never does, so you get complex roots, not an error.
- The sign of a sets the shape. Positive opens upward, so the vertex is the minimum; negative opens downward, so it is the maximum.
- The axis of symmetry is the vertex's x value, the midpoint of the two roots.
- Quick sanity check: the roots should add to −b/a and multiply to c/a. Here 1 + 2 = 3 and 1 × 2 = 2, which matches.
Frequently asked questions
What are the roots of x^2 - 3x + 2 = 0?
1 and 2. The discriminant is 1, so the formula gives (3 plus or minus 1) over 2. It factors as (x - 1)(x - 2).
What does a negative discriminant mean?
There are no real roots, because the parabola never crosses the x-axis. You get a conjugate pair instead: x^2 + 2x + 5 has a discriminant of -16 and roots -1 + 2i and -1 - 2i.
How do you find the vertex of a parabola?
The x value is -b over 2a; substitute it back for y. For x^2 - 3x + 2 that is x = 1.5, y = -0.25.