Chapter VI · Derivatives and integrals

Maxima and minima

§§123–125 40 min

Local maxima and minima, the necessary condition φ′(ξ) = 0, the sign-change and second-derivative tests, and the examples of §125 that show which assumptions really matter.

Why this matters

Finding where a quantity is greatest or least is one of the oldest uses of the calculus. §123 and §124 give the tools: at a maximum or minimum of a differentiable function the derivative vanishes, and the sign of ϕ′\phi' on either side, or the sign of ϕ′′\phi'' at the point, decides which it is. §125 then tests the limits of these tools. A maximum can occur where there is no derivative, and a derivative can exist everywhere without being continuous.

The idea

Hardy’s maxima and minima are local: ϕ(ξ)\phi(\xi) is a maximum if it is larger than every nearby value, whatever happens further away. A function can have many maxima and minima, and a maximum value can even be smaller than a minimum value elsewhere (Hardy’s Fig. 37). At a smooth peak the tangent is horizontal; but a horizontal tangent alone proves nothing. The reliable sign is a change in the direction of the graph: rising and then falling.

Explore The sign of ϕ′\phi' around a turning point

Try this. For x3−3x+1x^3 - 3x + 1, drag the point across x=−1x = -1 and x=1x = 1 and watch the sign of ϕ′\phi' in the lower plot. Then switch to x3x^3, x4x^4 and 1−∣x∣1 - |x|.

ϕ(x)=x3−3x+1\phi(x) = x^3-3x+1, ϕ′(x)=3x2−3\phi'(x) = 3x^2-3
xφ(x)
xφ′(x)
  • y = φ(x)
  • tangent
  • y = φ′(x)
  • φ′ > 0 (shaded blue)
  • φ′ < 0 (shaded ochre)
At x=−2x = -2: ϕ(x)=−1\phi(x) = -1, slope of the tangent ϕ′(x)=9\phi'(x) = 9. φ′ > 0: the graph is rising.
x = −1: maximum (φ′ changes from + to −); x = 1: minimum (φ′ changes from − to +).
What to notice

At the maximum x=−1x = -1, ϕ′\phi' changes from ++ (blue shading) to −- (ochre); at the minimum x=1x = 1, from −- to ++. For x3x^3, ϕ′(0)=0\phi'(0) = 0 but ϕ′\phi' is positive on both sides: no turning point. For x4x^4 there is a minimum although ϕ′′(0)=0\phi''(0) = 0 too. For 1−∣x∣1 - |x| there is a maximum at a corner, where ϕ′\phi' does not exist, but the sign still changes from ++ to −-.

Precise statements

Definition Maximum and minimum Hardy: §123

ϕ(ξ)\phi(\xi) is a maximum of ϕ\phi if there is an ε>0\varepsilon > 0 such that ϕ(ξ)>ϕ(x)\phi(\xi) > \phi(x) whenever 0<∣x−ξ∣<ε0 < |x - \xi| < \varepsilon. It is a minimum if ϕ(ξ)<ϕ(x)\phi(\xi) < \phi(x) for those xx. A maximum or minimum is also called a turning value or an extremal value.

These are strict maxima. Hardy notes that one may relax the definition to ϕ(ξ)≥ϕ(x)\phi(\xi) \ge \phi(x), so that a constant has a maximum at every point; the theorems below remain true.

Theorem A necessary condition Hardy: Theorem C, §123

If ϕ\phi is differentiable at ξ\xi and ϕ(ξ)\phi(\xi) is a maximum or a minimum, then ϕ′(ξ)=0\phi'(\xi) = 0.

The condition is not sufficient: x3x^3 has ϕ′(0)=0\phi'(0) = 0 and neither a maximum nor a minimum at 00.

Theorem The sign-change test Hardy: §123

Let ϕ′(ξ)=0\phi'(\xi) = 0. If ϕ′(x)>0\phi'(x) > 0 for all xx less than but near ξ\xi, and ϕ′(x)<0\phi'(x) < 0 for all xx greater than but near ξ\xi, then ϕ(ξ)\phi(\xi) is a maximum. If the signs are the other way round, it is a minimum.

Theorem The second-derivative test Hardy: Theorem D, §124

If ϕ′(ξ)=0\phi'(\xi) = 0 and ϕ′′(ξ)≠0\phi''(\xi) \ne 0, then ϕ(ξ)\phi(\xi) is a maximum if ϕ′′(ξ)<0\phi''(\xi) < 0 and a minimum if ϕ′′(ξ)>0\phi''(\xi) > 0.

