Skip to content
Tutorials Center
My learning

Topics

Lesson 29 of 38 · Complex Numbers and Conic Sections

Complex Solutions of Quadratic Equations

Use the quadratic formula and the discriminant to find real and complex roots, see why complex roots come in conjugate pairs, and check them with code.

With real numbers only, x² + 4 = 0 has no solution. With complex numbers, every quadratic equation has exactly two roots (counting repeats). This lesson revisits the quadratic formula and shows what happens when the discriminant is negative.

The quadratic formula

For ax² + bx + c = 0 with a ≠ 0:

Text
x = (-b ± √(b² - 4ac)) / (2a)

The expression under the root, D = b² - 4ac, is the discriminant. It tells you what kind of roots to expect:

Discriminant Roots Graph of y = ax² + bx + c
D > 0 two different real roots crosses the x-axis twice
D = 0 one repeated real root touches the x-axis once
D < 0 two complex (non-real) roots does not meet the x-axis

Negative discriminants

Example 1. x² + 4 = 0. Then x² = -4, so x = ±√-4 = ±2i.

Example 2. x² - 6x + 13 = 0. Here a = 1, b = -6, c = 13:

Text
D = 36 - 52 = -16
x = (6 ± √-16) / 2 = (6 ± 4i) / 2 = 3 ± 2i

Example 3. 2x² + 2x + 5 = 0:

Text
D = 4 - 40 = -36
x = (-2 ± 6i) / 4 = -1/2 ± (3/2)i

Check example 2 for x = 3 + 2i: (3+2i)² = 9 + 12i - 4 = 5 + 12i; then 5 + 12i - 6(3 + 2i) + 13 = 5 + 12i - 18 - 12i + 13 = 0.

Conjugate pairs

When a quadratic has real coefficients and complex roots, the roots are always conjugates: p + qi and p - qi. The formula shows why: the ± in front of the imaginary root gives both signs.

Going backwards, you can build a quadratic from its roots. The sum of roots is -b/a and the product is c/a. For roots 3 ± 2i: the sum is 6 and the product is 9 + 4 = 13, giving x² - 6x + 13 = 0, the equation above.

Completing the square

The same answers arise from completing the square: x² - 6x + 13 = 0 becomes (x - 3)² + 4 = 0, so (x - 3)² = -4 and x - 3 = ±2i. The vertex form tells you the parabola's lowest point is (3, 4), above the x-axis, which is why there are no real roots.

Factoring over the complex numbers

If the roots are r₁ and r₂, then ax² + bx + c = a(x - r₁)(x - r₂). So x² + 4 = (x - 2i)(x + 2i): a sum of squares factors over the complex numbers, though not over the reals.

Always compute the discriminant first. It is the quickest way to know whether to expect real or complex roots before you do the rest of the work.

A quadratic solver

Python Quadratic solver with complex roots

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Parabola above the axis

Python No real roots means no x-intercepts

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What are the solutions of x² + 25 = 0?

    x² = -25, so x = ±√-25 = ±5i.
  2. 2. The discriminant of x² - 4x + 5 is:

    D = 16 - 20 = -4, so the roots are complex.
  3. 3. What are the roots of x² - 2x + 5 = 0?

    D = 4 - 20 = -16, so x = (2 ± 4i)/2 = 1 ± 2i.
  4. 4. If a real-coefficient quadratic has the root 2 + 3i, what is the other root?

    Complex roots of real-coefficient polynomials come in conjugate pairs.

Summary

  • The quadratic formula always gives two roots over the complex numbers.
  • D > 0: two real roots; D = 0: one repeated root; D < 0: a conjugate pair.
  • Sum of roots -b/a, product c/a.
  • ax² + bx + c = a(x - r₁)(x - r₂), even when the roots are complex.

Next: Parabolas and Circles