Derivatives and Graphs

In the previous section, we learned that critical numbers are the ONLY candidates for the places at which a function may have relative extrema. How do we find the relative maximum and minimum in a function? We can use the first derivative test to examine whether critical points are relative extrema or not. In order to start our discussion on the first derivative test, we need to know the following rules:

  1. If f ( x ) > 0 for all x on an interval, then f is increasing on the interval.

  2. If f ( x ) < 0 for all x on an interval, then f is decreasing on the interval.

Let’s look at some examples. Consider the following function:

f ( x ) = x 3 3 x 2 24 x + 5

First, take the first derivative with respect with x:

f ( x ) = 3 x 2 6 x 24 = 3 ( x 2 2 x 8 ) = 3 ( x 4 ) ( x + 2 )

This means that f ( x ) = 0 when x = 2 , 4 . When x is not -2 or 4, f ( x ) is always either positive or negative before -2, between -2 and 4, and after 4. We can pick a number within each interval, let’s say -3, 0, and 5, and then calculate the values of f ( x ) for those numbers to test the behavior of the function.

f ( x = 3 ) = 21 f ( x = 0 ) = 24 f ( x = 5 ) = 21

This means that f ( x ) > 0 when x < 2 or x > 4 , and f ( x ) < 0 when 2 < x < 4 . This means that f ( x ) is increasing when x < 2 or x > 4 , and f ( x ) is decreasing when 2 < x < 4 .

Now let’s find f ( x ) when x = 2 and x = 4 .

f ( x = 2 ) = 33 f ( x = 4 ) = 75

We can summarize this result in a table as follows:

x ... -2 ... 4 ...
f ( x ) + 0 - 0 +
f ( x ) 33 -75

This result suggests that when x = 2 , the graph of the function has a peak value of 33, and when x = 4 , the graph of the function has a valley or bottom value of -75, which are the local maximum and local minimum, respectively. Given this, we can state the first derivative test.

Let c be a critical number of a continuous function f.

  1. If f changes from positive to negative at c, then f has a local maximum at c.

  2. If f changes from negative to positive at c, then f has a local minimum at c.

  3. If f does not change sign at c (from positive to negative or from negative to positive as shown above), then f has no local maximum or local minimum at c.

Now we know when the function is increasing and decreasing and where the critical points and relative extrema are. However, if we plot the function, we know that is not a straight line but rather a curve. In order to understand not only the critical points and the relative extrema but also the curvature of the graph, we need to learn the second derivative test. Before we discuss the second derivative test, let’s define concavity and convexity of a function.

A function f is convex on an interval (ab) if the graph of f lies above all of its tangents on an interval (ab). Similarly, a function f is concave on an interval (ab) if the graph of f lies below all of its tangents on an interval (ab).

Figure 6.5: Convex and Concave

Finally, another definition that we should know is inflection point. A point a on a curve f is called an inflection point if f is continuous and the curve changes from convex to concave or from concave to convex (see the graph below).

Figure 6.6: Inflection Point

In order to understand the curve of a graph mathematically, whether it is concave or convex, we can use the second derivative. Let’s go back to our previous example. We have the function and the first derivative of the function as follows:

f ( x ) = x 3 3 x 2 24 x + 5 f ( x ) = 3 x 2 6 x 24

Therefore, the second derivative of the function is

f ( x ) = 6 x 6 = 6 ( x 1 )

So we know that f ( x ) is 0 when x = 1 . Let’s plot the graph and see how this second derivative helps us understand the concavity and convexity of the graph.

Figure 6.7: Second Derivative

First, let’s look at the graph when x = 1 . Even though it is hard to identify with our eyes, it is an inflection point of this function, which means that it changes from concave to convex at x = 1 . When x < 1 , the graph looks concave, and when x > 1 , the graph looks convex. Given this result, we can say two things. When x < 1 , f < 0 (i.e., f ( 0 ) = 6 ). When x > 1 , f > 0 (i.e., f ( 2 ) = 6 ). Given this result, we can define the concavity test.

The concavity test states that if f > 0 for all x on the interval (ab), then the graph of f is concave on the interval. Similarly, if f < 0 for all x on the interval (ab), then the graph of f is convex on the interval.

The table below summarizes increasing versus decreasing (fourth row) and concave versus convex (fifth row).

Table 6.1
x ... -2 ... 1 ... 4 ...
f ( x ) + 0 - - - 0 +
f ( x ) - - - 0 + + +
f ( x ) 33 -21 -75
f ( x )
33
-21
-75

Combining the fourth and the fifth rows, we can make a nice summary of the graph in the table below.

Table 6.2
x ... -2 ... 1 ... 4 ...
f ( x ) + 0 - - - 0 +
f ( x ) - - - 0 + + +
f ( x )
33
-21
-75

With the first and second derivatives (as shown in the table above), we can state the second derivative test. Suppose f is continuous near a. The function f has a relative maximum at a if f = 0 and f < 0 . Similarly, f has a relative minimum at a if f = 0 and f > 0 . As the second derivative test tells us, we have the relative (local) maximum at x = 2 since f ( 2 ) = 0 and f ( 2 ) < 0 , and we have the relative (local) minimum at x = 4 since f ( 4 ) = 0 and f ( 4 ) > 0 .

Example

Let’s analyze and graph the following function:

f ( x ) = 1 3 x 3 + 3 2 x 2 4 x 4

The first derivative of the function f ( x ) is:

f ( x ) = x 2 + 3 x 4 = ( x + 4 ) ( x 1 )

Thus, f ( x ) = 0 when x = 4 , 1 . When x < 4 , f ( x ) > 0 . When 4 < x < 1 , f ( x ) < 0 . When x > 1 , f ( x ) > 0 . This tells us that f ( x ) is increasing when x < 4 and x > 1 . f ( x ) is decreasing when 4 < x < 1 .

Now the second derivative is

f ( x ) = 2 x + 3

Thus, f ( x ) = 0 when x = 3 2 . f ( x ) < 0 when x < 3 2 , and f ( x ) > 0 when x > 3 2 . This means that f ( x ) is shaped concave when x > 3 2 , and f ( x ) is shaped convex when x < 3 2 . We can put these results in a table as:

Table 6.3
x ... -4 ... 32 ... 1 ...
f ( x ) + 0 - - - 0 +
f ( x ) - - - 0 + + +
f ( x )
443
5112
-376

Also, for convenience, when x = 0 , f ( x ) = 4 . Given this information, we can draw a graph as follows.

Figure 6.8: Graph of f ( x ) = 1 3 x 3 + 3 2 x 2 4 x 4