Quadratic Equation Solver
Math Calculators
Use this browser-based solver to find real or complex roots of ax² + bx + c = 0. View the discriminant, vertex, and solution steps.
Solution
Two real rootsShow step-by-step solution
ax² + bx + c = 0
1x² + -3x + 2 = 0
Discriminant = b² − 4ac = -3² − 4 × 1 × 2 = 1
√discriminant = 1
x = (−-3 ± 1) / (2 × 1)
Stable evaluation: q = −½(b + sign(b)√discriminant); x₁ = q/a and x₂ = c/q
x₁ = 2
x₂ = 1
Vertex: (1.5, -0.25)
Parabola: 1x² + -3x + 2
| x | f(x) = 1x² + -3x + 2 |
|---|---|
| -3.5000 | 24.7500 |
| -2.3889 | 14.8735 |
| -1.2778 | 7.4660 |
| -0.1667 | 2.5278 |
| 0.9444 | 0.0586 |
| 2.0556 | 0.0586 |
| 3.1667 | 2.5278 |
| 4.2778 | 7.4660 |
| 5.3889 | 14.8735 |
| 6.5000 | 24.7500 |
How to use this tool
- Enter coefficients. Type the values of a, b, and c for your equation ax² + bx + c = 0. Decimals and negative numbers are accepted.
- View roots. The two roots (real or complex) are displayed instantly, along with the discriminant and vertex of the parabola.
- Check your work. The step-by-step solution shows how the quadratic formula was applied so you can verify each step.
The quadratic formula
For any equation of the form ax² + bx + c = 0, the solutions are:
x = (−b ± √(b² − 4ac)) / 2a
For two distinct real roots, the calculator evaluates an equivalent, more numerically stable
form: q = −½(b + sign(b)√(b² − 4ac)), followed by x₁ = q/a and
x₂ = c/q. This avoids loss of precision when the usual formula subtracts two
nearly equal numbers, such as when one root is very small and the other is very large. For a
repeated root, it uses the direct value −b/(2a).
Interpreting the discriminant
| Discriminant (b²−4ac) | Root type |
|---|---|
| Positive (> 0) | Two distinct real roots |
| Zero (= 0) | One repeated real root (tangent to x-axis) |
| Negative (< 0) | Two complex conjugate roots (no real x-intercepts) |
The vertex of the parabola
The vertex (h, k) is the turning point of the parabola y = ax² + bx + c:
h = −b / 2a k = c − b² / 4a
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.
Completing the square
The quadratic formula is derived by completing the square on ax² + bx + c = 0:
- Divide through by a: x² + (b/a)x + c/a = 0
- Move the constant: x² + (b/a)x = −c/a
- Add (b/2a)² to both sides: (x + b/2a)² = (b² − 4ac) / 4a²
- Take the square root and solve for x to get the quadratic formula.
Understanding this derivation helps students connect the formula to the structure of the parabola.
Worked examples
| Equation | Discriminant | Roots |
|---|---|---|
| x² − 5x + 6 = 0 | 25 − 24 = 1 > 0 | x = 2, x = 3 (two real roots) |
| x² − 4x + 4 = 0 | 16 − 16 = 0 | x = 2 (repeated root) |
| x² + x + 1 = 0 | 1 − 4 = −3 < 0 | x = (−1 ± i√3) / 2 (complex pair) |
Graphing connection
Every part of ax² + bx + c corresponds to a geometric property of the parabola:
- The roots (solutions) are the x-intercepts — where the parabola crosses the x-axis.
- The vertex formula (h = −b/2a) gives the turning point and axis of symmetry.
- The sign of a determines orientation: a > 0 opens upward (minimum); a < 0 opens downward (maximum).
Frequently asked questions
What is the quadratic formula?
The quadratic formula solves ax² + bx + c = 0: x = (−b ± √(b² − 4ac)) / 2a. Enter your a, b, and c values above to get the roots instantly.
How does the solver avoid rounding error for very different-sized roots?
For real roots, the displayed result is algebraically equivalent to the quadratic formula, but the calculator first computes q = −½(b + sign(b)√(b² − 4ac)) and then uses q/a and c/q. This avoids subtracting nearly equal floating-point values when one root is much smaller than the other. A repeated root uses −b/(2a) directly.
What is the discriminant?
The discriminant is b² − 4ac. If it is positive, the equation has two distinct real roots. If zero, one repeated real root. If negative, two complex conjugate roots.
What happens when a = 0?
If a = 0 the equation is linear (bx + c = 0), not quadratic. This solver requires a ≠ 0.
What are complex roots?
When the discriminant is negative, the square root of a negative number produces an imaginary component. The roots are a pair of complex conjugates: α + βi and α − βi.
Related tools
- Polynomial SolverContinue to cubic or quartic equations when the polynomial degree is greater than two.
- Function GrapherPlot the parabola to inspect roots, vertex, intercepts, and opening direction.
- Complex Number CalculatorWork with non-real roots when the quadratic discriminant is negative.
- Derivative CalculatorDifferentiate the quadratic to confirm its vertex and rate of change.