Home / Math / Quadratic Formula Calculator
Quadratic Formula Calculator
Enter the coefficients a, b and c of ax² + bx + c = 0. You get both roots, whether real or complex, the discriminant, the vertex of the parabola and the factored form when the roots are real.
The quadratic formula
Any equation of the form ax² + bx + c = 0 with a ≠ 0 is solved by completing the square, which gives the quadratic formula:
x = (−b ± √(b² − 4ac)) ÷ 2a
The part under the root, D = b² − 4ac, is the discriminant. It decides the type of answer before any root is computed. A positive D gives two distinct real roots, zero gives one repeated root, and a negative D gives two complex roots that are conjugates of each other. In the negative case the roots are −b/2a ± i√(−D)/2a, where i is the imaginary unit with i² = −1.
Vertex, axis and the shape of the parabola
The graph of y = ax² + bx + c is a parabola. Its axis of symmetry is the vertical line x = −b ÷ 2a, exactly halfway between the two roots when they are real. The vertex lies on that line, and its height is found by substituting the x value back into the equation. If a is positive the parabola opens upward and the vertex is the minimum; if a is negative it opens downward and the vertex is the maximum.
Complex roots mean the vertex lies entirely above or entirely below the x-axis, so the curve never crosses it. The y-intercept is always c, since x = 0 removes the other terms.
Checking the roots by hand
Vieta's formulas give two fast checks. The roots add up to −b ÷ a and multiply to c ÷ a. For 2x² + 4x − 6 the sum should be −2 and the product −3, and the roots 1 and −3 satisfy both. You can also substitute a root into the original equation and confirm that it returns zero.
The calculator uses a numerically stable form of the formula. When b is large compared with the other terms, subtracting two nearly equal numbers loses digits, so it computes the larger-magnitude root first and obtains the other from the product c ÷ a.
Common mistakes
- Forgetting to rearrange. The equation must equal zero first. For x² = 3x − 2, move everything to one side to get x² − 3x + 2 = 0 before reading off a, b and c.
- Dropping a sign. A term such as −5x means b = −5, and then −b is +5.
- Dividing only part of the numerator. The 2a divides the whole of −b ± √D, not just the root.
- Treating a = 0 as quadratic. Without the x² term there is only one root, so this page reports an error.
Results are rounded to six decimal places for display. For related ideas see the square root calculator.
Worked example
Solve 2x² + 4x − 6 = 0. The discriminant is 16 + 48 = 64, a perfect square, so the roots come out as whole numbers.
Inputs
| Coefficient a (of x²) | 2 |
|---|---|
| Coefficient b (of x) | 4 |
| Constant c | -6 |
Result
Two distinct real roots, because the discriminant is positive.
| Discriminant b² − 4ac | 64 |
|---|---|
| Root x₁ | -3 |
| Root x₂ | 1 |
| Factored form | 2(x + 3)(x − 1) |
| Sum of roots (−b ÷ a) | -2 |
| Product of roots (c ÷ a) | -3 |
| Vertex | (-1, -8) |
| Axis of symmetry | x = -1 |
| y-intercept | -6 |
| Opens | Upward (minimum at the vertex) |
Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.
Frequently asked questions
What is the quadratic formula?
The formula x = (−b ± √(b² − 4ac)) ÷ 2a gives both solutions of ax² + bx + c = 0 for any coefficients with a not equal to zero.
What does the discriminant tell me?
If b² − 4ac is positive there are two real roots, if it is zero there is one repeated root, and if it is negative the roots are a pair of complex numbers.
Can the calculator find complex roots?
Yes. When the discriminant is negative it shows the roots in the form p + qi and p − qi, where p is −b ÷ 2a and q is the square root of −D divided by 2|a|.
How do I find the vertex of a parabola?
The x coordinate is −b ÷ 2a. Substitute that value into ax² + bx + c to get the y coordinate. The page shows both coordinates for you.
What happens if a equals zero?
The equation is then linear, bx + c = 0, with one solution x = −c ÷ b. The quadratic formula would divide by zero, so the page asks for a nonzero a.
Related calculators
References and sources
- Stewart, J., Precalculus: Mathematics for Calculus: chapters on quadratic equations and complex numbers.
- Press, W. H. et al., Numerical Recipes: the stable quadratic formula that avoids cancellation.