Quadratic equation solver
Solve ax² + bx + c = 0, including repeated and complex roots, and inspect the discriminant and vertex.
Browser compute / no account / no upload
Solve ax² + bx + c = 0. The calculator reports real and complex roots, the discriminant, and the vertex of the parabola.
Method
- The roots come from the quadratic formula. The discriminant b² - 4ac decides whether the roots are real and distinct, real and repeated, or a complex conjugate pair.
- The vertex is at x = -b / (2a). Its y value is the minimum when a is positive and the maximum when a is negative.
- The calculator uses a stable form of the quadratic formula to reduce cancellation when b is large compared with the discriminant.
Reference: Wolfram MathWorld: Quadratic Equation
A quadratic equation describes a parabola. Its two roots are the points where the parabola crosses the x-axis, and the vertex is the turning point. This solver returns all three pieces of information, including complex roots when the parabola does not cross the axis.
Standard form and the formula
Write the equation as $ax^2 + bx + c = 0$ with $a \neq 0$. Completing the square gives the quadratic formula:
The expression inside the square root is the discriminant, $\Delta = b^2 - 4ac$. Its sign determines the number and type of roots.
| Discriminant | Roots | Graph |
|---|---|---|
| Positive | Two distinct real roots | Crosses the x-axis twice |
| Zero | One repeated real root | Touches the x-axis at the vertex |
| Negative | Complex conjugate pair | Does not cross the x-axis |
Worked example: two real roots
Example 1
Solve x² - 5x + 6 = 0
Problem
Find the roots of .
Solution
Identify , , and .
Compute the discriminant: .
Apply the formula: .
Answer
x = 2 or x = 3
Worked example: complex roots
Example 2
Solve x² + 2x + 5 = 0
Problem
Find the roots of .
Solution
Identify , , and .
Compute the discriminant: .
The square root is , so .
Answer
x = -1 + 2i or x = -1 - 2i
Vertex and axis of symmetry
The vertex lies on the axis of symmetry $x = -b/(2a)$. Substitute that x value into the quadratic to get the vertex y value. For $x^2 - 5x + 6$, the vertex is at $x = 2.5$ and $y = -0.25$, a minimum because $a > 0$.
Common mistakes
- Forgetting the negative sign in $-b$. With $b = -5$, the numerator starts at $+5$.
- Dividing by $a$ instead of $2a$.
- Treating a negative discriminant as an error. It means the roots are complex, not that the equation has no solution.
- Dropping the $i$ when writing a complex root. The imaginary unit is part of the answer.
- Confusing the vertex x value with a root. They coincide only when the discriminant is zero.
Limits and assumptions
The solver accepts real coefficients and returns roots in floating point. Very large coefficients or nearly repeated roots can lose precision, which is why the stable formula is used. It does not show a factored form, a step-by-step derivation, or inequalities such as $ax^2 + bx + c > 0$.
Key takeaways
- The discriminant $b^2 - 4ac$ decides whether the roots are real, repeated, or complex.
- The quadratic formula gives both roots; the vertex is at $x = -b/(2a)$.
- A negative discriminant produces a complex conjugate pair, not an error.
- Check the sign of $b$ and the denominator $2a$ before trusting a hand calculation.