Skip to main content

Unit 7.2 The first derivative and extrema

The proof of this theorem is accessible and conceptually relevant. This result should seem very credible an intuitive level. If \(f'(c) < 0\) then moving to the left from \(c\) to \(c - \varepsilon\) should produce a greater value of \(f\text{.}\) Likewise, if \(f' (c) > 0\) then moving to the right should produce a greater value. This is the most intuitive justification we could write down, though not exactly airtight.
Figure 7.6. difference quotients between \(c\) and points to the right (red) are positive; those to the left (blue) are negative
Here is a more airtight argument. Because \(f\) is differentiable at \(c\text{,}\) the one-sided derivatives exist and are equal. The derivative from the right is \(\lim_{x \to c^+} \frac{f(x) - f(c)}{x-c}\text{;}\) because \(c\) is a minimum, both top and bottom of this fraction are positive (the numerator could be zero). The limit of nonnegative numbers is nonnegative, hence \(f'(c_+) \geq 0\text{;}\) see Figure 7.6. Similarly, \(f'(c_-)\) is a limit in which each term is nonpositive, thus \(f' (c_-) \leq 0\text{.}\) For these to be equal, both must equal zero. This finishes the proof.

Checkpoint 114.

Suppose \(f\) is differentiable on \([a,b]\) (derivatives at the endpoints are one-sided). If the minimum of \(f\) on this interval occurs at the left endpoint, can you conclude that the one-sided derivative there is zero?
Explain.
Answer.
\(\text{no, we cannot conclude that}\)
Let’s get the logic straight. It goes like this:
minimum \(\Rightarrow\) \(f' = 0\)
The opposite logic,
\(f' = 0\) \(\Rightarrow\) minimum
is not necessarily true! Nevertheless, everyone’s favorite procedure for finding minima is to set \(f'\) equal to zero. Why does this work, or rather, when does this work?
Let \(a < b\) be real numbers. First of all, does \(f\) even have a minimum on \([a,b]\text{?}\) In fact there are counterexamples in Figure 7.7.
Figure 7.7. The function \(1/x\) has no minimum on the interval \([-2,2]\)
From Theorem 7.4, if \(f\) is defined and continuous on a closed interval \([a,b]\text{,}\) then indeed \(f\) has to have a minimum and a maximum somewhere on \([a,b]\text{.}\) We can use Theorem 7.5 to find where minima and maxima don’t occur: if \(a < c < b\) and \(f'(c) \neq 0\text{,}\) then definitely the minimum does not occur at \(c\text{.}\) Where can it be then? What’s left is the point \(a\text{,}\) the point \(b\text{,}\) every point where \(f'\) is zero, and every point where \(f'\) does not exist. An identical argument shows the same is true for the maximum. Summing up:

Checkpoint 115.

Let \(f(x) := \lvert x\rvert\) and let \([a,b]\) be the interval \([-2,2]\text{.}\) Does Theorem 7.8 say \(f\) must have a minimum on this interval?
  • Yes, f must have a minimum.
  • No, the Theorem is silent about this.
  • No, the Theorem says f does not have a minimum.
If so, what does the theorem say about where the minimum must be?
Now answer the same question for the maximum of \(f\) on a general interval \([a,b]\text{.}\)
Answer 1.
\(\text{Yes, f must have a minimum.}\)
Answer 2.
\(0\)

Remark 7.9.

Being differentiable except for a number of points (call them \(c_0,\ldots,c_k\)) is sometimes called being piecewise differentiable, because the function is differentiable in pieces, the pieces being the intervals \((c_0, c_1) , (c_2, c_2), \ldots , (c_{k-1} , c_k)\text{.}\)
Figure 7.10.

Checkpoint 116.

Let \(f\) be the “sawtooth” function shown in Figure 7.10, defined by letting \(f(x)\) be the distance from \(x\) to the nearest integer, either \(\lfloor x \rfloor\) or \(\lceil x \rceil\text{.}\)
Is \(f\) piecewise differentiable on \([-2,2]\text{?}\)
If so, give a value of \(k\) and \(c_0 , \ldots , c_k\) that show this to be true. If not, say why not.
Answer.
\(\text{yes}\)
You can write Theorem 7.8 as a procedure if you want. Even if you’re looking only for the minimum or only for the maximum, the procedure is the same so it will find both.
  1. Make sure \(f\) is continuous on \([a,b]\text{;}\) if not, abort procedure.
  2. Write down all \(x \in (a,b)\) where \(f'(x) = 0\text{.}\)
  3. Add to the list all \(x \in [a,b]\) where \(f'(x)\) DNE.
  4. Add to the list the points \(a\) and \(b\text{.}\)
  5. For every point \(x\) on the list, compute \(f(x)\text{;}\) the greatest value on this second list (the output list) will be the maximum; the least will be the minimum.
  6. Using the two lists side by side, we can determine where the extrema occurred.
Figure 7.11. Theorem 7.8 as a procedure.

Example 7.12.

Find the maximum of \(f(x) := 5x - x^2\) on the interval \([1,3]\text{;}\) see the figure at the right. Computing \(f'(x) = 5-2x\) and setting it equal to zero we see that \(f'(x) = 0\) precisely when \(x = 2.5\text{.}\) There are no points where \(f'\) is undefined, so our list consists of just the one point plus the two endpoints: \(\{ 1, 2.5, 3 \}\text{.}\) Checking the values of \(f\) there produces \(4, 6.25, 6\text{.}\) The maximum is the greatest of these, occurring at \(x = 2.5\text{.}\)
Figure 7.13. optimizing \(f(x)=5x-x^2\) on the interval \([1,3]\)

Checkpoint 117.

Where do the maximum and minimum of \(x^3 - x^2 - 2x\) on the interval \([-1,3]\) occur? Answer to two decimal places.
maximum occurs:
minimum occurs:
Answer 1.
\(3\)
Answer 2.
\(\frac{1+\sqrt{7}}{3}\)
1.
2.
3.
4.
Figure 7.14. four functions for Checkpoint 118

Checkpoint 118.

Here are some other things you may find when you use Theorem 7.8. Match each of these verbal descriptions to the role of \(x\) in one of the four pictures in Figure 7.14.
  1. \(f\) has a local extreme value at \(x\) but not a global one
  2. \(f'(x) = 0\) but \(f\) has neither a local minimum nor a local maximum there
  3. \(f'(x)\) is undefined but \(f\) has a maximum or minimum there
  4. \(f'(x)\) is undefined and \(f\) does not have an extremum there
Which picture has an endpoint that is not where the function achieves a global extremum?
Answer 1.
\(\text{4}\)
Answer 2.
\(\text{3}\)
Answer 3.
\(\text{1}\)
Answer 4.
\(\text{2}\)

Example 7.15.

Let \(f(x) = x\) and consider the half-closed interval \((0,1]\text{.}\) In this case we have a continuous function but not a closed interval.
This example represents a scenario where you make a donation in bitcoin to enter a virtual tourist attraction and you want to spend as little as possible. You have 1 bitcoin, so that’s the maximum you can donate; donations can be any positive real number but zero is not allowed.
The minimum of \(x\) on \((0,1]\) does not exist: there is no smallest positive real number.
The interpretation is clear: no matter how little you donate, you could have donated less. Mathematically, this clarifies the need for a closed interval in Theorem 7.4.

Checkpoint 119.

Second derivatives and extrema.

Recall that wherever \(f\) has a second derivative, if \(f'' \neq 0\) then the sign of \(f''\) determines the concavity of \(f\text{.}\) If \(f''(x) > 0\) then \(f\) is concave upward and if \(f''(x) < 0\) then \(f\) is concave downward. At a point where \(f' = 0\text{,}\) if we know the concavity, we know whether \(f\) has a local maximum or local minimum.
Figure 7.16. a critical point where \(f'' > 0\) (left) and where \(f'' < 0\) (right)

Example 7.17.

What are the extrema of the function \(f(x) := x^2 + 1/x\) on the interval \((0,2)\text{?}\) The only critical point is where \(f'(x) = 2x - 1/x^2 = 0\text{,}\) hence \(x = \sqrt[3]{1/2}\text{.}\) Here, \(f''(x) = 2 + 2/x^3 > 0\) therefore this is a local minimum. There are not any local maxima. This means \(f\) has no global maximum on \((0,2)\text{.}\) It may have a global minimum, and indeed, Figure 7.18 shows that \(x = \sqrt[3]{2}\) is a local minimum. In your homework you will get some more tools for arguing whether a local extremum on a non-closed interval is a global extremum.
Figure 7.18. the function \(x^2 + 1/x\) on the interval \((0,2)\)

Remark 7.19.

If the second derivative vanishes along with the first, you won’t know any more than you did already.