### Learning Objectives

- 4.5.1 Explain how the sign of the first derivative affects the shape of a function’s graph.
- 4.5.2 State the first derivative test for critical points.
- 4.5.3 Use concavity and inflection points to explain how the sign of the second derivative affects the shape of a function’s graph.
- 4.5.4 Explain the concavity test for a function over an open interval.
- 4.5.5 Explain the relationship between a function and its first and second derivatives.
- 4.5.6 State the second derivative test for local extrema.

Earlier in this chapter we stated that if a function $f$ has a local extremum at a point $c,$ then $c$ must be a critical point of $f.$ However, a function is not guaranteed to have a local extremum at a critical point. For example, $f(x)={x}^{3}$ has a critical point at $x=0$ since $f\prime (x)=3{x}^{2}$ is zero at $x=0,$ but $f$ does not have a local extremum at $x=0.$ Using the results from the previous section, we are now able to determine whether a critical point of a function actually corresponds to a local extreme value. In this section, we also see how the second derivative provides information about the shape of a graph by describing whether the graph of a function curves upward or curves downward.

### The First Derivative Test

Corollary $3$ of the Mean Value Theorem showed that if the derivative of a function is positive over an interval $I$ then the function is increasing over $I.$ On the other hand, if the derivative of the function is negative over an interval $I,$ then the function is decreasing over $I$ as shown in the following figure.

A continuous function $f$ has a local maximum at point $c$ if and only if $f$ switches from increasing to decreasing at point $c.$ Similarly, $f$ has a local minimum at $c$ if and only if $f$ switches from decreasing to increasing at $c.$ If $f$ is a continuous function over an interval $I$ containing $c$ and differentiable over $I,$ except possibly at $c,$ the only way $f$ can switch from increasing to decreasing (or vice versa) at point $c$ is if ${f}^{\prime}$ changes sign as $x$ increases through $c.$ If $f$ is differentiable at $c,$ the only way that ${f}^{\prime}.$ can change sign as $x$ increases through $c$ is if ${f}^{\prime}\left(c\right)=0.$ Therefore, for a function $f$ that is continuous over an interval $I$ containing $c$ and differentiable over $I,$ except possibly at $c,$ the only way $f$ can switch from increasing to decreasing (or vice versa) is if $f\prime \left(c\right)=0$ or ${f}^{\prime}\left(c\right)$ is undefined. Consequently, to locate local extrema for a function $f,$ we look for points $c$ in the domain of $f$ such that $f\prime \left(c\right)=0$ or ${f}^{\prime}\left(c\right)$ is undefined. Recall that such points are called critical points of $f.$

Note that $f$ need not have local extrema at a critical point. The critical points are candidates for local extrema only. In Figure 4.31, we show that if a continuous function $f$ has a local extremum, it must occur at a critical point, but a function may not have a local extremum at a critical point. We show that if $f$ has a local extremum at a critical point, then the sign of ${f}^{\prime}$ switches as $x$ increases through that point.

Using Figure 4.31, we summarize the main results regarding local extrema.

- If a continuous function $f$ has a local extremum, it must occur at a critical point $c.$
- The function has a local extremum at the critical point $c$ if and only if the derivative ${f}^{\prime}$ switches sign as $x$ increases through $c.$
- Therefore, to test whether a function has a local extremum at a critical point $c,$ we must determine the sign of ${f}^{\prime}\left(x\right)$ to the left and right of $c.$

This result is known as the first derivative test.

#### First Derivative Test

Suppose that $f$ is a continuous function over an interval $I$ containing a critical point $c.$ If $f$ is differentiable over $I,$ except possibly at point $c,$ then $f\left(c\right)$ satisfies one of the following descriptions:

