The formula
The ± means there are usually two answers: one with + and one with −. First move every term to one side so the equation equals 0, then read off a, b and c, including their signs.
The discriminant
The expression under the square root, D = b² − 4ac, tells you what kind of solutions to expect before you finish:
| Discriminant | Solutions | Graph of y = ax² + bx + c |
|---|---|---|
| D > 0 | Two different real roots | Crosses the x-axis twice |
| D = 0 | One repeated real root, x = −b/(2a) | Touches the x-axis at its vertex |
| D < 0 | Two complex roots, no real ones | Never touches the x-axis |
Worked examples
1. x² − 5x + 6 = 0. a = 1, b = −5, c = 6. D = 25 − 24 = 1. x = (5 ± 1)/2, so x = 3 or x = 2. Check: 3² − 15 + 6 = 0.
2. 2x² + 3x − 2 = 0. a = 2, b = 3, c = −2. D = 9 + 16 = 25. x = (−3 ± 5)/4, so x = 1/2 or x = −2.
3. x² − 2x − 1 = 0 (irrational roots). D = 4 + 4 = 8, and √8 = 2√2. x = (2 ± 2√2)/2 = 1 ± √2, about 2.414214 and −0.414214.
4. x² − 4x + 4 = 0 (one root). D = 16 − 16 = 0, so x = 2 only. The equation is (x − 2)² = 0.
5. x² + 2x + 5 = 0 (complex roots). D = 4 − 20 = −16, and √(−16) = 4i. x = (−2 ± 4i)/2 = −1 ± 2i.
6. 3x² − x − 5 = 0. D = 1 + 60 = 61. x = (1 ± √61)/6, about 1.468375 and −1.135042.
A word problem
A ball is thrown upward from 6 ft above the ground at 48 ft/s. Ignoring air resistance, its height after t seconds is h = −16t² + 48t + 6 (the −16 comes from gravity, 32 ft/s², in feet). When does it land?
- Set h = 0: −16t² + 48t + 6 = 0, so a = −16, b = 48, c = 6.
- D = 48² − 4(−16)(6) = 2,304 + 384 = 2,688.
- t = (−48 ± √2,688)/(−32), which gives t = 3/2 ± √42/4, about 3.120 or −0.120.
- Time can't be negative here, so the ball lands after about 3.12 seconds.
Rejecting a root that doesn't fit the situation is a normal step in word problems.
Where the formula comes from
It's what you get by completing the square on ax² + bx + c = 0 in general:
- Divide by a: x² + (b/a)x + c/a = 0.
- Move the constant: x² + (b/a)x = −c/a.
- Add (b/2a)² to both sides: (x + b/2a)² = b²/4a² − c/a = (b² − 4ac)/4a².
- Take square roots: x + b/2a = ±√(b² − 4ac)/2a.
- Subtract b/2a: x = (−b ± √(b² − 4ac))/2a.
Completing the square also gives the vertex form a(x − h)² + k, with h = −b/(2a). Try it with the vertex form calculator.
Useful checks
- The two roots add to −b/a and multiply to c/a. In example 1, 3 + 2 = 5 and 3 × 2 = 6.
- If the equation factors easily, factoring is faster; the formula always works.
- When b² is much larger than 4ac, computing −b + √D on a calculator can lose digits. Calculating one root as 2c/(−b ∓ √D) avoids that.
Common mistakes
- Not setting the equation equal to 0 first.
- Dropping the sign of b. If b = −5, then −b = 5 and b² = 25.
- Dividing only √D by 2a. The whole numerator, −b ± √D, is divided by 2a.
Solve any quadratic with every step shown in the equation solver, find roots of higher-degree polynomials with the polynomial roots calculator, or see the parabola on the graphing calculator.
Sources
- OpenStax College Algebra 2e, 2.5: Quadratic equations
- OpenStax Intermediate Algebra 2e, 9.3: Solve quadratic equations using the quadratic formula
Every worked example on this page was checked independently with SymPy.