Sub topic 16
Extreme Values of Quadratic and Related Expressions
This chapter assumes you can factorise quadratics, solve quadratic inequalities, and use the discriminant D = b² − 4ac. It builds on the chapter on quadratic inequalities and sits next to the AM-GM chapter. AM-GM handles products and sums of positive terms. This chapter handles expressions whose shape is a parabola, or that turn into a parabola after a substitution.
The Working Model: Vertex Form
A quadratic f(x) = ax² + bx + c has one turning point, called the vertex. Completing the square shows where it is:
f(x) = a(x + b/2a)² + (4ac − b²)/4a
The squared term is never negative. It is zero exactly when x = −b/2a. So:
| Sign of a | Shape | Extreme value | Where |
|---|---|---|---|
| a > 0 | Opens upward | Minimum = −D/4a | x = −b/2a |
| a < 0 | Opens downward | Maximum = −D/4a | x = −b/2a |
If a > 0, the expression has no maximum over all real x. If a < 0, it has no minimum. CAT options sometimes include a finite "maximum" for an upward parabola. That option is a trap.
Example: f(x) = 2x² − 12x + 23. The vertex is at x = 12/4 = 3, and f(3) = 18 − 36 + 23 = 5. The minimum is 5. As a check with the formula, D = 144 − 184 = −40, and −D/4a = 40/8 = 5.
Restricted Domains: Always Check the Endpoints
When x is limited to an interval [p, q], the extreme values come from at most three candidates: f(p), f(q), and f(−b/2a). The vertex counts only if −b/2a lies inside [p, q].
Example: f(x) = x² − 6x + 10 on [4, 7]. The vertex is at x = 3, outside the interval. The parabola rises across the whole interval, so the minimum is f(4) = 2 and the maximum is f(7) = 17. If you used the vertex value f(3) = 1, you would get a wrong answer.
def f(x):
return x * x - 6 * x + 10
xs = [4 + i / 1000 for i in range(3001)] # grid over [4, 7]
vals = [f(x) for x in xs]
print(min(vals), max(vals)) # 2.0 17.0Integer Restrictions: Nearest Integer to the Vertex
A parabola is symmetric about its vertex. So if x must be an integer, the best integer is the one closest to −b/2a. If the vertex sits exactly halfway between two integers, both give the same value.
Example: maximise −2n² + 13n + 5 over integers n. The vertex is at 13/4 = 3.25. The nearest integer is 3, which gives −18 + 39 + 5 = 26. The next candidate, n = 4, gives 25. The answer is 26, not the real maximum of 26.125.
print(max(-2 * n * n + 13 * n + 5 for n in range(-50, 51))) # 26Related Expressions That Reduce to a Quadratic
Substitution and the range of the new variable
The expression x⁴ − 4x² + 7 becomes t² − 4t + 7 when you put t = x². Here t ≥ 0. The vertex t = 2 is allowed, so the minimum is 4 − 8 + 7 = 3.
Now try x⁴ + 4x² + 7, which becomes t² + 4t + 7. The vertex is at t = −2, but t = x² cannot be negative. On t ≥ 0 the parabola only rises, so the minimum is at t = 0, which gives 7. If you plugged in the vertex anyway, you would get 3, a value the expression never reaches.
Pairing four linear factors
Take (x − 1)(x − 2)(x − 3)(x − 4). Pair the outer factors and the inner factors, because their constant terms add to the same total (1 + 4 = 2 + 3):
(x² − 5x + 4)(x² − 5x + 6)
Let t = x² − 5x + 5, the average of the two brackets. The product becomes (t − 1)(t + 1) = t² − 1, and its minimum is −1 at t = 0. Check that t = 0 is reachable: x² − 5x + 5 = 0 has D = 5 > 0, so it has real roots. The minimum is −1.
xs = [i / 10000 for i in range(50001)] # grid over [0, 5]
g = min((x - 1) * (x - 2) * (x - 3) * (x - 4) for x in xs)
print(round(g, 4)) # -1.0Reciprocals of quadratics
If q(x) > 0 for all x, then 1/q(x) is largest where q(x) is smallest. Take 1/(x² + 2x + 5). The denominator equals (x + 1)² + 4, so its minimum is 4. The expression's maximum is 1/4. It has no positive minimum, because it approaches 0 as x grows. If q(x) can be zero or negative, this argument breaks down. Check the sign of D first.
Ratios of quadratics: the discriminant method
To find the range of y = (x² + x + 1)/(x² − x + 1), cross-multiply and treat the result as a quadratic in x:
(y − 1)x² − (y + 1)x + (y − 1) = 0
For a real x to exist, the discriminant must be non-negative:
(y + 1)² − 4(y − 1)² ≥ 0, which factors as (3 − y)(3y − 1) ≥ 0
So 1/3 ≤ y ≤ 3. Handle y = 1 on its own, because the equation is no longer quadratic there. At y = 1 the equation reduces to −2x = 0, so x = 0, and y = 1 is attained. The maximum of 3 occurs at x = 1 and the minimum of 1/3 at x = −1.
def r(x):
return (x * x + x + 1) / (x * x - x + 1)
vals = [r(i / 100) for i in range(-10000, 10001)]
print(round(min(vals), 4), round(max(vals), 4)) # 0.3333 3.0Two variables with a linear constraint
If x + y = 10, then x² + y² = x² + (10 − x)² = 2x² − 20x + 100. The vertex is at x = 5, so the minimum is 50. This is the quadratic view of the AM-GM idea that a sum of squares is smallest when the terms are equal.
Choosing the Method
Common Errors
| Error | Fix |
|---|---|
| Giving a maximum for an upward parabola on all reals | It has none. Only a minimum exists |
| Using the vertex value when the vertex lies outside the domain | Compare the endpoint values instead |
| Rounding the real optimum for integer variables | Substitute the nearest integers and compare |
| Ignoring the range of t after substituting | Restrict t first, for example t = x² ≥ 0 |
| Skipping the leading-coefficient-zero case in the discriminant method | Test that value of y separately |
Exercise
Find the minimum value of x² − 8x + 21 and the value of x where it occurs.
Show answer
The vertex is at x = 8/2 = 4, and f(4) = 16 − 32 + 21 = 5. The minimum is 5 at x = 4.
Exercise
Find the minimum value of (x + 1)(x + 2)(x + 3)(x + 4).
Show answer
Pair the factors as (x² + 5x + 4)(x² + 5x + 6). Let t = x² + 5x + 5, so the product is t² − 1. The value t = 0 is reachable, since D = 25 − 20 = 5 > 0. The minimum is −1.
Exercise
Find the range of 3x² − 12x + 5 for x in [0, 3].
Show answer
The vertex x = 2 lies inside the interval, and f(2) = −7. At the endpoints, f(0) = 5 and f(3) = −4. The range is [−7, 5].
Exercise
Find the maximum value of 1/(x² − 4x + 9).
Show answer
The denominator equals (x − 2)² + 5, which is always positive with minimum 5 at x = 2. The maximum of the expression is 1/5.