- If ${f}^{\prime}$ changes sign from positive when $x<c$ to negative when $x>c,$ then $f\left(c\right)$ is a local maximum of $f.$
- If ${f}^{\prime}$ changes sign from negative when $x<c$ to positive when $x>c,$ then $f\left(c\right)$ is a local minimum of $f.$
- If $f\prime $ has the same sign for $x<c$ and $x>c,$ then $f\left(c\right)$ is neither a local maximum nor a local minimum of $f.$

We can summarize the first derivative test as a strategy for locating local extrema.

Consider a function $f$ that is continuous over an interval $I.$

- Find all critical points of $f$ and divide the interval $I$ into smaller intervals using the critical points as endpoints.
- Analyze the sign of $f\prime $ in each of the subintervals. If $f\prime $ is continuous over a given subinterval (which is typically the case), then the sign of $f\prime $ in that subinterval does not change and, therefore, can be determined by choosing an arbitrary test point $x$ in that subinterval and by evaluating the sign of $f\prime $ at that test point. Use the sign analysis to determine whether $f$ is increasing or decreasing over that interval.
- Use First Derivative Test and the results of step $2$ to determine whether $f$ has a local maximum, a local minimum, or neither at each of the critical points.

Now let’s look at how to use this strategy to locate all local extrema for particular functions.

### Example 4.17

#### Using the First Derivative Test to Find Local Extrema

Use the first derivative test to find the location of all local extrema for $f\left(x\right)={x}^{3}-3{x}^{2}-9x-1.$ Use a graphing utility to confirm your results.

Use the first derivative test to locate all local extrema for $f\left(x\right)=\text{\u2212}{x}^{3}+\frac{3}{2}{x}^{2}+18x.$

### Example 4.18

#### Using the First Derivative Test

Use the first derivative test to find the location of all local extrema for $f\left(x\right)=5{x}^{1\text{/}3}-{x}^{5\text{/}3}.$ Use a graphing utility to confirm your results.

Use the first derivative test to find all local extrema for $f\left(x\right)=\sqrt[3]{x-1}.$

### Concavity and Points of Inflection

We now know how to determine where a function is increasing or decreasing. However, there is another issue to consider regarding the shape of the graph of a function. If the graph curves, does it curve upward or curve downward? This notion is called the concavity of the function.

Figure 4.34(a) shows a function $f$ with a graph that curves upward. As $x$ increases, the slope of the tangent line increases. Thus, since the derivative increases as $x$ increases, ${f}^{\prime}$ is an increasing function. We say this function $f$ is concave up. Figure 4.34(b) shows a function $f$ that curves downward. As $x$ increases, the slope of the tangent line decreases. Since the derivative decreases as $x$ increases, ${f}^{\prime}$ is a decreasing function. We say this function $f$ is concave down.

### Definition

Let $f$ be a function that is differentiable over an open interval $I.$ If ${f}^{\prime}$ is increasing over $I,$ we say $f$ is concave up over $I.$ If ${f}^{\prime}$ is decreasing over $I,$ we say $f$ is concave down over $I.$

In general, without having the graph of a function $f,$ how can we determine its concavity? By definition, a function $f$ is concave up if ${f}^{\prime}$ is increasing. From Corollary $3,$ we know that if ${f}^{\prime}$ is a differentiable function, then ${f}^{\prime}$ is increasing if its derivative $f\text{\u2033}\left(x\right)>0.$ Therefore, a function $f$ that is twice differentiable is concave up when $f\text{\u2033}\left(x\right)>0.$ Similarly, a function $f$ is concave down if ${f}^{\prime}$ is decreasing. We know that a differentiable function ${f}^{\prime}$ is decreasing if its derivative $f\text{\u2033}\left(x\right)<0.$ Therefore, a twice-differentiable function $f$ is concave down when $f\text{\u2033}\left(x\right)<0.$ Applying this logic is known as the concavity test.

#### Test for Concavity

Let $f$ be a function that is twice differentiable over an interval $I.$

