Loading [MathJax]/jax/element/mml/optable/BasicLatin.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

4.3: Graphing Functions

( \newcommand{\kernel}{\mathrm{null}\,}\)

Learning Objectives

  • Explain how the sign of the first derivative affects the shape of a function’s graph.
  • State the first derivative test for critical points.
  • Use concavity and inflection points to explain how the sign of the second derivative affects the shape of a function’s graph.
  • Explain the concavity test for a function over an open interval.
  • Explain the relationship between a function and its first and second derivatives.
  • 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)=x3 has a critical point at x=0 since f(x)=3x2 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.

This figure is broken into four figures labeled a, b, c, and d. Figure a shows a function increasing convexly from (a, f(a)) to (b, f(b)). At two points the derivative is taken and it is noted that at both f’ > 0. In other words, f is increasing. Figure b shows a function increasing concavely from (a, f(a)) to (b, f(b)). At two points the derivative is taken and it is noted that at both f’ > 0. In other words, f is increasing. Figure c shows a function decreasing concavely from (a, f(a)) to (b, f(b)). At two points the derivative is taken and it is noted that at both f’ < 0. In other words, f is decreasing. Figure d shows a function decreasing convexly from (a, f(a)) to (b, f(b)). At two points the derivative is taken and it is noted that at both f’ < 0. In other words, f is decreasing.
Figure 4.3.1: Both functions are increasing over the interval (a,b). At each point x, the derivative f(x)>0. Both functions are decreasing over the interval (a,b). At each point x, the derivative f(x)<0.

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 changes sign as x increases through c. If f is differentiable at c, the only way that f. can change sign as x increases through c is if f(c)=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(c)=0 or f(c) is undefined. Consequently, to locate local extrema for a function f, we look for points c in the domain of f such that f(c)=0 or f(c) is undefined. Recall that such points are called critical points of f.

Note that f need not have a local extrema at a critical point. The critical points are candidates for local extrema only. In Figure 4.3.2, 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 switches as x increases through that point.

A function f(x) is graphed. It starts in the second quadrant and increases to x = a, which is too sharp and hence f’(a) is undefined. In this section f’ > 0. Then, f decreases from x = a to x = b (so f’ < 0 here), before increasing at x = b. It is noted that f’(b) = 0. While increasing from x = b to x = c, f’ > 0. The function has an inversion point at c, and it is marked f’(c) = 0. The function increases some more to d (so f’ > 0), which is the global maximum. It is marked that f’(d) = 0. Then the function decreases and it is marked that f’ > 0.
Figure 4.3.2: The function f has four critical points: a,b,c,and d. The function f has local maxima at a and d, and a local minimum at b. The function f does not have a local extremum at c. The sign of f changes at all local extrema.

Using Figure 4.3.2, 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 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(x) 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(c) satisfies one of the following descriptions:

  1. If f changes sign from positive when x<c to negative when x>c, then f(c) is a local maximum of f.
  2. If f changes sign from negative when x<c to positive when x>c, then f(c) is a local minimum of f.
  3. If f has the same sign for x<c and x>c, then f(c) is neither a local maximum nor a local minimum of f

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

Example 4.3.1: Using the First Derivative Test to Find Local Extrema

Use the first derivative test to find the location of all local extrema for f(x)=x33x29x1. Use a graphing utility to confirm your results.

Solution

Step 1. The derivative is f(x)=3x26x9. To find the critical points, we need to find where f(x)=0. Factoring the polynomial, we conclude that the critical points must satisfy

3(x22x3)=3(x3)(x+1)=0.

Therefore, the critical points are x=3,1. Now divide the interval (,) into the smaller intervals (,1),(1,3) and (3,).

Step 2. Since f is a continuous function, to determine the sign of f(x) over each subinterval, it suffices to choose a point over each of the intervals (,1),(1,3) and (3,) and determine the sign of f at each of these points. For example, let’s choose x=2, x=0, and x=4 as test points.

Table: 4.3.1: First Derivative Test for f(x)=x33x29x1.
Interval Test Point Sign of f(x)=3(x3)(x+1) at Test Point Conclusion
(,1) x=2 (+)(−)(−)=+ f is increasing.
(1,3) x=0 (+)(−)(+)=+ f is increasing.
(3,) x=4 (+)(+)(+)=+ f is increasing.

Step 3. Since f switches sign from positive to negative as x increases through 1, f has a local maximum at x=1. Since f switches sign from negative to positive as x increases through 3, f has a local minimum at x=3. These analytical results agree with the following graph.

