Sub topic 8
The discriminant and the graph of the parabola
This chapter assumes you can plot points and read a coordinate graph, expand and factor simple expressions, and simplify square roots. It also assumes you have met the quadratic formula and the discriminant D = b² − 4ac. Here you will connect D to the picture: where the parabola sits relative to the x-axis, and why the sign of D decides how many times they meet.
From roots to x-intercepts
A quadratic equation ax² + bx + c = 0 asks where a function equals zero. Define the function
y = ax² + bx + c, with a ≠ 0.
Its graph is a parabola. A point on the graph lies on the x-axis exactly when y = 0, so the real roots of the equation are the x-coordinates of the parabola's x-intercepts. The number of real roots therefore equals the number of places where the parabola touches or crosses the x-axis.
The discriminant tells you that number without solving the equation. To see why, read the quadratic formula as a statement about the picture.
The formula as a picture
The quadratic formula can be split into two parts:
x = −b/(2a) ± √D/(2a)
The first part, h = −b/(2a), does not depend on the sign choice. It is the x-coordinate of the vertex, and the vertical line x = h is the axis of symmetry. The second part, √D/(2a), is the distance the roots sit from the axis, one on each side.
So the discriminant controls only how far the roots are from the axis of symmetry:
- If D > 0, the offset √D/(2|a|) is a positive real number. The two intercepts are symmetric about x = h.
- If D = 0, the offset is zero. Both intercepts collapse onto the vertex.
- If D < 0, the offset is not a real number. There is no real point at that distance, so the parabola never reaches the x-axis.
The distance between the two x-intercepts, when D > 0, is √D/|a|. A larger D means the intercepts are further apart.
The vertex height and the sign of D
The vertex is also where the parabola is at its lowest (if a > 0) or highest (if a < 0). Its y-coordinate is found by substituting x = h:
k = c − b²/(4a) = (4ac − b²)/(4a) = −D/(4a)
This identity is the link between algebra and the graph. The vertex is the point (h, k) = (−b/(2a), −D/(4a)). Its height above or below the x-axis is set by D and by the sign of a.
Now reason about the sign of a:
- If a > 0, the parabola opens upward and the vertex is its lowest point. The parabola reaches the x-axis only if the vertex is on or below it, which means k ≤ 0. Since k = −D/(4a) and 4a is positive, k ≤ 0 means D ≥ 0.
- If a < 0, the parabola opens downward and the vertex is its highest point. The parabola reaches the x-axis only if k ≥ 0. Since 4a is negative, k ≥ 0 again means D ≥ 0.
Both cases give the same condition on D. The sign of a changes which way the parabola opens, but it does not change the verdict.
| Sign of D | x-intercepts | Real roots | Where the vertex is |
|---|---|---|---|
| D > 0 | 2 | two distinct | below the x-axis if a > 0, above it if a < 0 |
| D = 0 | 1 | one repeated | on the x-axis |
| D < 0 | 0 | none (a complex pair) | above the x-axis if a > 0, below it if a < 0 |
Worked examples
Example 1: two intercepts
Take y = x² − 4x + 1, so a = 1, b = −4, c = 1.
- D = (−4)² − 4(1)(1) = 16 − 4 = 12. Since D > 0, there are two x-intercepts.
- The axis of symmetry is x = −b/(2a) = 4/2 = 2.
- The vertex height is k = −D/(4a) = −12/4 = −3. Check by substitution: 2² − 4(2) + 1 = −3.
- The roots are x = 2 ± √12/2 = 2 ± √3, about 0.268 and 3.732.
The vertex (2, −3) is below the axis and the parabola opens up, so it must cross the axis twice. The gap between the intercepts is √12/1 ≈ 3.464, which matches 3.732 − 0.268.
Example 2: no intercepts
Take y = −x² + 2x − 3, so a = −1, b = 2, c = −3.
- D = 2² − 4(−1)(−3) = 4 − 12 = −8. Since D < 0, there are no x-intercepts.
- The axis is x = −2/(2·(−1)) = 1.
- The vertex height is k = −(−8)/(4·(−1)) = 8/(−4) = −2. Check: −1 + 2 − 3 = −2.
The parabola opens downward and its highest point is (1, −2), which is below the axis. The whole curve is below the x-axis, so it never touches it.
Example 3: one intercept
Take y = x² − 6x + 9. Here D = 36 − 36 = 0, the axis is x = 3, and k = 0. The vertex (3, 0) sits on the x-axis, and the parabola is tangent to it there. This is the perfect square (x − 3)², which is why the root 3 is called repeated.
Checking the picture with code
This function computes D, the vertex, and the x-intercepts. It uses the vertex formulas from above, so the printed results can be compared with the hand calculations.
import math
def describe(a, b, c):
if a == 0:
raise ValueError("a must be nonzero")
d = b * b - 4 * a * c
h = -b / (2 * a)
k = -d / (4 * a)
if d > 0:
offset = math.sqrt(d) / (2 * abs(a))
xs = [h - offset, h + offset]
elif d == 0:
xs = [h]
else:
xs = []
return d, (h, k), xs
for coeffs in [(1, -4, 1), (-1, 2, -3), (1, -6, 9)]:
d, vertex, xs = describe(*coeffs)
opens = "up" if coeffs[0] > 0 else "down"
print(coeffs, "opens", opens, "| D =", d, "| vertex =", vertex,
"| x-intercepts =", [round(x, 4) for x in xs])The three lines of output report D = 12 with vertex (2.0, −3.0) and intercepts 0.2679 and 3.7321, then D = −8 with vertex (1.0, −2.0) and no intercepts, then D = 0 with vertex (3.0, 0.0) and the single intercept 3.0.
The test d == 0 works here because the inputs are integers. With computed floating-point coefficients, D may come out as a tiny nonzero number such as 1e-16 when it should be exactly zero. In that case, compare with a tolerance suitable for your data instead of testing equality.
Moving the parabola: the discriminant as a switch
Vertical shifts show the discriminant at work. Consider y = x² − 4x + k. Changing k slides the whole parabola up or down without changing its shape.
D = 16 − 4k
- For k < 4, D > 0 and the parabola crosses the x-axis twice.
- For k = 4, D = 0 and the vertex touches the axis at x = 2. This is the boundary case.
- For k > 4, D < 0 and the parabola has floated above the axis.
The same idea applies to any horizontal line y = m. The parabola y = ax² + bx + c meets that line where ax² + bx + (c − m) = 0, and the discriminant of that equation is b² − 4a(c − m). So you can count the intersections of a parabola with any horizontal line by the same test. This is how you find the minimum or maximum value of a quadratic without calculus: the extreme value is the m at which the discriminant is exactly zero.
Common errors
- Dropping the sign of a in the vertex height. The formula is k = −D/(4a). If a is negative, the sign flips. Substitute x = h into the original equation to confirm.
- Squaring b incorrectly. In D = b² − 4ac, the term b² is never negative. When b = −4, b² = 16, not −16. In code,
b * bis safe, and-b**2is not what you want. - Treating D < 0 as "no solution". There are no real roots and no x-intercepts, but there are two complex roots. The graph only shows the real ones.
- Treating D = 0 as "no solution". There is one real root, counted twice. The parabola touches the axis at its vertex.
- Confusing D with the distance between roots. The distance is √D/|a|, not D.
- Assuming that D > 0 means the vertex is above the axis. The vertex is on the opposite side from the opening direction, so for a > 0 it is below the axis.
Why the vertex form helps
Completing the square rewrites y = ax² + bx + c as y = a(x − h)² + k, with the same h and k as above. The term a(x − h)² is zero at the vertex and has the sign of a everywhere else. So y has the sign of a except when k pulls it across zero. The discriminant is just a compact way of recording whether k and a point toward each other (D > 0), meet exactly (D = 0), or point apart (D < 0). The graph and the algebra describe the same fact.
Exercise
For y = 2x² − 8x + 5, find D, the vertex, and the number of x-intercepts. Then state which side of the x-axis the vertex is on and explain why that agrees with the number of intercepts.
Show answer
D = (−8)² − 4(2)(5) = 64 − 40 = 24, which is positive. The axis is x = 8/4 = 2, and the vertex height is k = −24/8 = −3, so the vertex is (2, −3). Check: 2(4) − 16 + 5 = −3. The parabola opens upward (a = 2 > 0) and its lowest point is below the x-axis, so it must cross the axis twice. This agrees with D > 0, so there are two x-intercepts.
Exercise
For which values of k does y = x² + 6x + k lie entirely above the x-axis, with no intercepts? What happens at the boundary value of k?
Show answer
The parabola opens upward, so it stays above the axis exactly when it has no intercepts, which means D < 0. D = 36 − 4k < 0 gives k > 9. At k = 9, D = 0 and the function is (x + 3)², so the vertex (−3, 0) touches the axis. For k < 9 there are two intercepts.
Exercise
The parabola y = −x² + 4x meets the horizontal line y = m. For which values of m are there two intersection points, one, and none?
Show answer
Setting −x² + 4x = m gives −x² + 4x − m = 0, with discriminant D = 16 − 4(−1)(−m)... computed carefully: D = b² − 4ac = 16 − 4(−1)(−m) = 16 − 4m. Two points when 16 − 4m > 0, so m < 4. One point (the line touches the vertex (2, 4)) when m = 4. No points when m > 4. This matches the picture: the parabola opens downward with highest point 4.