The formula

x = (−b ± √(b² − 4ac)) ÷ 2a

The ± gives two answers: one with + and one with −. The part under the root, b² − 4ac, is the discriminant.

Example: x² − 3x + 1 = 0

  1. a = 1, b = −3, c = 1.
  2. Discriminant: (−3)² − 4 × 1 × 1 = 9 − 4 = 5.
  3. x = (3 ± √5) ÷ 2.

x = (3 + √5) ÷ 2 ≈ 2.618 or x = (3 − √5) ÷ 2 ≈ 0.382

Simplifying the root

Example: x² + 4x − 1 = 0

  1. a = 1, b = 4, c = −1.
  2. Discriminant: 16 + 4 = 20.
  3. √20 = √(4 × 5) = 2√5.
  4. x = (−4 ± 2√5) ÷ 2, and dividing every term by 2 gives −2 ± √5.

x = −2 + √5 ≈ 0.236 or x = −2 − √5 ≈ −4.236

When the discriminant is negative

Example: x² + 2x + 5 = 0

  1. Discriminant: 4 − 20 = −16.
  2. There are no real solutions. Using √−16 = 4i:
  3. x = (−2 ± 4i) ÷ 2.

x = −1 + 2i or x = −1 − 2i

Where it comes from

The formula comes from completing the square on ax² + bx + c = 0: divide by a, move c over, add (b ÷ 2a)² to both sides, and take the square root.