Sub topic 9
Complex roots when the discriminant is negative
When the discriminant b² − 4ac is negative, the quadratic formula asks for the square root of a negative number. No real number does that. This chapter shows what the formula gives in that case, why the answers come in pairs, and how to check them.
This chapter assumes you can use the quadratic formula and compute the discriminant. It also assumes you can simplify radicals such as √12 and read a parabola on a coordinate graph. You don't need prior knowledge of complex numbers. The few facts you need are introduced here.
The imaginary unit
No real number squared gives a negative result, so mathematicians define a new number i with this property:
i² = −1
Then the square root of any negative real number can be written using i:
- √−16 = √16 · √−1 = 4i
- √−7 = i√7
- √−12 = √12 · i = 2i√3
The general rule for a positive number k is √−k = i√k.
A complex number has the form p + qi, where p and q are real. The number p is the real part and q is the imaginary part. Real numbers are the special case q = 0.
What the formula gives
Start from the quadratic formula:
x = (−b ± √D) / (2a), where D = b² − 4ac
Suppose D < 0. Then −D is positive, so √D = i√(−D). The formula becomes:
x = −b/(2a) ± i · √(−D)/(2a)
This is a complex number in the form p ± qi. Its two parts are:
- Real part: p = −b / (2a)
- Imaginary part: q = √(−D) / (2a), taken as positive (use |2a| if a is negative)
Both roots share the same real part. They differ only in the sign of the imaginary part. Such a pair is called a complex conjugate pair.
Worked example 1: x² + 4x + 13 = 0
Here a = 1, b = 4, c = 13.
- Compute the discriminant: D = 4² − 4(1)(13) = 16 − 52 = −36.
- Take the root: √−36 = 6i.
- Apply the formula: x = (−4 ± 6i) / 2.
- Divide both terms by 2: x = −2 ± 3i.
The two roots are −2 + 3i and −2 − 3i.
To check by substitution, take x = −2 + 3i.
- x² = 4 − 12i + 9i² = 4 − 12i − 9 = −5 − 12i
- 4x = −8 + 12i
- Sum: (−5 − 12i) + (−8 + 12i) + 13 = 0 ✓
Worked example 2: a root that needs a radical
Solve 3x² + 2x + 1 = 0.
- D = 2² − 4(3)(1) = 4 − 12 = −8.
- √−8 = i√8 = 2i√2.
- x = (−2 ± 2i√2) / 6.
- Divide every term of the numerator by 2 and then by 3: x = (−1 ± i√2) / 3.
You can also write this as −1/3 ± (√2/3)i. So p = −1/3 and q = √2/3.
Why the roots come in conjugate pairs
The pairing follows directly from the formula. The ± sign produces +i√(−D)/(2a) in one root and −i√(−D)/(2a) in the other. Nothing else in the formula changes between them.
A deeper reason applies when a, b and c are all real. If a complex number z solves the equation, then so does its conjugate z̄ (the same number with the sign of i flipped). Taking conjugates of both sides of az² + bz + c = 0 gives az̄² + bz̄ + c = 0, because the real coefficients are unchanged.
This has a practical consequence. A quadratic with real coefficients never has exactly one non-real root. The non-real roots always arrive as a pair.
The graph: no x-intercepts
A real root of ax² + bx + c = 0 is an x-intercept of the parabola y = ax² + bx + c. When D < 0 there are no real roots, so the parabola never touches the x-axis.
- If a > 0, the parabola opens upward and its vertex lies above the axis.
- If a < 0, it opens downward and its vertex lies below the axis.
The complex roots still read off the graph. Take y = x² + 2x + 5, whose roots are −1 ± 2i.
- The real part p = −1 is the x-coordinate of the vertex. In general p = −b/(2a), which is the vertex formula.
- The vertex is at (−1, 4). The y-value 4 satisfies q² = (vertex height) / a = 4 / 1, so q = 2.
The second relation follows from the vertex height −D/(4a), and q² = −D/(4a²). The imaginary part is a measure of how far the vertex sits from the x-axis.
Checking complex roots with sum and product
The relations from the earlier chapter on sum and product of roots still hold for complex roots:
- Sum of roots = −b/a
- Product of roots = c/a
For the pair p ± qi the arithmetic simplifies:
- Sum: (p + qi) + (p − qi) = 2p. This equals −b/a, which matches p = −b/(2a).
- Product: (p + qi)(p − qi) = p² − q²i² = p² + q². This equals c/a.
The product is always a positive number made of squares, and this gives a sanity test. If c/a is negative, then D = b² − 4ac is positive, so the roots are real. Complex roots only occur when a and c have the same sign.
Check example 2 (3x² + 2x + 1 = 0), where p = −1/3 and q = √2/3:
- 2p = −2/3, and −b/a = −2/3 ✓
- p² + q² = 1/9 + 2/9 = 3/9 = 1/3, and c/a = 1/3 ✓
Worked example 3: negative leading coefficient
Solve −x² + 2x − 5 = 0, where a = −1, b = 2, c = −5.
- D = 2² − 4(−1)(−5) = 4 − 20 = −16.
- √D = 4i.
- x = (−2 ± 4i) / (−2).
- Divide each term by −2: x = 1 ∓ 2i.
The ∓ means the two values are 1 − 2i and 1 + 2i. The order doesn't matter, so the answer is 1 ± 2i.
Check: sum = 2 and −b/a = −2/(−1) = 2 ✓. Product = 1 + 4 = 5 and c/a = −5/−1 = 5 ✓.
This example shows why you divide by 2a with its sign. Dividing by −2 flips both signs, but the pair ± absorbs the flip in the imaginary part. The real part −b/(2a) = 1 does not absorb it, so be careful there.
Computing complex roots in Python
Python's cmath module takes square roots of negative numbers and returns complex values. The math module raises an error instead. The following function covers every sign of D.
import cmath
def roots(a, b, c):
if a == 0:
raise ValueError("a must be nonzero")
d = b * b - 4 * a * c
r = cmath.sqrt(d)
return (-b - r) / (2 * a), (-b + r) / (2 * a)
x1, x2 = roots(2, 2, 5)
print(x1, x2) # (-0.5-1.5j) (-0.5+1.5j)
print(x1 + x2) # (-1+0j) equals -b/a = -1
print(x1 * x2) # (2.5+0j) equals c/a = 2.5Python writes the imaginary unit as j, not i. The sum and product have an imaginary part of 0j. For other inputs the computed imaginary part can be a tiny nonzero number such as 1e-17, because floating-point arithmetic rounds. Compare with a tolerance (cmath.isclose) rather than with ==.
Common mistakes
| Mistake | Correct handling |
|---|---|
| Writing "no solutions" and stopping | Over the reals there are no roots. Over the complex numbers there are always two. |
| Dropping the i, writing √−36 = 6 | √−36 = 6i. |
| Writing √−k as −√k | A negative sign inside the root becomes the factor i, not a minus sign outside. |
| Dividing only one term by 2a | The whole numerator is divided: (−4 ± 6i)/2 = −2 ± 3i, not −4 ± 3i. |
| Writing only one root | Always give both, p + qi and p − qi, usually combined as p ± qi. |
| Computing D = b² − 4ac with b = −3 as −9 − 4ac | Square b with its sign: (−3)² = 9. |
Summary of the key facts
- If D < 0, the roots are p ± qi with p = −b/(2a) and q = √(−D)/(2|a|).
- The two roots are complex conjugates when a, b and c are real.
- The parabola has no x-intercepts, and its vertex x-coordinate is p.
- The sum 2p equals −b/a, and the product p² + q² equals c/a.
Exercise
Solve 2x² − 4x + 10 = 0 and write the roots in the form p ± qi. Then check them using the sum and product of roots.
Show answer
Here a = 2, b = −4, c = 10. D = (−4)² − 4(2)(10) = 16 − 80 = −64, so √D = 8i. Then x = (4 ± 8i) / 4 = 1 ± 2i. Check: the sum is 2, and −b/a = 4/2 = 2 ✓. The product is 1² + 2² = 5, and c/a = 10/2 = 5 ✓.
Exercise
The parabola y = x² − 6x + 13 has its vertex at (3, 4). Without using the quadratic formula, state the roots of x² − 6x + 13 = 0.
Show answer
The real part is p = 3, the x-coordinate of the vertex. Since a = 1, q² = (vertex height)/a = 4, so q = 2. The roots are 3 ± 2i. Check with the formula: D = 36 − 52 = −16, so x = (6 ± 4i)/2 = 3 ± 2i ✓.
Exercise
For which values of k does x² + 4x + k = 0 have non-real roots? For k = 5, give the roots.
Show answer
The roots are non-real when D = 16 − 4k < 0, which means k > 4. For k = 5, D = 16 − 20 = −4, so √D = 2i and x = (−4 ± 2i)/2 = −2 ± i.