The function f(x) = x3 – 3x2 – 9x – 1 is graphed. It has a maximum at x = −1 and a minimum at x = 3. The function is increasing before x = −1, decreasing until x = 3, and then increasing after that.
Figure 4.3.3: The function f has a maximum at x=1 and a minimum at x=3

Exercise 4.3.1

Use the first derivative test to locate all local extrema for f(x)=x3+32x2+18x.

Hint

Find all critical points of f and determine the signs of f(x) over particular intervals determined by the critical points.

Answer

f has a local minimum at 2 and a local maximum at 3.

Example 4.3.2: Using the First Derivative Test

Use the first derivative test to find the location of all local extrema for f(x)=5x1/3x5/3. Use a graphing utility to confirm your results.

Solution

Step 1. The derivative is

f(x)=53x2/353x2/3=53x2/35x2/33=55x4/33x2/3=5(1x4/3)3x2/3.

The derivative f(x)=0 when 1x4/3=0. Therefore, f(x)=0 at x=±1. The derivative f(x) is undefined at x=0. Therefore, we have three critical points: x=0, x=1, and x=1. Consequently, divide the interval (,) into the smaller intervals (,1),(1,0),(0,1), and (1,).

Step 2: Since f is continuous over each subinterval, it suffices to choose a test point x in each of the intervals from step 1 and determine the sign of f at each of these points. The points x=2,x=12,x=12, and x=2 are test points for these intervals.

Table: 4.3.2: First Derivative Test for f(x)=5x1/3x5/3.
Interval Test Point Sign of f(x)=5(1x4/3)3x2/3 at Test Point Conclusion
(,1) x=2 (+)()+= f is decreasing.
(1,0) x=12 (+)(+)+=+ f is increasing.
(0,1) x=12 (+)(+)+=+ f is increasing.
(1,) x=2 (+)()+= f is decreasing.

Step 3: Since f is decreasing over the interval (,1) and increasing over the interval (1,0), f has a local minimum at x=1. Since f is increasing over the interval (1,0) and the interval (0,1), f does not have a local extremum at x=0. Since f is increasing over the interval (0,1) and decreasing over the interval (1,), f has a local maximum at x=1. The analytical results agree with the following graph.

The function f(x) = 5x1/3 – x5/3 is graphed. It decreases to its local minimum at x = −1, increases to x = 1, and then decreases after that.
Figure 4.3.4: The function f has a local minimum at x=1 and a local maximum at x=1

Exercise 4.3.2

Use the first derivative test to find all local extrema for (x)=3x1.

Hint

The only critical point of f is x=1.

Answer

f has no local extrema because f does not change sign at 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.3.4a 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 is an increasing function. We say this function f is concave up. Figure 4.3.4b 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 is a decreasing function. We say this function f is concave down.

Definition: concavity test

Let f be a function that is differentiable over an open interval I. If f is increasing over I, we say f is concave up over I. If f is decreasing over I, we say f is concave down over I.

This figure is broken into four figures labeled a, b, c, and d. Figure a shows a function increasing convexly from (a, f(a)) to (b, f(b)). At two points the derivative is taken and both are increasing, but the one taken further to the right is increasing more. It is noted that f’ is increasing and f is concave up. Figure b shows a function increasing concavely from (a, f(a)) to (b, f(b)). At two points the derivative is taken and both are increasing, but the one taken further to the right is increasing less. It is noted that f’ is decreasing and f is concave down. Figure c shows a function decreasing concavely from (a, f(a)) to (b, f(b)). At two points the derivative is taken and both are decreasing, but the one taken further to the right is decreasing less. It is noted that f’ is increasing and f is concave up. Figure d shows a function decreasing convexly from (a, f(a)) to (b, f(b)). At two points the derivative is taken and both are decreasing, but the one taken further to the right is decreasing more. It is noted that f’ is decreasing and f is concave down.
Figure 4.3.5: (a), (c) Since f is increasing over the interval (a,b), we say f is concave up over (a,b).(b),(d) Since f is decreasing over the interval (a,b), we say f is concave down over (a,b).

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 is increasing. From Corollary 3, we know that if f is a differentiable function, then f is increasing if its derivative f(x)>0. Therefore, a function f that is twice differentiable is concave up when f(x)>0. Similarly, a function f is concave down if f is decreasing. We know that a differentiable function f is decreasing if its derivative f(x)<0. Therefore, a twice-differentiable function f is concave down when f(x)<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.

  1. If f(x)>0 for all xI, then f is concave up over I
  2. If f(x)<0 for all xI, 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.3.6). However, a continuous function can switch concavity only at a point x if f(x)=0 or f(x) 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(x)=0 or f(x) is undefined. When we have determined these points, we divide the domain of f into smaller intervals and determine the sign of f over each of these smaller intervals. If f 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(x)=0 or f(x) is undefined. If, however, f does change concavity at a point a and f is continuous at a, we say the point (a,f(a)) is an inflection point of f.

