Quadratic equation solver
Type a quadratic equation and get its solutions with the working: factoring when the roots are rational, otherwise the quadratic formula with the discriminant and exact square roots. Negative discriminants give the complex pair.
- Quadratic formula with a = 1, b = −2, c = −1: x = (−b ± √(b² − 4ac)) / (2a)
- Discriminant: b² − 4ac = 8
- √8 = 2√2, so x = 1 ± √2
How to use it
- 1Type the equation in any form:
x^2 - 2x - 1 = 0,2x^2 = 3x + 5,x(x - 4) = 12. - 2Press Solve. The calculator rearranges it to ax² + bx + c = 0, then factors or uses the formula.
- 3Graph it to see the parabola: the solutions are the x-intercepts, and the vertex sits halfway between them.
The quadratic formula
Every equation ax² + bx + c = 0 with a ≠ 0 has solutions
For x² − 2x − 1 = 0, a = 1, b = −2 and c = −1, so b² − 4ac = 4 + 4 = 8 and x = (2 ± √8)/2. Since √8 = 2√2, that simplifies to x = 1 ± √2, or about 2.414 and −0.414.
What the discriminant tells you
The expression under the square root, D = b² − 4ac, decides what kind of solutions there are before you work them out:
| Discriminant | Solutions | Graph |
|---|---|---|
| D > 0, a perfect square | Two rational solutions; it factors | Crosses the x-axis twice |
| D > 0, not a perfect square | Two irrational solutions | Crosses the x-axis twice |
| D = 0 | One repeated solution | Touches the x-axis at the vertex |
| D < 0 | No real solutions; two complex ones | Never meets the x-axis |
Factoring first, when it works
When the discriminant is a perfect square, factoring is quicker and less error-prone than the formula. x² − 5x + 6 = 0 has D = 25 − 24 = 1, a perfect square, and factors as (x − 2)(x − 3) = 0. By the zero product property, one of the factors must be zero, so x = 2 or x = 3. The factoring calculator shows the methods in detail.
Completing the square
The quadratic formula comes from completing the square, which is also how you find the vertex. For x² − 2x − 1 = 0, add and subtract the square of half the x-coefficient: (x − 1)² − 1 − 1 = 0, so (x − 1)² = 2 and x − 1 = ±√2. The same steps on ax² + bx + c = 0 produce the formula. The vertex form guide shows how this reveals the vertex of the parabola: here it is (1, −2).
See vertex form for the graph side of the story.
Examples to try
y = x^2 - 2x - 1y = x^2 + x + 2Frequently asked questions
How do I solve a quadratic equation?
What is the discriminant?
Does it give exact answers?
Can it solve quadratics with complex roots?
What if my equation isn’t in standard form?
Related tools and guides
Graph any quadratic and its roots, vertex and y-intercept are marked automatically.