Enter a, b and c, or type the equation, to solve ax² + bx + c = 0: the roots with their exact form, each step of the quadratic formula, the vertex and factored forms, and a graph.
y = x² − 5x + 6: roots on the x-axis, vertex at (2.5, −0.25), axis of symmetry dashed.
How to solve a quadratic equation
Write it as ax² + bx + c = 0 and read off a, b and c.
Work out the discriminant D = b² − 4ac.
Put the numbers into x = (−b ± √D) ÷ 2a and simplify.
Worked example
x² − 5x + 6 = 0: a = 1, b = −5, c = 6. D = (−5)² − 4 × 1 × 6 = 25 − 24 = 1, so x = (5 ± 1) ÷ 2, giving x = 2 or x = 3. Check: 2 + 3 = 5 = −b/a and 2 × 3 = 6 = c/a, so it factors as (x − 2)(x − 3).
The roots are worked out with a numerically stable form of the formula, so a very small root next to a very large one stays accurate. Everything runs in your browser.
Frequently asked questions
What is the quadratic formula?
For ax² + bx + c = 0, x = (−b ± √(b² − 4ac)) ÷ 2a. The ± gives the two roots; a can't be 0, or the equation isn't quadratic.
What does the discriminant tell me?
D = b² − 4ac. If it's positive there are two real roots (the parabola crosses the x-axis twice), if it's 0 there's one repeated root (it touches the axis), and if it's negative the roots are complex and the graph never meets the axis. For x² + 2x + 5 = 0, D = 4 − 20 = −16, so x = −1 ± 2i.
How do I get the exact answer instead of a decimal?
Enter whole-number coefficients: the solver simplifies the square root and the fraction. 2x² − 6x − 1 = 0 has D = 44 = 4 × 11, so x = (3 ± √11)/2, about −0.158 and 3.158.
How do I find the vertex of a parabola?
The vertex is at x = −b ÷ 2a, and y is the value of the equation there, c − b² ÷ 4a. For x² − 5x + 6 it's (2.5, −0.25). It's the lowest point when a is positive and the highest when a is negative.
Can I type the equation instead?
Yes, in forms like 2x^2 - 3x + 1 = 0, x² + 4x = -4 or 3x^2 = 12. Terms on the right are moved to the left, so 3x^2 = 12 becomes 3x² − 12 = 0.