Quadratic Formula Calculator
- Updated
- Formula shown
- Free, no sign-up
Results
x² − 3x + 2 = 0: x = 2 or x = 1; vertex (1.5, −0.25)
| Step | Working |
|---|---|
| 1. Identify the coefficients | a = 1, b = −3, c = 2 |
| 2. Discriminant | D = b² − 4ac = (−3)² − 4 × 1 × 2 = 9 − 8 = 1 |
| 3. Square root of D | √1 = 1 |
| 4. Quadratic formula | x = (−b ± √D) ÷ 2a = (3 ± √1) ÷ 2 |
| 5. Roots | x₁ = (3 + 1) ÷ 2, x₂ = (3 − 1) ÷ 2 → 2 and 1 |
| 5a. Exact form | x = 2 or 1 |
| 6. Vertex | h = −b ÷ 2a = 1.5, k = c − b² ÷ 4a = −0.25 |
How to use the quadratic formula calculator
- Rearrange your equation so one side is zero: ax² + bx + c = 0. For example, x² = 3x − 2 becomes x² − 3x + 2 = 0.
- Enter a, b and c, including their signs. Use 0 for a missing term (in x² − 9 = 0, b is 0).
- Read the roots, the exact form, the vertex and the full working. If a is 0, the calculator solves the linear equation bx + c = 0 instead.
The quadratic formula
Discriminant: D = b² − 4ac
Vertex: h = −b ÷ 2a, k = c − b² ÷ 4a · Axis of symmetry: x = h
Vieta's formulas: x₁ + x₂ = −b ÷ a, x₁ × x₂ = c ÷ a
The formula comes from completing the square on ax² + bx + c = 0, and it works for every quadratic, including ones that do not factor neatly. The discriminant under the square root decides what kind of roots you get: positive means two different real roots, zero means one repeated root, and negative means two complex roots that are conjugates of each other (a ± bi). When the discriminant is a perfect square and the coefficients are whole numbers, the roots are rational and the quadratic factors over the integers. The graph of y = ax² + bx + c is a parabola whose turning point is the vertex (h, k); it opens upwards when a is positive and downwards when a is negative.
On a computer, the textbook formula can lose accuracy when b² is much larger than 4ac, because −b and √D nearly cancel. This calculator uses the numerically stable rearrangement (q = −(b + sign(b)·√D) ÷ 2, then x₁ = q ÷ a and x₂ = c ÷ q), which gives the same roots without that loss.
Worked examples
Two rational roots. For 2x² − 7x + 3 = 0: a = 2, b = −7, c = 3, so D = (−7)² − 4 × 2 × 3 = 49 − 24 = 25 and √D = 5. Then x = (7 ± 5) ÷ 4, giving x = 3 or x = 1/2. The equation factors as (x − 3)(2x − 1) = 0.
Complex roots. For x² + 2x + 5 = 0, D = 4 − 20 = −16, so √D = 4i and x = (−2 ± 4i) ÷ 2 = −1 ± 2i. The parabola's lowest point is (−1, 4), above the x-axis, which is why there are no real roots.
A thrown ball. Ignoring air resistance, a ball thrown upwards at 20 m/s from 1.5 m has height h = −4.9t² + 20t + 1.5 meters after t seconds. Setting h = 0 gives roots t = 4.16 and t = −0.07; only the positive one makes sense, so it lands after about 4.16 s. The vertex says it peaks at 21.91 m after 2.04 s.
What the discriminant tells you
| Discriminant | Roots | Graph |
|---|---|---|
| D > 0, perfect square | Two different rational roots | Crosses the x-axis twice |
| D > 0, not a perfect square | Two different irrational roots | Crosses the x-axis twice |
| D = 0 | One repeated real root | Touches the x-axis at the vertex |
| D < 0 | Two complex conjugate roots | Does not meet the x-axis |
Solved examples
Each row was solved with this calculator's engine.
| Equation | D | Roots | Exact | Vertex |
|---|---|---|---|---|
| x² − 5x + 6 = 0 | 1 | 3, 2 | 3, 2 | (2.5, −0.25) |
| x² − 4 = 0 | 16 | 2, −2 | 2, −2 | (0, −4) |
| x² + 4x + 4 = 0 | 0 | −2 | −2 | (−2, 0) |
| x² + x − 1 = 0 | 5 | 0.618, −1.618 | (−1 ± √5)/2 | (−0.5, −1.25) |
| 2x² − 7x + 3 = 0 | 25 | 3, 0.5 | 3, 1/2 | (1.75, −3.125) |
| x² + 2x + 5 = 0 | −16 | −1 ± 2i | −1 ± 2i | (−1, 4) |
| x² + 1 = 0 | −4 | 0 ± 1i | ±i | (0, 1) |
| 3x² + 2x − 2 = 0 | 28 | 0.5486, −1.2153 | (−1 ± √7)/3 | (−0.3333, −2.3333) |
Tips and common mistakes
- Get zero on one side first. The formula only applies to ax² + bx + c = 0; moving terms across changes their signs.
- Watch the sign of b. −b means the opposite of b: if b = −7, then −b = 7. Squaring a negative b always gives a positive b².
- Divide the whole numerator by 2a. Both −b and √D are over 2a, not just the square root.
- Check with Vieta. The roots should add up to −b ÷ a and multiply to c ÷ a; it is a quick way to catch arithmetic slips.
To explore straight lines, use the slope calculator, and for systems of linear equations written as matrices, the matrix calculator finds determinants and inverses.
Frequently asked questions
What is the quadratic formula?
For ax² + bx + c = 0, the roots are x = (−b ± √(b² − 4ac)) ÷ 2a. For 2x² − 7x + 3 = 0, the discriminant is 25, so x = (7 ± 5) ÷ 4, which gives x = 3 or x = 1/2.
What does the discriminant tell you?
The discriminant D = b² − 4ac shows the type of roots before you solve. If D is positive there are two real roots, if it is zero there is one repeated root, and if it is negative the roots are complex. For x² + 2x + 5 = 0, D = −16, so the roots are complex.
How do I find the vertex of a parabola?
The vertex is at x = −b ÷ 2a; substitute that back in to get y, or use k = c − b² ÷ 4a. For y = x² − 3x + 2 the vertex is (1.5, −0.25), the lowest point because a is positive.
What happens if a is 0?
Then there is no x² term and the equation is linear: bx + c = 0, with the single solution x = −c ÷ b. For example, 2x + 4 = 0 gives x = −2. If b is also 0, there is either no solution or every x works.
Can a quadratic have complex roots?
Yes, whenever the discriminant is negative. The roots then come as a conjugate pair a ± bi. For x² + 2x + 5 = 0 they are −1 + 2i and −1 − 2i, and the parabola never touches the x-axis.