Definition: inflection point

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

A sinusoidal function is shown that has been shifted into the first quadrant. The function starts decreasing, so f’ < 0 and f’’ > 0. The function reaches the local minimum and starts increasing, so f’ > 0 and f’’ > 0. It is noted that the slope is increasing for these two intervals. The function then reaches an inflection point (a, f(a)) and from here the slop is decreasing even though the function continues to increase, so f’ > 0 and f’’ < 0. The function reaches the maximum and then starts decreasing, so f’ < 0 and f’’ < 0.
Figure 4.3.6: Since f(x)>0 for x<a, the function f is concave up over the interval (,a). Since f(x)<0 for x>a, the function f is concave down over the interval (a,). The point (a,f(a)) is an inflection point of f.

Example 4.3.3: Testing for Concavity

For the function f(x)=x36x2+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.

Solution

To determine concavity, we need to find the second derivative f(x). The first derivative is f(x)=3x212x+9, so the second derivative is f(x)=6x12. If the function changes concavity, it occurs either when f(x)=0 or f(x) is undefined. Since f is defined for all real numbers x, we need only find where f(x)=0. Solving the equation 6x12=0, we see that x=2 is the only place where f could change concavity. We now test points over the intervals (,2) and (2,) to determine the concavity of f. The points x=0 and x=3 are test points for these intervals.

Table: 4.3.3: Test for Concavity for f(x)=x36x2+9x+30.
Interval Test Point Sign of f(x)=6x12 at Test Point Conclusion
(,2) x=0 f is concave down
(2,) x=3 + f is concave up

We conclude that f is concave down over the interval (,2) and concave up over the interval (2,). Since f changes concavity at x=2, the point (2,f(2))=(2,32) is an inflection point. Figure 4.3.7 confirms the analytical results.

The function f(x) = x3 – 6x2 + 9x + 30 is graphed. The inflection point (2, 32) is marked, and it is roughly equidistant from the two local extrema.
Figure 4.3.7: The given function has a point of inflection at (2,32) where the graph changes concavity.

Exercise 4.3.3

For f(x)=x3+32x2+18x, find all intervals where f is concave up and all intervals where f is concave down.

Hint

Find where f(x)=0

Answer

f is concave up over the interval (,12) and concave down over the interval (12,)

We now summarize, in Table 4.3.4, 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.3.8.

Table: 4.3.4: What Derivatives Tell Us about Graphs
Sign of f Sign of f 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
A function is graphed in the first quadrant. It is broken up into four sections, with the breaks coming at the local minimum, inflection point, and local maximum, respectively. The first section is decreasing and concave up; here, f’ < 0 and f’’ > 0. The second section is increasing and concave up; here, f’ > 0 and f’’ > 0. The third section is increasing and concave down; here, f’ > 0 and f’’ < 0. The fourth section is increasing and concave down; here, f’ < 0 and f’’ < 0.
Figure 4.3.8:Consider a twice-differentiable I over an open interval I. If f(x)>0 for all xI, the function is increasing over I. If f(x)<0 for all xI, the function is decreasing over I. If f(x)>0 for all xI, the function is concave up. If f(x)<0 for all xI, the function is concave down on I.

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 a local extremum, it must occur at a critical point. However, a function need not have a local extremum 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(a)=0 and f is continuous over an open interval I containing a. Suppose f(a)<0. Since f is continuous over I,f(x)<0 for all xI (Figure 4.3.9). Then, by Corollary 3, f is a decreasing function over I. Since f(a)=0, we conclude that for all xI,f(x)>0 if x<a and f(x)<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(b)=0 but f(b)>0. Since f is continuous over an open interval I containing b, then f(x)>0 for all xI (Figure 4.3.9). Then, by Corollary 3, f is an increasing function over I. Since f(b)=0, we conclude that for all xI, f(x)<0 if x<b and f(x)>0 if x>b. Therefore, by the first derivative test, f has a local minimum at x=b.