If ϕ′′(ξ)=0\phi''(\xi) = 0 as well, Theorem D says nothing. x4x^4 (a minimum), −x4-x^4 (a maximum) and x3x^3 (neither) all have ϕ′(0)=ϕ′′(0)=0\phi'(0) = \phi''(0) = 0.

Largest and smallest values on a closed interval. These are different questions from local maxima and minima. A continuous ϕ\phi on [a,b][a, b] attains a greatest and a least value (§103). Each is attained either at an end point, where ϕ′\phi' need not vanish, or at an interior point, where by Theorem C ϕ′=0\phi' = 0 if ϕ′\phi' exists. So it is enough to compare the values at the end points, at the stationary points inside, and at any points where ϕ′\phi' fails to exist.

Explore Largest and smallest on a closed interval

Try this. This is Examples XLVI, 8: ϕ(x)=x3−18x2+96x\phi(x) = x^3 - 18x^2 + 96x on [0,9][0, 9]. Find the stationary points from the lower plot, then compare the values there with the values at the two ends (dashed lines).

ϕ(x)=x3−18x2+96x\phi(x) = x^3-18x^2+96x, ϕ′(x)=3(x−4)(x−8)\phi'(x) = 3(x-4)(x-8)
xφ(x)
xφ′(x)
  • y = φ(x)
  • tangent
  • y = φ′(x)
  • φ′ > 0 (shaded blue)
  • φ′ < 0 (shaded ochre)
At x=1x = 1: ϕ(x)=79\phi(x) = 79, slope of the tangent ϕ′(x)=63\phi'(x) = 63. φ′ > 0: the graph is rising.
x = 4: maximum (φ′ changes from + to −); x = 8: minimum (φ′ changes from − to +).
On the closed interval [0, 9] the largest value is 160 (at x = 4) and the smallest is 0 (at x = 0): an end point, where φ′ need not vanish.
What to notice

ϕ′(x)=3(x−4)(x−8)\phi'(x) = 3(x - 4)(x - 8), so there is a maximum ϕ(4)=160\phi(4) = 160 and a minimum ϕ(8)=128\phi(8) = 128. The end values are ϕ(0)=0\phi(0) = 0 and ϕ(9)=135\phi(9) = 135. So the largest value on [0,9][0, 9] is the local maximum 160160, but the smallest is the end value 00, smaller than the local minimum. There ϕ′=96≠0\phi' = 96 \ne 0.

When the hypotheses fail (§125). The theorems so far assume that ϕ′\phi' exists throughout. Take ϕ(x)=1−x2=1−∣x∣\phi(x) = 1 - \sqrt{x^2} = 1 - |x| on [−1,1][-1, 1] (Hardy’s Fig. 38). Then ϕ(−1)=ϕ(1)=0\phi(-1) = \phi(1) = 0, but ϕ′=1\phi' = 1 for x<0x < 0 and ϕ′=−1\phi' = -1 for x>0x > 0, so Rolle’s theorem fails. And ϕ(0)=1\phi(0) = 1 is a maximum at which Theorem C cannot be applied, since there is no derivative there. (The sign-change test, in the form “ϕ\phi is continuous at ξ\xi, rising on the left and falling on the right”, still detects it.)

The second point of §125 is subtler. All we have assumed is that ϕ′\phi' exists. We have never assumed that ϕ′\phi' is continuous, and it need not be.

Explore A derivative that exists everywhere but is not continuous

Try this. The solid curve is ϕ′\phi' for ϕ(x)=x2sin⁡(1/x)\phi(x) = x^2\sin(1/x) (dashed, much flatter). Drag the trace point towards 00 and read off the values of ϕ′\phi'.

y=ϕ′(x)=2xsin⁡1x−cos⁡1x (x≠0), ϕ′(0)=0y = \phi'(x) = 2x\sin\tfrac1x - \cos\tfrac1x\ (x \ne 0),\ \phi'(0) = 0
xy
  • the curve
  • x² sin(1/x)
  • trace point (drag)
At x=0.05x = 0.05: y=−0.31679y = -0.31679
What to notice

Arbitrarily close to 00, ϕ′\phi' takes every value between about −1-1 and 11, because cos⁡(1/x)\cos(1/x) does. Yet ϕ′(0)=0\phi'(0) = 0, computed from the definition in Examples XLIV, 16. A curve can have a tangent at every point whose direction does not vary continuously. What ϕ′\phi' cannot do is jump, as you will see in Darboux’s theorem.

Proofs

Proof Theorem C
Strategy

Contrapositive of Theorem A (§122). A non-zero derivative makes the function rise through the point, so the point cannot be a maximum or a minimum.

Suppose ϕ′(ξ)>0\phi'(\xi) > 0

