next up previous contents
Next: The fundamental theorem of Up: Calculus Lecture Notes Previous: The mean value theorem

Some examples of searching for extreme values

Here are three examples of a search for the maximum and minimum value of a continuous function whose domain is a closed interval.

$f:[-10, 10]\rightarrow(-\infty,\infty)$, f(x) = |x-1| + |x-2| + |x-3| + |x+4|. Note that finding the value of x which minimizes f finds the point in [-10, 10] which is closest to the points 1, 2, 3, -4.

The endpoints of the domain of f are the -10 and 10, so the extreme values may occur at either x = -10 or x = 10.

f has no derivative at 1, 2, 3, and -4, so the extreme values of f may occur at any of these four values of x.

Otherwise, since |u|' = u/|u| the chain rule gives

\begin{displaymath}
f'(x) = \frac{x-1}{\vert x-1\vert} + \frac{x-2}{\vert x-2\vert} + \frac{x-3}{\vert x-3\vert} +
\frac{x+4}{\vert x+4\vert}.\end{displaymath}

Since each summand in the formula for f'(x) is either 1 or -1, and each summand changes sign exactly once, we can determine that f'(x) = 0 for $x\in [1,2]$. Hence the extreme values of f can occur at any $x\in(1,2)$.

Now we compute f at each of the candidate locations: f(-10) = 42, f(10) = 38, f(-4) = 18, f(1) = 8, f(2) = 8, f(3) = 10 and f(x) = 8 if $x\in(1,2)$. We conclude that the maximum value of f is 42 and the minimum value is 8. Hence the range of f is [8,42]. Note that this could have been obtained easily from the graph of y= f(x), but the general problem, $f:[-10, 10]\rightarrow(-\infty,\infty)$, f(x) = |x-a| + |x-b| + |x-c| + |x-d| cannot be solved graphically if the values of a,b,c,d are not specified, while it can be solved analytically, although without calculus if one is clever enough.

Note also that if we have change the rule of f to f(x) = |x-1| + |x-2| + |x-3| + |x+4| + |x+6|, $f'(x) \neq 0$ for every x.























$f:[-3,3]\rightarrow(-\infty,\infty)$,

\begin{displaymath}
f(x) = \left\{\begin{array}
{cc}
x^2 & {\rm if}\;x \geq 0\\ x^4 & {\rm if}\;x < 0\end{array}\right.\end{displaymath}

f is clearly continuous, so its extreme values may occur at -3 and 3. As far as differentiability is concerned, the only point that is a mystery is x = 0. However, we can easily check that

\begin{displaymath}
\begin{array}
{rcl}
{\displaystyle \lim_{h\rightarrow 0^+}\f...
 ...le \lim_{h\rightarrow 0^-}\frac{f(h) - f(0)}{h} = 0}\end{array}\end{displaymath}

so f'(0) = 0. Hence f is differentiable everywhere in (-3,3) with

\begin{displaymath}
f'(x) = \left\{\begin{array}
{cc}
2x & {\rm if}\;x \gt 0\\ 0 & {\rm if} x = 0\\ 4x^3 & {\rm if}\;x < 0\end{array}\right.\end{displaymath}

From this we see that the only remaining candidate for the location of an extreme value is x = 0, and that since f(-3) = 81, f(0) = 0 and f(3) = 9 the range of f is [0,81].





















$f:[-10, 10]\rightarrow(-\infty,\infty)$,

\begin{displaymath}
f(x) = \left\{\begin{array}
{cc}
4-2x & {\rm if}\;x \geq 0\\ 3x+4 & {\rm if}\;x < 0\end{array}\right.\end{displaymath}

Again f is clearly continuous, so its extreme values may occur at -10 and 10. f is clearly differentiable for $x \neq 0$, but is not differentiable at x = 0 since

\begin{displaymath}
\begin{array}
{rcl}
{\displaystyle \lim_{h\rightarrow 0^+}\f...
 ...le \lim_{h\rightarrow 0^-}\frac{f(h) - f(0)}{h} = 3}\end{array}\end{displaymath}

so

\begin{displaymath}
\frac{f(h)-f(0)}{h}\end{displaymath}

does not have limit as h approaches . Hence an extreme value of f may occur at x = 0.

\begin{displaymath}
f'(x) = \left\{\begin{array}
{cc}
-2 & {\rm if}\;x \gt 0\\ 3 & {\rm if}\;x < 0\end{array}\right.\end{displaymath}

we see that there are no other possible locations of extreme values of f. Since f(-10) = -26, f(0) = 4 and f(10) = -16, we conclude that the range of f is [-26, 4]. If we had forgotten to check for places where f was not differentiable we would have mistakenly claimed that the range was [-26,-16].
next up previous contents
Next: The fundamental theorem of Up: Calculus Lecture Notes Previous: The mean value theorem
David G Radcliffe
8/18/1998