### Subsection3.5.1Local and Global Maxima and Minima

Suppose that the maximum (or minimum) value of $f(x)$ is $f(c)$ then what does that tell us about $c\text{?}$

Notice that we have not yet made the ideas of maximum and minimum very precise. For the moment think of maximum as “the biggest value” and minimum as “the smallest value”.

###### Warning3.5.2

It is important to distinguish between “the smallest value” and “the smallest magnitude”. For example, because

\begin{gather*} -5 \lt -1 \end{gather*}

the number $-5$ is smaller than $-1\text{.}$ But the magnitude of $-1\text{,}$ which is $|-1|=1\text{,}$ is smaller than the magnitude of $-5\text{,}$ which is $|-5|=5\text{.}$ Thus the smallest number in the set $\{-1, -5\}$ is $-5\text{,}$ while the number in the set $\{-1,-5\}$ that has the smallest magnitude is $-1\text{.}$

Now back to thinking about what happens around a maximum. Suppose that the maximum value of $f(x)$ is $f(c)\text{,}$ then for all “nearby” points, the function should be smaller. Consider the derivative of $f'(c)\text{:}$

\begin{align*} f'(c) &= \lim_{h \to 0} \frac{f(c+h)-f(c)}{h}. \end{align*}

Split the above limit into the left and right limits:

• Consider points to the right of $x=c\text{,}$ For all $h \gt 0\text{,}$
\begin{align*} f(c+h) & \le f(c) & \text{which implies that}\\ f(c+h)-f(c) &\le 0 & \text{which also implies}\\ \frac{f(c+h)-f(c)}{h} & \le 0 & \text{since } \frac{\text{negative}}{\text{positive}} = \text{negative}. \end{align*}
But now if we squeeze $h \to 0$ we get
\begin{align*} \lim_{h \to 0^+} \frac{f(c+h)-f(c)}{h} &\leq 0 \end{align*}
(provided the limit exists).
• Consider points to the left of $x=c\text{.}$ For all $h \lt 0\text{,}$
\begin{align*} f(c+h) & \le f(c) & \text{which implies that}\\ f(c+h)-f(c) &\le 0 & \text{which also implies}\\ \frac{f(c+h)-f(c)}{h} & \ge 0 & \text{since } \frac{\text{negative}}{\text{negative}} = \text{positive}. \end{align*}
But now if we squeeze $h \to 0$ we get
\begin{align*} \lim_{h \to 0^-} \frac{f(c+h)-f(c)}{h} &\geq 0 \end{align*}
(provided the limit exists).
• So if the derivative $f'(c)$ exists, then the above right- and left-hand limits must agree, which forces $f'(c) = 0\text{.}$

Thus we can conclude that

If the maximum value of $f(x)$ is $f(c)$ and $f'(c)$ exists, then $f'(c)=0\text{.}$

Using similar reasoning one can also see that

If the minimum value of $f(x)$ is $f(c)$ and $f'(c)$ exists, then $f'(c)=0\text{.}$

Notice two things about the above reasoning:

• Firstly, in order for the argument to work we only need that $f(x) \lt f(c)$ for $x$ close to $c$ — it does not matter what happens for $x$ values far from $c\text{.}$
• Secondly, in the above argument we needed to consider $f(x)$ for $x$ both to the left of and to the right of $c\text{.}$ If the function $f(x)$ is defined on a closed interval $[a,b]\text{,}$ then the above argument only applies when $a \lt c \lt b$ — not when $c$ is either of the endpoints $a$ and $b\text{.}$

Consider the function below This function has only 1 maximum value (the middle green point in the graph) and 1 minimum value (the rightmost blue point), however it has 4 points at which the derivative is zero. In the small intervals around those points where the derivative is zero, we can see that function is locally a maximum or minimum, even if it is not the global maximum or minimum. We clearly need to be more careful distinguishing between these cases.

###### Definition3.5.3

Let $I$ be an interval, like $(a,b)$ or $[a,b]$ for example, and let the function $f(x)$ be defined for all $x \in I\text{.}$ Now let $c\in I\text{.}$ Then

• we say that $f(x)$ has a global (or absolute) minimum on the interval $I$ at the point $x=c$ if $f(x)\ge f(c)$ for all $x\in I\text{.}$
• Similarly, we say that $f(x)$ has a global (or absolute) maximum on $I$ at $x=c$ if $f(x)\le f(c)$ for all $x\in I\text{.}$
• We say that $f(x)$ has a local 1 Beware that, while many textbooks use these definitions of local minimum and maximum, some textbooks exclude the endpoints $a\text{,}$ $b$ of the interval $[a,b]$ from their definitions. Our definitions allow the endpoints $a$ and $b$ to be local minima and maxima. Note that, under our definitions, every global minimum (maximum) is also a local minimum (maximum). minimum on $I$ at $x=c$ if $f(x)\ge f(c)$ for all $x\in I$ that are near $c\text{.}$ Precisely, if there is a $\delta>0$ such that $f(x)\ge f(c)$ for all $x\in I$ that are within a distance $\delta$ of $c\text{.}$
• Similarly, we say that $f(x)$ has a local maximum on $I$ at $x=c$ if $f(x)\le f(c)$ for all $x\in I$ that are near $c\text{.}$ Precisely, if there is a $\delta>0$ such that $f(x)\le f(c)$ for all $x\in I$ that are within a distance $\delta$ of $c\text{.}$

