The Quadratic Formula
Every quadratic equation ax² + bx + c = 0 can be solved with one formula. Here it is, where it comes from, and what it tells you before you finish the calculation.
The formula
x = (−b ± √(b² − 4ac)) ÷ 2a
- a, b, c
- coefficients of ax² + bx + c = 0, with a ≠ 0
- b² − 4ac
- the discriminant D
Derivation by completing the square
- Start with ax² + bx + c = 0 and 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² − 4ac) ÷ 4a².
- Take square roots: x + b/2a = ±√(b² − 4ac) ÷ 2a.
- Subtract b/2a: x = (−b ± √(b² − 4ac)) ÷ 2a.
The discriminant
| D = b² − 4ac | Roots |
|---|---|
| Positive | Two different real roots |
| Zero | One repeated real root, x = −b ÷ 2a |
| Negative | No real roots; two complex conjugate roots |
Examples
x² − 5x + 6 = 0
- a = 1, b = −5, c = 6
- D = 25 − 24 = 1
- x = (5 ± 1) ÷ 2
x = 2 or x = 3
x² + 4x + 4 = 0
- D = 16 − 16 = 0
- x = −4 ÷ 2
x = −2 (repeated)
x² + 2x + 5 = 0
- D = 4 − 20 = −16
- √−16 = 4i
- x = (−2 ± 4i) ÷ 2
x = −1 ± 2i
Useful facts
- Sum of the roots = −b ÷ a; product of the roots = c ÷ a (Vieta’s formulas).
- The vertex of y = ax² + bx + c is at x = −b ÷ 2a, exactly halfway between the roots.
- If a, b and c are integers and D is a perfect square, the equation factors over the integers.