A function f(x) is graphed in the first quadrant with a and b marked on the x-axis. The function is vaguely sinusoidal, increasing first to x = a, then decreasing to x = b, and increasing again. At (a, f(a)), the tangent is marked, and it is noted that f’(a) = 0 and f’’(a) < 0. At (b, f(b)), the tangent is marked, and it is noted f’(b) = 0 and f’’(b) > 0.
Figure 4.3.9: Consider a twice-differentiable function f such that f is continuous. Since f(a)=0 and f(a)<0, there is an interval I containing a such that for all x in I, f is increasing if x<a and f is decreasing if x>a. As a result, f has a local maximum at x=a. Since f(b)=0 and f(b)>0, there is an interval I containing b such that for all x in I, f is decreasing if x<b and f is increasing if x>b. As a result, f has a local minimum at x=b.

Second Derivative Test

Suppose f(c)=0 and f is continuous over an interval containing c.

  1. If f(c)>0, then f has a local minimum at c.
  2. If f(c)<0, then f has a local maximum at c.
  3. If f(c)=0, then the test is inconclusive.

Note that for case iii. when f(c)=0, then f may have a local maximum, local minimum, or neither at c. For example, the functions f(x)=x3,f(x)=x4, and f(x)=x4 all have critical points at x=0. In each case, the second derivative is zero at x=0. However, the function f(x)=x4 has a local minimum at x=0 whereas the function f(x)=x4 has a local maximum at x, and the function f(x)=x3 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(c)=0.

Example 4.3.4: Using the Second Derivative Test

Use the second derivative to find the location of all local extrema for f(x)=x55x3.

Solution

To apply the second derivative test, we first need to find critical points c where f(c)=0. The derivative is f(x)=5x415x2. Therefore, f(x)=5x415x2=5x2(x23)=0 when x=0,±3.

To determine whether f has a local extremum at any of these points, we need to evaluate the sign of f at these points. The second derivative is

f(x)=20x330x=10x(2x23).

In the following table, we evaluate the second derivative at each of the critical points and use the second derivative test to determine whether f has a local maximum or local minimum at any of these points.

Table: 4.3.5: Second Derivative Test for f(x)=x55x3.
x f(x) Conclusion
3 303 Local maximum
0 0 Second derivative test is inconclusive
3 303 Local minimum

By the second derivative test, we conclude that f has a local maximum at x=3 and f has a local minimum at x=3. The second derivative test is inconclusive at x=0. To determine whether f has a local extrema at x=0, we apply the first derivative test. To evaluate the sign of f(x)=5x2(x23) for x(3,0) and x(0,3), let x=1 and x=1 be the two test points. Since f(1)<0 and f(1)<0, we conclude that f is decreasing on both intervals and, therefore, f does not have a local extrema at x=0 as shown in the following graph.

The function f(x) = x5 – 5x3 is graphed. The function increases to (negative square root of 3, 10), then decreases to an inflection point at 0, continues decreasing to (square root of 3, −10), and then increases.
Figure 4.3.10:The function f has a local maximum at x=3 and a local minimum at x=3

Exercise 4.3.4

Consider the function f(x)=x3(32)x218x. The points c=3,2 satisfy f(c)=0. Use the second derivative test to determine whether f has a local maximum or local minimum at those points.

Hint

f(x)=6x3

Answer

f has a local maximum at 2 and a local minimum at 3.

Now that we have 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, we can provide accurate graphs of a large variety of functions.

Guidelines for Drawing the Graph of a Function

We now have enough analytical tools to draw graphs of a wide variety of algebraic and transcendental functions. Before showing how to graph specific functions, let’s look at a general strategy to use when graphing any function.

Problem-Solving Strategy: Drawing the Graph of a Function

Given a function f, use the following steps to sketch a graph of f:

  1. Determine the domain of the function.
  2. Locate the x- and y-intercepts.
  3. Evaluate lim and \displaystyle \lim_{x→−∞}f(x) to determine the end behavior. If either of these limits is a finite number L, then y=L is a horizontal asymptote. If either of these limits is or −∞, determine whether f has an oblique asymptote. If is a rational function such that f(x)=\dfrac{p(x)}{q(x)}, where the degree of the numerator is greater than the degree of the denominator, then f can be written as f(x)=\frac{p(x)}{q(x)}=g(x)+\frac{r(x)}{q(x),} where the degree of r(x) is less than the degree of q(x). The values of f(x) approach the values of g(x) as x→±∞. If g(x) is a linear function, it is known as an oblique asymptote.
  4. Determine whether f has any vertical asymptotes.
  5. Calculate f′. Find all critical points and determine the intervals where f is increasing and where f is decreasing. Determine whether f has any local extrema.
  6. Calculate f''. Determine the intervals where f is concave up and where f is concave down. Use this information to determine whether f has any inflection points. The second derivative can also be used as an alternate means to determine or verify that f has a local extremum at a critical point.

Now let’s use this strategy to graph several different functions. We start by graphing a polynomial function.

