Quadratic Equation Solver: Exact Roots, Steps & Graph
Enter a, b and c, or type the whole equation, and get exact roots (whole numbers, fractions, square roots or complex numbers) with decimals, the discriminant, the vertex, a graph and every step of the quadratic formula.
Get the Equation Into Standard Form First
The quadratic formula only works on ax² + bx + c = 0, so read a, b and c only after zero is alone on one side.
- Move everything to one side. 3x² = 12x − 9 becomes 3x² − 12x + 9 = 0. A common factor can go too: dividing by 3 gives x² − 4x + 3 = 0, which is easier to solve. Either way, the roots are 1 and 3.
- Fill in missing terms with 0. In x² − 9 = 0 there is no x term, so b = 0. In x² + 4x = 0, c = 0.
- Clear fractions and decimals. ½x² + x − 4 = 0 is easier as x² + 2x − 8 = 0 after multiplying by 2. The roots, 2 and −4, don’t change.
The “Type the equation” tab does all three and shows the result in its first step. If a turns out to be 0, the solver treats it as the linear equation it is.
One Example, Every Step
Solve 2x² − 4x − 1 = 0, so a = 2, b = −4 and c = −1.
- Discriminant: b² − 4ac = (−4)² − 4 × 2 × (−1) = 16 + 8 = 24.
- Square root: √24 = √(4 × 6) = 2√6. The Square Root Calculator shows how to pull square factors out like this.
- Formula: x = (4 ± 2√6) / 4.
- Simplify: every term, 4, 2 and 4, shares a factor of 2, so x = (2 ± √6) / 2.
- Decimals: x ≈ 2.2247 or x ≈ −0.2247.
Step 4 is where many answers go wrong. Cancelling the two 4s and leaving 1 ± 2√6 is incorrect, because a factor can only be cancelled if it divides every term on top.
Three Sign Slips
Negative coefficients cause many wrong answers:
- −b when b is negative. If b = −4, then −b = 4, not −4.
- Squaring a negative b. (−4)² = 16. On many scientific calculators, typing −4² gives −16, because the square is worked out before the minus sign. Use brackets. The CalcSolver scientific calculator follows the same order: −4^2 gives −16 and (−4)^2 gives 16.
- −4ac when a or c is negative. With a = 2 and c = −1, −4ac = −4 × 2 × (−1) = +8. That’s why the discriminant above is 16 + 8 rather than 16 − 8.
What the Discriminant Tells You Before You Solve
The discriminant, b² − 4ac, is the part under the square root. Its value tells you what kind of answers to expect:
| Equation | Discriminant | Roots | Graph |
|---|---|---|---|
| x² − 5x + 6 = 0 | 1, a perfect square | 2 and 3, rational | crosses the x-axis twice |
| x² + 4x − 1 = 0 | 20, positive but not a perfect square | −2 ± √5, irrational | crosses twice |
| x² − 6x + 9 = 0 | 0 | 3, a repeated root | touches the axis at its vertex |
| x² + 2x + 5 = 0 | −16, negative | −1 ± 2i, complex | never meets the axis |
A negative discriminant doesn’t mean the equation has no solution. It means there is no real solution. The two complex roots always come as a conjugate pair, like −1 + 2i and −1 − 2i.
Factor, Formula or Complete the Square?
- Factoring is quickest when the roots are whole numbers or simple fractions: x² − 5x + 6 = (x − 2)(x − 3). With whole-number coefficients, it only works when the discriminant is a perfect square. For example, x² − 3x − 30 = 0 has a discriminant of 129, so no pair of whole numbers works. Its roots are (3 ± √129) / 2, about 7.18 and −4.18.
- The quadratic formula always works, including for irrational and complex roots.
- Completing the square gives the vertex form, a(x − h)² + k, which shows the turning point directly: x² − 5x + 6 = (x − 5/2)² − 1/4.
The solver shows the standard, factored and vertex forms for every equation.
Check Your Roots in Seconds
For roots x₁ and x₂ of ax² + bx + c = 0:
- Sum of roots = −b/a
- Product of roots = c/a
For 2x² − 5x − 3 = 0, the roots are 3 and −1/2. Their sum is 5/2, which matches −(−5)/2. Their product is −3/2, which matches c/a = −3/2. If either check fails, look for a sign error.
It works for irrational roots too. The golden ratio comes from x² − x − 1 = 0, where −b = +1, so the roots are (1 ± √5)/2, about 1.618 and −0.618. They add to 1 and multiply to −1. Writing −1 on top instead swaps their signs and fails the check.
Reading the Graph
The graph of y = ax² + bx + c is a parabola.
- It opens upward when a is positive and downward when a is negative.
- Its vertex is at x = −b/2a, on the axis of symmetry halfway between the roots.
- It crosses the y-axis at (0, c).
- The roots are where it meets the x-axis. When the discriminant is negative, it never does.
A Real Problem: When Does the Ball Land?
A ball is thrown straight up at 15 m/s from a height of 1.5 m. Ignoring air resistance, its height after t seconds is h = −4.9t² + 15t + 1.5, where 4.9 is half of gravity’s 9.8 m/s². To find when it lands, set h = 0 and type −4.9x^2 + 15x + 1.5 = 0, with x standing in for t.
The roots are about 3.16 and −0.10. Time can’t be negative, so the ball lands after about 3.16 seconds. The vertex gives the highest point: at t = 15 ÷ 9.8 ≈ 1.53 s, the ball reaches about 12.98 m.