By Theorem A, ϕ(x)>ϕ(ξ)\phi(x) > \phi(\xi) for xx slightly greater than ξ\xi, so ϕ(ξ)\phi(\xi) is not a maximum; and ϕ(x)<ϕ(ξ)\phi(x) < \phi(\xi) for xx slightly less than ξ\xi, so it is not a minimum.

Suppose ϕ′(ξ)<0\phi'(\xi) < 0

The same, with the sides exchanged.

Conclude

At a maximum or minimum neither case can occur, so ϕ′(ξ)=0\phi'(\xi) = 0.

Proof The sign-change test
Strategy

Use Cor. 1 of §122 on each side: the function increases up to ξ\xi and decreases after it.

Left of ξ\xi

Choose ε\varepsilon so that ϕ′>0\phi' > 0 on (ξ−ε,ξ)(\xi - \varepsilon, \xi). ϕ\phi is differentiable, hence continuous, on [ξ−12ε,ξ][\xi - \tfrac12\varepsilon, \xi], and ϕ′>0\phi' > 0 inside. By Cor. 1, ϕ\phi is strictly increasing there, so ϕ(x)<ϕ(ξ)\phi(x) < \phi(\xi) for ξ−12ε≤x<ξ\xi - \tfrac12\varepsilon \le x < \xi.

Right of ξ\xi

In the same way (with ϕ′<0\phi' < 0), ϕ\phi is strictly decreasing on [ξ,ξ+12ε][\xi, \xi + \tfrac12\varepsilon], so ϕ(x)<ϕ(ξ)\phi(x) < \phi(\xi) for ξ<x≤ξ+12ε\xi < x \le \xi + \tfrac12\varepsilon.

Conclude

ϕ(ξ)>ϕ(x)\phi(\xi) > \phi(x) for all x≠ξx \ne \xi within 12ε\tfrac12\varepsilon of ξ\xi: a maximum. The argument uses only the continuity of ϕ\phi at ξ\xi, not ϕ′(ξ)=0\phi'(\xi) = 0, which is why it also handles the corner of 1−∣x∣1 - |x|.

Proof Theorem D
Strategy

Apply Theorem A to the function ϕ′\phi', whose derivative at ξ\xi is ϕ′′(ξ)\phi''(\xi). This produces exactly the sign change needed for the previous test.

ϕ′\phi' exists near ξ\xi

For ϕ′′(ξ)\phi''(\xi) to exist, ϕ′\phi' must be defined in an interval around ξ\xi. So ϕ\phi is differentiable, and continuous, near ξ\xi.

Suppose ϕ′′(ξ)<0\phi''(\xi) < 0

By Theorem A applied to ϕ′\phi' (with “<<” in place of “>>”), ϕ′(x)>ϕ′(ξ)=0\phi'(x) > \phi'(\xi) = 0 for xx slightly less than ξ\xi and ϕ′(x)<0\phi'(x) < 0 for xx slightly greater.

Apply the sign-change test

ϕ′\phi' changes from ++ to −- at ξ\xi, so ϕ(ξ)\phi(\xi) is a maximum. If ϕ′′(ξ)>0\phi''(\xi) > 0, the same argument gives a minimum.

Proof x2sin⁡(1/x)x^2\sin(1/x): derivative everywhere, continuous derivative nowhere near 00
Strategy

Compute ϕ′\phi' by the rules away from 00 and by the definition at 00, then look at ϕ′\phi' along two sequences tending to 00.

Away from 00

For x≠0x \ne 0, the product and chain rules give ϕ′(x)=2xsin⁡(1/x)−cos⁡(1/x)\phi'(x) = 2x\sin(1/x) - \cos(1/x).

At 00

{ϕ(h)−ϕ(0)}/h=hsin⁡(1/h)\{\phi(h) - \phi(0)\}/h = h\sin(1/h), and ∣hsin⁡(1/h)∣≤∣h∣→0|h\sin(1/h)| \le |h| \to 0. So ϕ′(0)=0\phi'(0) = 0.

No limit at 00

At xk=1/(2kπ)x_k = 1/(2k\pi): ϕ′(xk)=0−1=−1\phi'(x_k) = 0 - 1 = -1. At xk′=1/{(2k+1)π}x_k' = 1/\{(2k + 1)\pi\}: ϕ′(xk′)=0+1=1\phi'(x_k') = 0 + 1 = 1. Both sequences tend to 00, so ϕ′(x)\phi'(x) has no limit as x→0x \to 0, and ϕ′\phi' is discontinuous at 00. Hardy’s phrase is that ϕ′\phi' oscillates between the “limits of indetermination” −1-1 and 11.

