Math
Quadratic equation calculator
Enter the coefficients of ax² + bx + c = 0. The calculator applies the quadratic formula and gives the roots exactly (as fractions, surds or complex numbers) and as decimals, together with the discriminant, the vertex of the parabola and a graph.
For ax² + bx + c = 0. Must not be 0.
Show the working, step by step
Read off the coefficients of ax² + bx + c = 0.
2x² + 3x − 1 = 0 a = 2, b = 3, c = −1
Work out the discriminant.
D = b² − 4ac = 3² − 4 × 2 × (−1) = 9 − (−8) = 17
D is positive, so there are two distinct real roots.
Substitute into the quadratic formula.
x = (−b ± √D) / (2a) x = (−3 ± √17) / (2 × 2) = (−3 ± √17) / 4 x = (−3 ± √17)/4
As decimals:
x₁ = (−3 + √17)/4 = 0.280776 x₂ = (−3 − √17)/4 = −1.78078
Check with the sum and product of the roots (Vieta’s formulas).
x₁ + x₂ = −b/a = −3/2 x₁ × x₂ = c/a = −1/2
The vertex lies on the axis of symmetry, halfway between the roots.
h = −b / (2a) = −3 / 4 = −3/4 k = c − b²/(4a) = −1 − 9/8 = −17/8
The quadratic formula
x = (−b ± √(b² − 4ac)) / (2a)
Any equation that can be rearranged to ax² + bx + c = 0 with a ≠ 0 is quadratic, and the formula above solves all of them. It comes from completing the square on the general equation, so it always agrees with factorising when factorising is possible. The expression under the root, D = b² − 4ac, is the discriminant, and its sign decides what kind of roots you get.
A worked example
The calculator starts with 2x² + 3x − 1 = 0, so a = 2, b = 3 and c = −1.
- Discriminant: D = 3² − 4 × 2 × (−1) = 9 + 8 = 17. It is positive but not a perfect square, so there are two irrational real roots.
- Formula: x = (−3 ± √17) / (2 × 2) = (−3 ± √17)/4.
- Decimals: √17 ≈ 4.1231, so x₁ ≈ 0.280776 and x₂ ≈ −1.78078.
- Check with Vieta's formulas: x₁ + x₂ = −b/a = −3/2 and x₁ × x₂ = c/a = −1/2.
- Vertex: x = −b/(2a) = −3/4, and y = c − b²/(4a) = −1 − 9/8 = −17/8. The vertex is (−0.75, −2.125), and the vertex form is 2(x + 3/4)² − 17/8.
What the discriminant tells you
| Discriminant | Roots | Graph | Example |
|---|---|---|---|
| D > 0, a perfect square | Two rational roots | Crosses the x-axis twice | x² − 5x + 6 = 0: x = 2 or 3 |
| D > 0, not a square | Two irrational roots | Crosses the x-axis twice | 2x² + 3x − 1 = 0: (−3 ± √17)/4 |
| D = 0 | One repeated root | Touches the axis at the vertex | x² − 4x + 4 = 0: x = 2 |
| D < 0 | Two complex conjugates | Never meets the x-axis | x² + 2x + 5 = 0: −1 ± 2i |
When you meet quadratics
Projectile height is the classic case. A ball thrown upwards at 20 m/s from 1.5 m has height h = −4.9t² + 20t + 1.5. Setting h = 0 and solving gives t ≈ 4.155 s for the landing time (the other root is negative and meaningless here), and the vertex at t = 20/9.8 ≈ 2.04 s gives the greatest height, about 21.9 m. Areas, break-even points in simple profit models and the optics of parabolic mirrors lead to quadratics in the same way.
Common mistakes
- Not setting the equation to zero first. x² + 3x = 10 must become x² + 3x − 10 = 0 before you read off c = −10.
- Dropping the sign of b or c. In x² − 5x + 6, b is −5, so −b is +5. Brackets around negative values while substituting prevent most slips.
- Dividing only part of the numerator by 2a. The whole of −b ± √D sits over 2a.
- Squaring a negative b wrongly. (−5)² is +25, so b² is never negative.
- Discarding complex roots as "no answer". There are no real roots, but the equation still has two complex ones.
Common questions
What is the quadratic formula?
x = (−b ± √(b² − 4ac)) / (2a) solves every equation of the form
ax² + bx + c = 0 with a ≠ 0. The ± gives the two roots: take the plus sign for one and the
minus sign for the other. For 2x² + 3x − 1 = 0 it gives x = (−3 ± √17)/4, which is
0.280776 or −1.78078.
What does the discriminant tell you?
The discriminant D = b² − 4ac is the part under the square root. If D is positive there are two different real roots (and the parabola crosses the x-axis twice). If D = 0 there is one repeated root, and the vertex sits on the axis. If D is negative the roots are a pair of complex conjugates, and the graph never meets the x-axis. When D is a perfect square and a, b, c are whole numbers, the roots are rational and the quadratic factorises over the integers.
How do I write the answer in exact surd form?
Simplify √D by taking out square factors (√72 = √(36 × 2) = 6√2), then cancel any factor shared by −b, the surd coefficient and 2a. For 3x² + 6x + 9 = 0, D = −72, so x = (−6 ± 6i√2)/6 = −1 ± i√2. The calculator does this reduction automatically whenever a, b and c are whole numbers or terminating decimals.
What if a = 0?
Then there is no x² term and the equation is linear: bx + c = 0 has the single solution x = −c/b. The quadratic formula would divide by zero, so the calculator reports the linear answer instead. The linear equation calculator shows the working for that case.
How do I find the vertex of a parabola?
The vertex is at x = −b/(2a), halfway between the roots, and its y-value is c − b²/(4a). For y = 2x² + 3x − 1 that is (−3/4, −17/8), or (−0.75, −2.125). The line x = −0.75 is the axis of symmetry. Because a = 2 is positive, the parabola opens upwards and the vertex is its lowest point.
Should I factorise, complete the square or use the formula?
Factorising is quickest when you can spot two numbers that work, which only happens when the roots are rational. Completing the square gives the vertex form a(x − h)² + k and is how the formula is derived. The formula always works, which is why it is the method shown here, with the factorised and vertex forms listed alongside.
Related calculators
-
Polynomial calculator
Roots of cubics and higher-degree polynomials, plus long division.
-
Linear equation calculator
One equation step by step, or 2 × 2 and 3 × 3 systems.
-
Function calculator
Evaluate, tabulate, invert and graph any f(x).
-
Simplify expressions
Expand, factor and simplify algebraic expressions.
-
Conic sections
Parabolas, ellipses and hyperbolas from their equations.