- If $f\text{\u2033}\left(x\right)>0$ for all $x\in I,$ then $f$ is concave up over $I.$
- If $f\text{\u2033}\left(x\right)<0$ for all $x\in I,$ then $f$ is concave down over $I.$

We conclude that we can determine the concavity of a function $f$ by looking at the second derivative of $f.$ In addition, we observe that a function $f$ can switch concavity (Figure 4.35). However, a continuous function can switch concavity only at a point $x$ if $f\text{\u2033}\left(x\right)=0$ or $f\text{\u2033}\left(x\right)$ is undefined. Consequently, to determine the intervals where a function $f$ is concave up and concave down, we look for those values of $x$ where $f\text{\u2033}\left(x\right)=0$ or $f\text{\u2033}\left(x\right)$ is undefined. When we have determined these points, we divide the domain of $f$ into smaller intervals and determine the sign of $f\text{\u2033}$ over each of these smaller intervals. If $f\text{\u2033}$ changes sign as we pass through a point $x,$ then $f$ changes concavity. It is important to remember that a function $f$ may not change concavity at a point $x$ even if $f\text{\u2033}\left(x\right)=0$ or $f\text{\u2033}\left(x\right)$ is undefined. If, however, $f$ does change concavity at a point $a$ and $f$ is continuous at $a,$ we say the point $\left(a,f\left(a\right)\right)$ is an inflection point of $f.$

### Definition

If $f$ is continuous at $a$ and $f$ changes concavity at $a,$ the point $\left(a,f\left(a\right)\right)$ is an inflection point of $f.$

### Example 4.19

#### Testing for Concavity

For the function $f\left(x\right)={x}^{3}-6{x}^{2}+9x+30,$ determine all intervals where $f$ is concave up and all intervals where $f$ is concave down. List all inflection points for $f.$ Use a graphing utility to confirm your results.

For $f\left(x\right)=\text{\u2212}{x}^{3}+\frac{3}{2}{x}^{2}+18x,$ find all intervals where $f$ is concave up and all intervals where $f$ is concave down.

We now summarize, in Table 4.1, the information that the first and second derivatives of a function $f$ provide about the graph of $f,$ and illustrate this information in Figure 4.37.

Sign of $f\prime $ | Sign of $f\text{\u2033}$ | Is $f$ increasing or decreasing? | Concavity |
---|---|---|---|

Positive | Positive | Increasing | Concave up |

Positive | Negative | Increasing | Concave down |

Negative | Positive | Decreasing | Concave up |

Negative | Negative | Decreasing | Concave down |

### The Second Derivative Test

The first derivative test provides an analytical tool for finding local extrema, but the second derivative can also be used to locate extreme values. Using the second derivative can sometimes be a simpler method than using the first derivative.

We know that if a continuous function has local extrema, it must occur at a critical point. However, a function need not have local extrema at a critical point. Here we examine how the second derivative test can be used to determine whether a function has a local extremum at a critical point. Let $f$ be a twice-differentiable function such that ${f}^{\prime}\left(a\right)=0$ and $f\text{\u2033}$ is continuous over an open interval $I$ containing $a.$ Suppose $f\text{\u2033}\left(a\right)<0.$ Since $f\text{\u2033}$ is continuous over $I,$ $f\text{\u2033}\left(x\right)<0$ for all $x\in I$ (Figure 4.38). Then, by Corollary $3,$ ${f}^{\prime}$ is a decreasing function over $I.$ Since ${f}^{\prime}\left(a\right)=0,$ we conclude that for all $x\in I,{f}^{\prime}\left(x\right)>0$ if $x<a$ and ${f}^{\prime}\left(x\right)<0$ if $x>a.$ Therefore, by the first derivative test, $f$ has a local maximum at $x=a.$ On the other hand, suppose there exists a point $b$ such that ${f}^{\prime}\left(b\right)=0$ but $f\text{\u2033}\left(b\right)>0.$ Since $f\text{\u2033}$ is continuous over an open interval $I$ containing $b,$ then $f\text{\u2033}\left(x\right)>0$ for all $x\in I$ (Figure 4.38). Then, by Corollary $3,{f}^{\prime}$ is an increasing function over $I.$ Since ${f}^{\prime}\left(b\right)=0,$ we conclude that for all $x\in I,$ ${f}^{\prime}\left(x\right)<0$ if $x<b$ and ${f}^{\prime}\left(x\right)>0$ if $x>b.$ Therefore, by the first derivative test, $f$ has a local minimum at $x=b.$