Worked examples and exercises

Exercise ●●○ Hardy: Examples XLVI, 10

Show that (x+5)2(x3−10)(x + 5)^2(x^3 - 10) has a minimum at x=1x = 1, and find its other turning values.

Hint
Factor the derivative completely: it has a factor x3+3x2−4x^3 + 3x^2 - 4, which vanishes at x=1x = 1.

Solution

ϕ′(x)=2(x+5)(x3−10)+3x2(x+5)2=(x+5)(5x3+15x2−20)=5(x+5)(x−1)(x+2)2\phi'(x) = 2(x + 5)(x^3 - 10) + 3x^2(x + 5)^2 = (x + 5)(5x^3 + 15x^2 - 20) = 5(x + 5)(x - 1)(x + 2)^2. The stationary points are x=−5x = -5, −2-2, 11. Signs of ϕ′\phi': positive for x<−5x < -5, negative on (−5,−2)(-5, -2) and on (−2,1)(-2, 1), positive for x>1x > 1. So x=−5x = -5 gives a maximum, ϕ(−5)=0\phi(-5) = 0; x=1x = 1 gives a minimum, ϕ(1)=36⋅(−9)=−324\phi(1) = 36 \cdot (-9) = -324; and x=−2x = -2, where ϕ′\phi' does not change sign (the factor (x+2)2(x + 2)^2), gives neither: it is a stationary point of inflexion.

Exercise ●○○ Hardy: Examples XLVI, 12

Show that (ax+b)/(cx+d)(ax + b)/(cx + d) has no maxima or minima, whatever aa, bb, cc, dd may be.

Solution

The derivative is a(cx+d)−c(ax+b)(cx+d)2=ad−bc(cx+d)2\dfrac{a(cx + d) - c(ax + b)}{(cx + d)^2} = \dfrac{ad - bc}{(cx + d)^2}. If ad≠bcad \ne bc it never vanishes, and by Theorem C there is no maximum or minimum. (On each side of the pole x=−d/cx = -d/c the function is strictly monotonic.) If ad=bcad = bc the function is constant (where defined), and a constant has no strict maximum or minimum.

Exercise ●●○ Hardy: Examples XLVI, 21

Show that the maximum value of (x−1)2/(x+1)3(x - 1)^2/(x + 1)^3 is 227\tfrac{2}{27}.

Hint
Factor the derivative as (x−1)(5−x)/(x+1)4(x - 1)(5 - x)/(x + 1)^4.

Solution

ϕ′(x)=2(x−1)(x+1)3−3(x−1)2(x+1)2(x+1)6=(x−1){2(x+1)−3(x−1)}(x+1)4=(x−1)(5−x)(x+1)4\phi'(x) = \dfrac{2(x - 1)(x + 1)^3 - 3(x - 1)^2(x + 1)^2}{(x + 1)^6} = \dfrac{(x - 1)\{2(x + 1) - 3(x - 1)\}}{(x + 1)^4} = \dfrac{(x - 1)(5 - x)}{(x + 1)^4}. For x>−1x > -1: ϕ′<0\phi' < 0 on (−1,1)(-1, 1), >0> 0 on (1,5)(1, 5), <0< 0 for x>5x > 5. So x=1x = 1 gives a minimum (00) and x=5x = 5 a maximum, ϕ(5)=16/216=2/27\phi(5) = 16/216 = 2/27. For x<−1x < -1, ϕ′<0\phi' < 0 throughout (both x−1x - 1 and 5−x5 - x have fixed signs, with product negative), so there are no other turning values.

Exercise ●○○ Hardy: Examples XLVI, 23

Find the maxima and minima of acos⁡x+bsin⁡xa\cos x + b\sin x (with aa, bb not both 00), and check by writing it as Acos⁡(x−α)A\cos(x - \alpha).

Solution

ϕ′(x)=−asin⁡x+bcos⁡x\phi'(x) = -a\sin x + b\cos x, which vanishes when tan⁡x=b/a\tan x = b/a (or cos⁡x=0\cos x = 0 if a=0a = 0). Put A=a2+b2A = \sqrt{a^2 + b^2} and choose α\alpha with cos⁡α=a/A\cos\alpha = a/A, sin⁡α=b/A\sin\alpha = b/A. Then acos⁡x+bsin⁡x=Acos⁡(x−α)a\cos x + b\sin x = A\cos(x - \alpha), with maxima AA at x=α+2kπx = \alpha + 2k\pi and minima −A-A at x=α+(2k+1)πx = \alpha + (2k + 1)\pi. Theorem D agrees: ϕ′′=−ϕ\phi'' = -\phi, which is −A<0-A < 0 at the first set of points and A>0A > 0 at the second.

