Sub topic 16
The Discriminant and the Number of Real Roots
Assume you can solve linear equations, work with exponents, and simplify square roots. This chapter uses quadratics in standard form:
ax² + bx + c = 0, where a ≠ 0.
The Discriminant and the Number of Real Roots
The discriminant is the expression inside the square root in the quadratic formula:
D = b² - 4ac
The quadratic formula is:
x = (-b ± √D) / (2a)
The sign of D tells you how many real solutions the equation has.
| Discriminant | Number of real roots | Meaning |
|---|---|---|
| `D > 0` | 2 | Two distinct real roots |
| `D = 0` | 1 | One repeated real root |
| `D < 0` | 0 | No real roots |
For example, consider x² - 5x + 6 = 0.
Here, a = 1, b = -5, and c = 6.
D = (-5)² - 4(1)(6) = 25 - 24 = 1
Because D > 0, the equation has two distinct real roots. In fact, it factors as (x - 2)(x - 3) = 0, so the roots are 2 and 3.
If D = 0, the square-root part of the formula is zero. The plus and minus choices give the same answer. For x² - 6x + 9 = 0, D = 36 - 36 = 0, and the repeated root is 3.
If D < 0, √D is not a real number, so the equation has no real roots. For x² + 1 = 0, D = -4.
import math
def number_of_real_roots(a, b, c):
discriminant = b * b - 4 * a * c
if discriminant > 0:
return 2
if discriminant == 0:
return 1
return 0
print(number_of_real_roots(1, -5, 6)) # 2
print(number_of_real_roots(1, -6, 9)) # 1
print(number_of_real_roots(1, 0, 1)) # 0Sum and Product of Roots
For ax² + bx + c = 0, let the roots be r₁ and r₂. Their sum and product are:
r₁ + r₂ = -b/ar₁r₂ = c/a
These relationships are useful when a question asks about the roots without requiring their individual values.
For 2x² - 7x + 3 = 0:
- Sum of roots:
-(-7)/2 = 7/2 - Product of roots:
3/2
You can use these facts even when factoring is difficult. Always write the equation in standard form first, and check that a is the coefficient of x².
Exercise
The equation 3x² + 4x + 5 = 0 has how many real roots, and what is the sum of its roots?
Show answer
Its discriminant is 4² - 4(3)(5) = -44, so it has 0 real roots. The sum of its roots is -4/3.