Example \PageIndex{8}: Sketching a Graph of a Polynomial

Sketch a graph of f(x)=(x−1)^2(x+2).

Solution

Step 1: Since f is a polynomial, the domain is the set of all real numbers.

Step 2: When x=0,\; f(x)=2. Therefore, the y-intercept is (0,2). To find the x-intercepts, we need to solve the equation (x−1)^2(x+2)=0, gives us the x-intercepts (1,0) and (−2,0)

Step 3: We need to evaluate the end behavior of f. As x→∞, \;(x−1)^2→∞ and (x+2)→∞. Therefore, \displaystyle \lim_{x→∞}f(x)=∞.

As x→−∞, \;(x−1)^2→∞ and (x+2)→−∞. Therefore, \displaystyle \lim_{x→∞}f(x)=−∞.

To get even more information about the end behavior of f, we can multiply the factors of f. When doing so, we see that

f(x)=(x−1)^2(x+2)=x^3−3x+2. \nonumber

Since the leading term of f is x^3, we conclude that f behaves like y=x^3 as x→±∞.

Step 4: Since f is a polynomial function, it does not have any vertical asymptotes.

Step 5: The first derivative of f is

f′(x)=3x^2−3. \nonumber

Therefore, f has two critical points: x=1,−1. Divide the interval (−∞,∞) into the three smaller intervals: (−∞,−1), \;(−1,1), and (1,∞). Then, choose test points x=−2, x=0, and x=2 from these intervals and evaluate the sign of f′(x) at each of these test points, as shown in the following table.

Interval Test point Sign of Derivative f'(x)=3x^2−3=3(x−1)(x+1) Conclusion
(−∞,−1) x=−2 (+)(−)(−)=+ f is increasing
(−1,1) x=0 (+)(−)(+)=− f decreasing
(1,∞) x=2 (+)(+)(+)=+ f is increasing

From the table, we see that f has a local maximum at x=−1 and a local minimum at x=1. Evaluating f(x) at those two points, we find that the local maximum value is f(−1)=4 and the local minimum value is f(1)=0.

Step 6: The second derivative of f is

f''(x)=6x. \nonumber

The second derivative is zero at x=0. Therefore, to determine the concavity of f, divide the interval (−∞,∞) into the smaller intervals (−∞,0) and (0,∞), and choose test points x=−1 and x=1 to determine the concavity of f on each of these smaller intervals as shown in the following table.

Interval Test Point Sign of ''(x)=6x Conclusion
(−∞,0) x=−1 f is concave down..
(0,∞) x=1 + f is concave up.

We note that the information in the preceding table confirms the fact, found in step 5, that f has a local maximum at x=−1 and a local minimum at x=1. In addition, the information found in step 5—namely, f has a local maximum at x=−1 and a local minimum at x=1, and f′(x)=0 at those points—combined with the fact that f'' changes sign only at x=0 confirms the results found in step 6 on the concavity of f.

Combining this information, we arrive at the graph of f(x)=(x−1)^2(x+2) shown in the following graph.

The function f(x) = (x −1)2 (x + 2) is graphed. It crosses the x axis at x = −2 and touches the x axis at x = 1.

Exercise \PageIndex{8}

Sketch a graph of f(x)=(x−1)^3(x+2).

Hint

f is a fourth-degree polynomial.

Answer

The function f(x) = (x −1)3(x + 2) is graphed.

Example \PageIndex{9}: Sketching a Rational Function

Sketch the graph of f(x)=\dfrac{x^2}{1−x^2}.

Solution

Step 1: The function f is defined as long as the denominator is not zero. Therefore, the domain is the set of all real numbers x except x=±1.

Step 2: Find the intercepts. If x=0, then f(x)=0, so 0 is an intercept. If y=0, then \dfrac{x^2}{1−x^2}=0, which implies x=0. Therefore, (0,0) is the only intercept.

Step 3: Evaluate the limits at infinity. Since fis a rational function, divide the numerator and denominator by the highest power in the denominator: x^2.We obtain

\displaystyle \lim_{x→±∞}\frac{x^2}{1−x^2}=\lim_{x→±∞}\frac{1}{\frac{1}{x^2}−1}=−1.

Therefore, f has a horizontal asymptote of y=−1 as x→∞ and x→−∞.

Step 4: To determine whether f has any vertical asymptotes, first check to see whether the denominator has any zeroes. We find the denominator is zero when x=±1. To determine whether the lines x=1 or x=−1 are vertical asymptotes of f, evaluate \displaystyle \lim_{x→1}f(x) and \displaystyle \lim_{x→−1}f(x). By looking at each one-sided limit as x→1, we see that