#### Second Derivative Test

Suppose ${f}^{\prime}\left(c\right)=0,f\text{\u2033}$ is continuous over an interval containing $c.$

- If $f\text{\u2033}\left(c\right)>0,$ then $f$ has a local minimum at $c.$
- If $f\text{\u2033}\left(c\right)<0,$ then $f$ has a local maximum at $c.$
- If $f\text{\u2033}\left(c\right)=0,$ then the test is inconclusive.

Note that for case iii. when $f\text{\u2033}\left(c\right)=0,$ then $f$ may have a local maximum, local minimum, or neither at $c.$ For example, the functions $f\left(x\right)={x}^{3},$ $f\left(x\right)={x}^{4},$ and $f\left(x\right)=\text{\u2212}{x}^{4}$ all have critical points at $x=0.$ In each case, the second derivative is zero at $x=0.$ However, the function $f\left(x\right)={x}^{4}$ has a local minimum at $x=0$ whereas the function $f\left(x\right)=\text{\u2212}{x}^{4}$ has a local maximum at $x,$ and the function $f\left(x\right)={x}^{3}$ does not have a local extremum at $x=0.$

Let’s now look at how to use the second derivative test to determine whether $f$ has a local maximum or local minimum at a critical point $c$ where ${f}^{\prime}\left(c\right)=0.$

### Example 4.20

#### Using the Second Derivative Test

Use the second derivative to find the location of all local extrema for $f\left(x\right)={x}^{5}-5{x}^{3}.$

Consider the function $f\left(x\right)={x}^{3}-\left(\frac{3}{2}\right){x}^{2}-18x.$ The points $c=3,\mathrm{-2}$ satisfy ${f}^{\prime}\left(c\right)=0.$ Use the second derivative test to determine whether $f$ has a local maximum or local minimum at those points.

We have now developed the tools we need to determine where a function is increasing and decreasing, as well as acquired an understanding of the basic shape of the graph. In the next section we discuss what happens to a function as $x\to \text{\xb1}\infty .$ At that point, we have enough tools to provide accurate graphs of a large variety of functions.

### Section 4.5 Exercises

If $c$ is a critical point of $f\left(x\right),$ when is there no local maximum or minimum at $c?$ Explain.

For the function $y={x}^{3},$ is $x=0$ an inflection point?

Is it possible for a point $c$ to be both an inflection point and a local extremum of a twice differentiable function?

Why do you need continuity for the first derivative test? Come up with an example.

Explain whether a polynomial of degree $2$ can have an inflection point.

For the following exercises, analyze the graphs of ${f}^{\prime},$ then list all intervals where $f$ is increasing or decreasing.

For the following exercises, analyze the graphs of ${f}^{\prime},$ then list all intervals where

- $f$ is increasing and decreasing and
- the minima and maxima are located.

For the following exercises, analyze the graphs of ${f}^{\prime},$ then list all inflection points and intervals $f$ that are concave up and concave down.

For the following exercises, draw a graph that satisfies the given specifications for the domain $x=[\mathrm{-3},3].$ The function does not have to be continuous or differentiable.

$f\left(x\right)>0,{f}^{\prime}\left(x\right)>0$ over $x>1,\mathrm{-3}<x<0,{f}^{\prime}\left(x\right)=0$ over $0<x<1$