The global maxima and minima of a function are called the global extrema of the function, while the local maxima and minima are called the local extrema.

Consider again the function we showed in the figure above It has 3 local maxima and 3 local minima on the interval $[a,b]\text{.}$ The global maximum occurs at the middle green point (which is also a local maximum), and the global minimum occurs at the rightmost blue point (which is also a local minimum).

Using the above definition we can summarise what we have learned above as the following theorem  2 This is one of several important mathematical contributions made by Pierre de Fermat, a French government lawyer and amateur mathematician, who lived in the first half of the seventeenth century.:

• It is often (but not always) the case that, when $f(x)$ has a local maximum at $x=c\text{,}$ the function $f(x)$ increases strictly as $x$ approaches $c$ from the left and decreases strictly as $x$ leaves $c$ to the right. That is, $f'(x) \gt 0$ for $x$ just to the left of $c$ and $f'(x) \lt 0$ for $x$ just to the right of $c\text{.}$ Then, it is often the case, because $f'(x)$ is decreasing as $x$ increases through $c\text{,}$ that $f''(c) \lt 0\text{.}$
• Conversely, if $f'(c)=0$ and $f''(c) \lt 0\text{,}$ then, just to the right of $c\text{,}$ $f'(x)$ must be negative, so that $f(x)$ is decreasing, and just to the left of $c\text{,}$ $f'(x)$ must be positive, so that $f(x)$ is increasing. So $f(x)$ has a local maximum at $c\text{.}$
• Similarly, it is often the case that, when $f(x)$ has a local minimum at $x=c\text{,}$ $f'(x) \lt 0$ for $x$ just to the left of $c$ and $f'(x) \gt 0$ for $x$ just to the right of $c$ and $f''(x) \gt 0\text{.}$
• Conversely, if $f'(c)=0$ and $f''(c) \gt 0\text{,}$ then, just to the right of $c\text{,}$ $f'(x)$ must be positive, so that $f(x)$ is increasing, and, just to the left of $c\text{,}$ $f'(x)$ must be negative, so that $f(x)$ is decreasing. So $f(x)$ has a local minimum at $c\text{.}$

Theorem 3.5.4 says that, when $f(x)$ has a local maximum or minimum at $x=c\text{,}$ there are three possibilities.

• The derivative $f'(c)=0\text{.}$ This case is illustrated in the following figure. Observe that, in this example, $f'(x)$ changes continuously from negative to positive at the local minimum, taking the value zero at the local minimum (the red dot).

• The derivative $f'(c)$ does not exist. This case is illustrated in the following figure. Observe that, in this example, $f'(x)$ changes discontinuously from negative to positive at the local minimum ($x=0$) and $f'(0)$ does not exist.

• The point $c$ is an endpoint of the interval $I\text{.}$ This case is also illustrated in the above figure. The endpoints $a$ and $b$ are both local maxima. But $f'(a)$ and $f'(b)$ are not zero.

This theorem demonstrates that the points at which the derivative is zero or does not exist are very important. It simplifies the discussion that follows if we give these points names.

###### Definition3.5.6

Let $f(x)$ be a function that is defined on the interval $a\lt x\lt b$ and let $a \lt c\lt b\text{.}$ Then

• if $f'(c)$ exists and is zero we call $x=c$ a critical point of the function, and
• if $f'(c)$ does not exist then we call $x=c$ a singular point 3 For $c$ to be a local maximum or minimum of $f\text{,}$ the function $f$ must obviously be defined at $c\text{.}$ So here we are considering only points $c$ in the domain of $f\text{.}$ We will later, in §3.6.2, extend the definition of singular points of $f$ to points that are not in the domain of $f\text{.}$ of the function.
###### Warning3.5.7

Note that some people (and texts) will combine both of these cases and call $x=c$ a critical point when either the derivative is zero or does not exist. The reader should be aware of the lack of convention on this point  4 No pun intended. and should be careful to understand whether the more inclusive definition of critical point is being used, or if the text is using the more precise definition that distinguishes critical and singular points.

We'll now look at a few simple examples involving local maxima and minima, critical points and singular points. Then we will move on to global maxima and minima.

In this example, we'll look for local maxima and minima of the function $f(x) = x^3-6x$ on the interval $-2\le x\le 3\text{.}$

• First compute the derivative
\begin{align*} f'(x) &= 3x^2-6. \end{align*}
Since this is a polynomial it is defined everywhere on the domain and so there will not be any singular points. So we now look for critical points.
• To do so we look for zeroes of the derivative

\begin{align*} f'(x) &= 3x^2-6 = 3(x^2-2) = 3(x-\sqrt{2})(x+\sqrt{2}). \end{align*}