\displaystyle \lim_{x→1^+}\frac{x^2}{1−x^2}=−∞ and \displaystyle \lim_{x→1^−}\frac{x^2}{1−x^2}=∞.

In addition, by looking at each one-sided limit as x→−1, we find that

\displaystyle \lim_{x→−1^+}\frac{x^2}{1−x^2}=∞ and \displaystyle \lim_{x→−1^−}\frac{x^2}{1−x^2}=−∞.

Step 5: Calculate the first derivative:

f′(x)=\dfrac{(1−x^2)(2x)−x^2(−2x)}{\Big(1−x^2\Big)^2}=\dfrac{2x}{\Big(1−x^2\Big)^2}.

Critical points occur at points x where f′(x)=0 or f′(x) is undefined. We see that f′(x)=0 when x=0. The derivative f′ is not undefined at any point in the domain of f. However, x=±1 are not in the domain of f. Therefore, to determine where f is increasing and where f is decreasing, divide the interval (−∞,∞) into four smaller intervals: (−∞,−1), (−1,0), (0,1), and (1,∞), and choose a test point in each interval to determine the sign of f′(x) in each of these intervals. The values x=−2,\; x=−\frac{1}{2}, \;x=\frac{1}{2}, and x=2 are good choices for test points as shown in the following table.

Interval Test point Sign of f′(x)=\frac{2x}{(1−x^2)^2} Conclusion
(−∞,−1) x=−2 −/+=− f is decreasing.
(−1,0) x=−/2 −/+=− f is decreasing.
(0,1) x=1/2 +/+=+ f is increasing.
(1,∞) x=2 +/+=+ f is increasing.

From this analysis, we conclude that f has a local minimum at x=0 but no local maximum.

Step 6: Calculate the second derivative:

\begin{align*} f''(x)&=\frac{(1−x^2)^2(2)−2x(2(1−x^2)(−2x))}{(1−x^2)^4}\\[4pt] &=\frac{(1−x^2)[2(1−x^2)+8x^2]}{\Big(1−x^2\Big)^4}\\[4pt] &=\frac{2(1−x^2)+8x^2}{\Big(1−x^2\Big)^3}\\[4pt] &=\frac{6x^2+2}{\Big(1−x^2\Big)^3}. \end{align*}

To determine the intervals where f is concave up and where f is concave down, we first need to find all points x where f''(x)=0 or f''(x) is undefined. Since the numerator 6x^2+2≠0 for any x, f''(x) is never zero. Furthermore, f'' is not undefined for any x in the domain of f. However, as discussed earlier, x=±1 are not in the domain of f. Therefore, to determine the concavity of f, we divide the interval (−∞,∞) into the three smaller intervals (−∞,−1), \, (−1,−1), and (1,∞), and choose a test point in each of these intervals to evaluate the sign of f''(x). in each of these intervals. The values x=−2, \;x=0, and x=2 are possible test points as shown in the following table.

Interval Test Point Sign of f''(x)=\frac{6x^2+2}{(1−x^2)^3} Conclusion
(−∞,−1) x=−2 +/−=− f is concave down.
(−1,−1) x=0 +/+=+ f is concave up
(1,∞) x=2 +/−=− f is concave down.

Combining all this information, we arrive at the graph of f shown below. Note that, although f changes concavity at x=−1 and x=1, there are no inflection points at either of these places because f is not continuous at x=−1 or x=1.

The function f(x) = (x −1)3(x + 2) is graphed.

Exercise \PageIndex{9}

Sketch a graph of f(x)=\dfrac{3x+5}{8+4x}.

Hint

A line y=L is a horizontal asymptote of f if the limit as x→∞ or the limit as x→−∞ of f(x) is L. A line x=a is a vertical asymptote if at least one of the one-sided limits of f as x→a is or −∞.

Answer

The function f(x) = (3x + 5)/(8 + 4x) is graphed. It appears to have asymptotes at x = −2 and y = 1.

Example \PageIndex{10}: Sketching a Rational Function with an Oblique Asymptote

Sketch the graph of f(x)=\dfrac{x^2}{x−1}

Solution

Step 1: The domain of f is the set of all real numbers x except x=1.

Step 2: Find the intercepts. We can see that when x=0, \,f(x)=0, so (0,0) is the only intercept.

Step 3: Evaluate the limits at infinity. Since the degree of the numerator is one more than the degree of the denominator, f must have an oblique asymptote. To find the oblique asymptote, use long division of polynomials to write