Exercise ●●○ Hardy: Examples XLVI, 37

Show that the greatest value of xmynx^my^n, where x,y>0x, y > 0, x+y=kx + y = k and mm, nn are positive, is mmnnkm+n(m+n)m+n\dfrac{m^mn^nk^{m+n}}{(m + n)^{m+n}}.

Hint
Substitute y=k−xy = k - x and maximise ϕ(x)=xm(k−x)n\phi(x) = x^m(k - x)^n on (0,k)(0, k).

Solution

ϕ′(x)=xm−1(k−x)n−1{m(k−x)−nx}\phi'(x) = x^{m-1}(k - x)^{n-1}\{m(k - x) - nx\}, which on (0,k)(0, k) vanishes only at x=mk/(m+n)x = mk/(m + n), with ϕ′>0\phi' > 0 before and <0< 0 after. So this is a maximum. Since ϕ\phi is continuous on [0,k][0, k] with ϕ(0)=ϕ(k)=0\phi(0) = \phi(k) = 0 and ϕ>0\phi > 0 inside, it is the greatest value. There y=nk/(m+n)y = nk/(m + n), and

xmyn=mmkm(m+n)m⋅nnkn(m+n)n=mmnnkm+n(m+n)m+n.x^my^n = \frac{m^mk^m}{(m + n)^m}\cdot\frac{n^nk^n}{(m + n)^n} = \frac{m^mn^nk^{m+n}}{(m + n)^{m+n}}.

Check yourself

Check yourself True or false?

If ϕ′(ξ)=0\phi'(\xi) = 0, then ϕ\phi has a maximum or a minimum at ξ\xi.

Why

False: x3x^3 at 00. Theorem C gives a necessary condition only. You also need a sign change of ϕ′\phi', or ϕ′′(ξ)≠0\phi''(\xi) \ne 0.

Check yourself Enter a number

What is the largest value of x3−18x2+96xx^3 - 18x^2 + 96x on the closed interval [0,9][0, 9]?

Why

The candidates are the ends (00 and 135135) and the stationary points x=4x = 4 (160160) and x=8x = 8 (128128). The largest is 160160. (The smallest is 00, at an end point, not at the local minimum.)

Check yourself Choose one

For ϕ(x)=x4\phi(x) = x^4 at ξ=0\xi = 0, what does Theorem D say?

Why

ϕ′(x)=4x3\phi'(x) = 4x^3 and ϕ′′(x)=12x2\phi''(x) = 12x^2 both vanish at 00, so Theorem D is silent. ϕ′\phi' changes from −- to ++ at 00, so the sign-change test gives a minimum. So ϕ′′(ξ)=0\phi''(\xi) = 0 does not mean “neither”; and x3x^3, which gives neither, shows that it does not mean an extremum either.

Check yourself True or false?

A function can have a maximum value that is smaller than one of its minimum values.

Why

True: maxima and minima are local. In Hardy’s Fig. 37 the maximum at A3A_3 is lower than the minimum at B1B_1. For a concrete example, x+2sin⁡xx + 2\sin x has a maximum at x=23πx = \tfrac23\pi, of value about 3.833.83, and a minimum at x=103πx = \tfrac{10}3\pi, of value about 8.748.74.

Check yourself Choose one

Which statement about a function ϕ\phi that has a derivative at every point is correct?

Why

x2sin⁡(1/x)x^2\sin(1/x) has a discontinuous derivative, so the first option is false. But Hardy notes at the end of §125, and proves in §126 and §129, that a derivative cannot have a simple (jump) discontinuity. The last option is false too: x2sin⁡(1/x2)x^2\sin(1/x^2) is differentiable everywhere, with an unbounded derivative near 00.

Hardy’s language

Summary

Summary
  • Maxima and minima are local; a maximum value may be smaller than a minimum value elsewhere.
  • Theorem C: at a maximum or minimum of a differentiable function, ϕ′=0\phi' = 0. Necessary, not sufficient.
  • Sufficient: ϕ′\phi' changes sign (++ to −-: maximum; −- to ++: minimum), or ϕ′(ξ)=0\phi'(\xi) = 0 with ϕ′′(ξ)≠0\phi''(\xi) \ne 0 (Theorem D). If ϕ′′(ξ)=0\phi''(\xi) = 0, Theorem D says nothing.
  • On a closed interval, compare the end points, the stationary points and the points where ϕ′\phi' fails to exist.
  • A derivative may exist everywhere and still be discontinuous (x2sin⁡(1/x)x^2\sin(1/x)), but it never has a jump.