This derivative takes the value $0$ at two different values of $x\text{.}$ Namely $x=c_-=-\sqrt{2}$ and $x=c_+=\sqrt{2}\text{.}$ Here is a sketch of the graph of $f(x)\text{.}$ From the figure we see that

• $f(x)$ has a local minimum at the endpoint $x=-2$ (i.e. we have $f(x)\ge f(-2)$ whenever $x\ge -2$ is close to $-2$) and
• $f(x)$ has a local minimum at $x=c_+$ (i.e. we have $f(x)\ge f(c_+)$ whenever $x$ is close to $c_+$) and
• $f(x)$ has a local maximum at $x=c_-$ (i.e. we have $f(x)\le f(c_-)$ whenever $x$ is close to $c_-$) and
• $f(x)$ has a local maximum at the endpoint $x=3$ (i.e. we have $f(x)\le f(3)$ whenever $x\le 3$ is close to $3$) and
• the global minimum of $f(x)\text{,}$ for $x$ in the interval $-2\le x\le 3\text{,}$ is at $x=c_+$ (i.e. we have $f(x)\ge f(c_+)$ whenever $-2\le x\le 3$) and
• the global maximum of $f(x)\text{,}$ for $x$ in the interval $-2\le x\le 3\text{,}$ is at $x=3$ (i.e. we have $f(x)\le f(3)$ whenever $-2\le x\le 3$).
• Note that we have carefully constructed this example to illustrate that the global maximum (or minimum) of a function on an interval may or may not also be a critical point of the function.

In this example, we'll look for local maxima and minima of the function $f(x) = x^3$ on the interval $-1\lt x\lt 1\text{.}$

• First compute the derivative:
\begin{align*} f'(x) &= 3x^2. \end{align*}
Again, this is a polynomial and so defined on all of the domain. The function will not have singular points, but may have critical points.
• The derivative is zero only when $x=0\text{,}$ so $x=c=0$ is the only critical point of the function.
• The graph of $f(x)$ is sketched below. From that sketch we see that $f(x)$ has neither a local maximum nor a local minimum at $x=c$ despite the fact that $f'(c)=0$ — we have $f(x) \lt f(c)=0$ for all $x \lt c=0$ and $f(x) \gt f(c)=0$ for all $x \gt c=0\text{.}$ • Note that this example has been constructed to illustrate that a critical point (or singular point) of a function need not be a local maximum or minimum for the function.
• Reread Theorem 3.5.4. It says 5 A very common error of logic that people make is “Affirming the consequent”. When the statement “if P then Q” is true, observing Q does not imply P. (“Affirming the consequent” eliminates “not” from the previous sentence.) For example, “If he is Shakespeare then he is dead.” and “That man is dead.” does not imply “He must be Shakespeare.”. Or you may have also seen someone use this reasoning: “If a person is a genius before their time then they are misunderstood.” “I am misunderstood.” “So I must be a genius before my time.”. “Let $\cdots\text{.}$ If $f(x)$ has a local maximum/minimum at $x=c$ and if $f'(c)$ exists, then $f'(c)=0$”. It does not say that “if $f'(c)=0$ then $f$ has a local maximum/minimum at $x=c$”.

In this example, we'll look for local maxima and minima of the function

\begin{align*} f(x) = |x| = \begin{cases} x & \text{if }x \ge 0\\ -x & \text{if }x \lt 0 \end{cases} \end{align*}

on the interval $-1\lt x\lt 1$ and we'll also look for local maxima and minima of the function

\begin{equation*} g(x) = x^{2/3} \end{equation*}

on the interval $-1\lt x\lt 1\text{.}$

• Again, start by computing the derivatives (reread Example 2.2.10):
\begin{align*} f'(x) &= \begin{cases} 1 & \text{if }x \gt 0\\ \text{undefined} & \text{if }x = 0\\ -1 & \text{if }x \lt 0 \end{cases}\\ g'(x) &= \begin{cases} \frac{2}{3} x^{-1/3} & \text{if }x \ne 0 \\ \text{undefined} & \text{if }x = 0 \end{cases} \end{align*}
• These derivatives never take the value $0\text{,}$ so the functions $f(x)$ and $g(x)$ do not have any critical points. However both derivatives do not exist at the point $x=0\text{,}$ so that point is a singular point for both $f(x)$ and $g(x)\text{.}$
• Here is a sketch of the graph of $f(x)$ and a sketch of the graph of $g(x)\text{.}$ From the figures we see that both $f(x)$ and $g(x)$ have a local (and in fact global) minimum at $x=0$ despite the fact that $x=0$ is not a critical point.

• Reread Theorem 3.5.4 yet again. It says “Let $\cdots\text{.}$ If $f(x)$ has a local maximum or local minimum at $x=c$ and if $f$ is differentiable at $x=c$, then $f'(c)=0$”. It says nothing about what happens at points where the derivative does not exist. Indeed that is why we have to consider both critical points and singular points when we look for maxima and minima.