f(x)=\dfrac{x^2}{x−1}=x+1+\dfrac{1}{x−1}.

Since \dfrac{1}{x−1}→0 as x→±∞, f(x) approaches the line y=x+1 as x→±∞. The line y=x+1 is an oblique asymptote for f.

Step 4: To check for vertical asymptotes, look at where the denominator is zero. Here the denominator is zero at x=1. Looking at both one-sided limits as x→1, we find

\displaystyle \lim_{x→1^+}\frac{x^2}{x−1}=∞ and \displaystyle \lim_{x→1^−}\frac{x^2}{x−1}=−∞.

Therefore, x=1 is a vertical asymptote, and we have determined the behavior of f as x approaches 1 from the right and the left.

Step 5: Calculate the first derivative:

f′(x)=\dfrac{(x−1)(2x)−x^2(1)}{(x−1)^2}=\dfrac{x^2−2x}{(x−1)^2}.

We have f′(x)=0 when x^2−2x=x(x−2)=0. Therefore, x=0 and x=2 are critical points. Since f is undefined at x=1, we need to divide the interval (−∞,∞) into the smaller intervals (−∞,0), (0,1), (1,2), and (2,∞), and choose a test point from each interval to evaluate the sign of f′(x) in each of these smaller intervals. For example, let x=−1, x=\frac{1}{2}, x=\frac{3}{2}, and x=3 be the test points as shown in the following table.

Interval Test Point Sign of f'(x)=\dfrac{x^2−2x}{(x−1)^2} Conclusion
(−∞,0) x=−1 (−)(−)/+=+ f is increasing.
(0,1) x=1/2 (+)(−)/+=− f is decreasing.
(1,2) x=3/2 (+)(−)/+=− f is decreasing.
(2,∞) x=3 (+)(+)/+=+ f is increasing.

From this table, we see that f has a local maximum at x=0 and a local minimum at x=2. The value of f at the local maximum is f(0)=0 and the value of f at the local minimum is f(2)=4. Therefore, (0,0) and (2,4) are important points on the graph.

Step 6. Calculate the second derivative:

\begin{align*} f''(x) &= \frac{(x−1)^2(2x−2)−2(x−1)(x^2−2x)}{(x−1)^4}\\[4pt] &=\frac{2(x−1)[(x−1)^2−(x^2−2x)]}{(x−1)^4}\\[4pt] &=\frac{2[x^2-2x+1−x^2+2x]}{(x−1)^3}\\[4pt] &=\frac{2}{(x−1)^3}. \end{align*}

We see that f''(x) is never zero or undefined for x in the domain of f. Since f is undefined at x=1, to check concavity we just divide the interval (−∞,∞) into the two smaller intervals (−∞,1) and (1,∞), and choose a test point from each interval to evaluate the sign of f''(x) in each of these intervals. The values x=0 and x=2 are possible test points as shown in the following table.

Interval Test Point Sign of f''(x)=\dfrac{2}{(x−1)^3} Conclusion
(−∞,1) x=0 +/−=− f is concave down.
(1,∞) x=2 +/+=+ f is concave up

From the information gathered, we arrive at the following graph for f.

The function f(x) = x2/(x − 1) is graphed. It has asymptotes y = x + 1 and x = 1.

Exercise \PageIndex{10}

Find the oblique asymptote for f(x)=\dfrac{3x^3−2x+1}{2x^2−4}.

Hint

Use long division of polynomials.

Answer

y=\frac{3}{2}x

Example \PageIndex{11}: Sketching the Graph of a Function with a Cusp

Sketch a graph of f(x)=(x−1)^{2/3}

Solution

Step 1: Since the cube-root function is defined for all real numbers x and (x−1)^{2/3}=(\sqrt[3]{x−1})^2, the domain of f is all real numbers.

Step 2: To find the y-intercept, evaluate f(0). Since f(0)=1, the y-intercept is (0,1). To find the x-intercept, solve (x−1)^{2/3}=0. The solution of this equation is x=1, so the x-intercept is (1,0).

Step 3: Since \displaystyle \lim_{x→±∞}(x−1)^{2/3}=∞, the function continues to grow without bound as x→∞ and x→−∞.

Step 4: The function has no vertical asymptotes.

Step 5: To determine where f is increasing or decreasing, calculate f′. We find

f′(x)=\frac{2}{3}(x−1)^{−1/3}=\frac{2}{3(x−1)^{1/3}}

This function is not zero anywhere, but it is undefined when x=1. Therefore, the only critical point is x=1. Divide the interval (−∞,∞) into the smaller intervals (−∞,1) and (1,∞), and choose test points in each of these intervals to determine the sign of f′(x) in each of these smaller intervals. Let x=0 and x=2 be the test points as shown in the following table.

