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

  1. Start with ax² + bx + c = 0 and divide by a: x² + (b/a)x + c/a = 0.
  2. Move the constant: x² + (b/a)x = −c/a.
  3. Add (b/2a)² to both sides: (x + b/2a)² = (b² − 4ac) ÷ 4a².
  4. Take square roots: x + b/2a = ±√(b² − 4ac) ÷ 2a.
  5. Subtract b/2a: x = (−b ± √(b² − 4ac)) ÷ 2a.

The discriminant

D = b² − 4acRoots
PositiveTwo different real roots
ZeroOne repeated real root, x = −b ÷ 2a
NegativeNo real roots; two complex conjugate roots

Examples

x² − 5x + 6 = 0

  1. a = 1, b = −5, c = 6
  2. D = 25 − 24 = 1
  3. x = (5 ± 1) ÷ 2

x = 2 or x = 3

x² + 4x + 4 = 0

  1. D = 16 − 16 = 0
  2. x = −4 ÷ 2

x = −2 (repeated)

x² + 2x + 5 = 0

  1. D = 4 − 20 = −16
  2. √−16 = 4i
  3. 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.