${f}^{\prime}\left(x\right)>0$ over $x>2,\mathrm{-3}<x<\mathrm{-1},{f}^{\prime}\left(x\right)<0$ over $\mathrm{-1}<x<2,f\text{\u2033}\left(x\right)<0$ for all $x$

$f\text{\u2033}\left(x\right)<0$ over $\mathrm{-1}<x<1,f\text{\u2033}\left(x\right)>0,\mathrm{-3}<x<\mathrm{-1},1<x<3,$ local maximum at $x=0,$ local minima at $x=\text{\xb1}2$

There is a local maximum at $x=2,$ local minimum at $x=1,$ and the graph is neither concave up nor concave down.

There are local maxima at $x=\text{\xb1}1,$ the function is concave up for all $x,$ and the function remains positive for all $x.$

For the following exercises, determine

- intervals where $f$ is increasing or decreasing and
- local minima and maxima of $f.$

$f\left(x\right)=\text{sin}\phantom{\rule{0.1em}{0ex}}x+{\text{sin}}^{3}x$ over $\text{\u2212}\pi <x<\pi $

$f\left(x\right)={x}^{2}+\text{cos}\phantom{\rule{0.1em}{0ex}}x$

For the following exercises, determine a. intervals where $f$ is concave up or concave down, and b. the inflection points of $f.$

For the following exercises, determine

- intervals where $f$ is increasing or decreasing,
- local minima and maxima of $f,$
- intervals where $f$ is concave up and concave down, and
- the inflection points of $f.$

$f\left(x\right)={x}^{2}-6x$

$f\left(x\right)={x}^{4}-6{x}^{3}$

$f\left(x\right)=x+{x}^{2}-{x}^{3}$

$f\left(x\right)={x}^{3}+{x}^{4}$

For the following exercises, determine

- intervals where $f$ is increasing or decreasing,
- local minima and maxima of $f,$
- intervals where $f$ is concave up and concave down, and
- the inflection points of $f.$ Sketch the curve, then use a calculator to compare your answer. If you cannot determine the exact answer analytically, use a calculator.

**[T]** $f\left(x\right)=\text{sin}\left(\pi x\right)-\text{cos}\left(\pi x\right)$ over $x=\left[\mathrm{-1},1\right]$

**[T]** $f\left(x\right)=x+\text{sin}\left(2x\right)$ over $x=\left[-\frac{\pi}{2},\frac{\pi}{2}\right]$

**[T]** $f\left(x\right)=\text{sin}\phantom{\rule{0.1em}{0ex}}x+\text{tan}\phantom{\rule{0.1em}{0ex}}x$ over $\left(-\frac{\pi}{2},\frac{\pi}{2}\right)$

**[T]** $f\left(x\right)={\left(x-2\right)}^{2}{\left(x-4\right)}^{2}$

**[T]** $f\left(x\right)=\frac{\text{sin}\phantom{\rule{0.1em}{0ex}}x}{x}$ over $x=$ $[2\pi ,0)\cup (0,2\pi ]$

$f\left(x\right)=\text{ln}\phantom{\rule{0.1em}{0ex}}x\sqrt{x},x>0$

$f\left(x\right)=\frac{{e}^{x}}{x},x\ne 0$

For the following exercises, interpret the sentences in terms of $f,{f}^{\prime},\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}f\text{\u2033}.$

A bike accelerates faster, but a car goes faster. Here $f=$ Bike’s position minus Car’s position.

Stock prices are at their peak. Here $f$ is the stock price.

For the following exercises, consider a third-degree polynomial $f\left(x\right),$ which has the properties ${f}^{\prime}\left(1\right)=0,{f}^{\prime}\left(3\right)=0.$ Determine whether the following statements are *true or false*. Justify your answer.

$f\left(x\right)=0$ for some $1\le x\le 3$

There is no absolute maximum at $x=3$

If $f\left(x\right)$ has one inflection point, then it has three real roots.