Interval Test Point Sign of f′(x)=\frac{2}{3(x−1)^{1/3}} Conclusion
(−∞,1) x=0 +/−=− f is decreasing
(1,∞) x=2 +/+=+ f is increasing

We conclude that f has a local minimum at x=1. Evaluating f at x=1, we find that the value of f at the local minimum is zero. Note that f′(1) is undefined, so to determine the behavior of the function at this critical point, we need to examine \displaystyle \lim_{x→1}f′(x). Looking at the one-sided limits, we have

\lim_{x→1^+}\frac{2}{3(x−1)^{1/3}}=∞\text{ and } \lim_{x→1^−}\frac{2}{3(x−1)^{1/3}}=−∞.\nonumber

Therefore, f has a cusp at x=1.

Step 6: To determine concavity, we calculate the second derivative of f:

f''(x)=−\dfrac{2}{9}(x−1)^{−4/3}=\dfrac{−2}{9(x−1)^{4/3}}.

We find that f''(x) is defined for all x, but is undefined when x=1. Therefore, divide the interval (−∞,∞) into the smaller intervals (−∞,1) and (1,∞), and choose test points to evaluate the sign of f''(x) in each of these intervals. As we did earlier, let x=0 and x=2 be test points as shown in the following table.

Interval Test Point Sign of f''(x)=\dfrac{−2}{9(x−1)^{4/3}} Conclusion
(−∞,1) x=0 −/+=− f is concave down
(1,∞) x=2 −/+=− f is concave down

From this table, we conclude that f is concave down everywhere. Combining all of this information, we arrive at the following graph for f.

The function f(x) = (x − 1)2/3 is graphed. It touches the x axis at x = 1, where it comes to something of a sharp point and then flairs out on either side.

Exercise \PageIndex{11}

Consider the function f(x)=5−x^{2/3}. Determine the point on the graph where a cusp is located. Determine the end behavior of f.

Hint

A function f has a cusp at a point a if f(a) exists, f'(a) is undefined, one of the one-sided limits as x→a of f'(x) is +∞, and the other one-sided limit is −∞.

Answer

The function f has a cusp at (0,5), since \displaystyle \lim_{x→0^−}f′(x)=∞ and \displaystyle \lim_{x→0^+}f′(x)=−∞. For end behavior, \displaystyle \lim_{x→±∞}f(x)=−∞.

Key Concepts

  • If c is a critical point of f and f'(x)>0 for x<c and f'(x)<0 for x>c, then f has a local maximum at c.
  • If c is a critical point of f and f'(x)<0 for x<c and f'(x)>0 for x>c, then f has a local minimum at c.
  • If f''(x)>0 over an interval I, then f is concave up over I.
  • If f''(x)<0 over an interval I, then f is concave down over I.
  • If f'(c)=0 and f''(c)>0, then f has a local minimum at c.
  • If f'(c)=0 and f''(c)<0, then f has a local maximum at c.
  • If f'(c)=0 and f''(c)=0, then evaluate f'(x) at a test point x to the left of c and a test point x to the right of c, to determine whether f has a local extremum at c.

Glossary

concave down
if f is differentiable over an interval I and f' is decreasing over I, then f is concave down over I
concave up
if f is differentiable over an interval I and f' is increasing over I, then f is concave up over I
concavity
the upward or downward curve of the graph of a function
concavity test
suppose f is twice differentiable over an interval I; if f''>0 over I, then f is concave up over I; if f''< over I, then f is concave down over I
first derivative test
let f be a continuous function over an interval I containing a critical point c such that f is differentiable over I except possibly at c; if f' changes sign from positive to negative as x increases through c, then f has a local maximum at c; if f' changes sign from negative to positive as x increases through c, then f has a local minimum at c; if f' does not change sign as x increases through c, then f does not have a local extremum at c
inflection point
if f is continuous at c and f changes concavity at c, the point (c,f(c)) is an inflection point of f
second derivative test
suppose f'(c)=0 and f'' is continuous over an interval containing c; if f''(c)>0, then f has a local minimum at c; if f''(c)<0, then f has a local maximum at c; if f''(c)=0, then the test is inconclusive

Contributors and Attributions

  • Gilbert Strang (MIT) and Edwin “Jed” Herman (Harvey Mudd) with many contributing authors. This content by OpenStax is licensed with a CC-BY-SA-NC 4.0 license. Download for free at http://cnx.org.


This page titled 4.3: Graphing Functions is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by OpenStax via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?