Graphing a Derivative

Learning Outcomes

  • Graph a derivative function from the graph of a given function
  • State the connection between derivatives and continuity
  • Describe three conditions for when a function does not have a derivative

Derivative Function Graphs

We have already discussed how to graph a function, so given the equation of a function or the equation of a derivative function, we could graph it. Given both, we would expect to see a correspondence between the graphs of these two functions, since [latex]f^{\prime}(x)[/latex] gives the rate of change of a function [latex]f(x)[/latex] (or slope of the tangent line to [latex]f(x)[/latex]). It may be useful here to recall the characteristics of lines with certain slopes.

Recall: slopes of lines and their defining characteristics

A line has a positive slope if it is increasing from left to right.

A line has a negative slope if it is decreasing from left to right.

A horizontal line has a slope of 0. 

A vertical line has an undefined slope.

In the first example we found that for [latex]f(x)=\sqrt{x}, \, f^{\prime}(x)=\frac{1}{2}\sqrt{x}[/latex]. If we graph these functions on the same axes, as in Figure 2, we can use the graphs to understand the relationship between these two functions. First, we notice that [latex]f(x)[/latex] is increasing over its entire domain, which means that the slopes of its tangent lines at all points are positive. Consequently, we expect [latex]f^{\prime}(x)>0[/latex] for all values of [latex]x[/latex] in its domain. Furthermore, as [latex]x[/latex] increases, the slopes of the tangent lines to [latex]f(x)[/latex] are decreasing and we expect to see a corresponding decrease in [latex]f^{\prime}(x)[/latex]. We also observe that [latex]f(0)[/latex] is undefined and that [latex]\underset{x\to 0^+}{\lim}f^{\prime}(x)=+\infty[/latex], corresponding to a vertical tangent to [latex]f(x)[/latex] at 0.

The function f(x) = the square root of x is graphed as is its derivative f’(x) = 1/(2 times the square root of x).

Figure 2. The derivative [latex]f^{\prime}(x)[/latex] is positive everywhere because the function [latex]f(x)[/latex] is increasing.

In the second example we found that for [latex]f(x)=x^2-2x, \, f^{\prime}(x)=2x-2[/latex]. The graphs of these functions are shown in Figure 3. Observe that [latex]f(x)[/latex] is decreasing for [latex]x<1[/latex]. For these same values of [latex]x, \, f^{\prime}(x)<0[/latex]. For values of [latex]x>1, \, f(x)[/latex] is increasing and [latex]f^{\prime}(x)>0[/latex]. Also, [latex]f(x)[/latex] has a horizontal tangent at [latex]x=1[/latex] and [latex]f^{\prime}(1)=0[/latex].

The function f(x) = x squared – 2x is graphed as is its derivative f’(x) = 2x − 2.

Figure 3. The derivative [latex]f^{\prime}(x)<0[/latex] where the function [latex]f(x)[/latex] is decreasing and [latex]f^{\prime}(x)>0[/latex] where [latex]f(x)[/latex] is increasing. The derivative is zero where the function has a horizontal tangent.

Example: Sketching a Derivative Using a Function

Use the following graph of [latex]f(x)[/latex] to sketch a graph of [latex]f^{\prime}(x)[/latex].

The function f(x) is roughly sinusoidal, starting at (−4, 3), decreasing to a local minimum at (−2, 2), then increasing to a local maximum at (3, 6), and getting cut off at (7, 2).

Figure 4. Graph of [latex]f(x)[/latex].

Watch the following video to see the worked solution to Example: Sketching a Derivative Using a Function.

Try It

Sketch the graph of [latex]f(x)=x^2-4[/latex]. On what interval is the graph of [latex]f^{\prime}(x)[/latex] above the [latex]x[/latex]-axis?

Try It

Derivatives and Continuity

Now that we can graph a derivative, let’s examine the behavior of the graphs. First, we consider the relationship between differentiability and continuity. We will see that if a function is differentiable at a point, it must be continuous there; however, a function that is continuous at a point need not be differentiable at that point. In fact, a function may be continuous at a point and fail to be differentiable at the point for one of several reasons.

Differentiability Implies Continuity


Let [latex]f(x)[/latex] be a function and [latex]a[/latex] be in its domain. If [latex]f(x)[/latex] is differentiable at [latex]a[/latex], then [latex]f[/latex] is continuous at [latex]a[/latex].

Proof

If [latex]f(x)[/latex] is differentiable at [latex]a[/latex], then [latex]f^{\prime}(a)[/latex] exists and

[latex]f^{\prime}(a)=\underset{x\to a}{\lim}\dfrac{f(x)-f(a)}{x-a}[/latex]

 

We want to show that [latex]f(x)[/latex] is continuous at [latex]a[/latex] by showing that [latex]\underset{x\to a}{\lim}f(x)=f(a)[/latex]. Thus,

[latex]\begin{array}{lllll} \underset{x\to a}{\lim}f(x) & =\underset{x\to a}{\lim}(f(x)-f(a)+f(a)) & & & \\ & =\underset{x\to a}{\lim}(\frac{f(x)-f(a)}{x-a}\cdot (x-a)+f(a)) & & & \text{Multiply and divide} \, f(x)-f(a) \, \text{by} \, x-a. \\ & =(\underset{x\to a}{\lim}\frac{f(x)-f(a)}{x-a}) \cdot (\underset{x\to a}{\lim}(x-a))+\underset{x\to a}{\lim}f(a) & & & \\ & =f^{\prime}(a) \cdot 0+f(a) & & & \\ & =f(a). & & & \end{array}[/latex]

 

Therefore, since [latex]f(a)[/latex] is defined and [latex]\underset{x\to a}{\lim}f(x)=f(a)[/latex], we conclude that [latex]f[/latex] is continuous at [latex]a[/latex].

[latex]_\blacksquare[/latex]

We have just proven that differentiability implies continuity, but now we consider whether continuity implies differentiability. To determine an answer to this question, we examine the function [latex]f(x)=|x|[/latex]. This function is continuous everywhere; however, [latex]f^{\prime}(0)[/latex] is undefined. This observation leads us to believe that continuity does not imply differentiability. Let’s explore further. For [latex]f(x)=|x|[/latex],

[latex]f^{\prime}(0)=\underset{x\to 0}{\lim}\dfrac{f(x)-f(0)}{x-0}=\underset{x\to 0}{\lim}\dfrac{|x|-|0|}{x-0}=\underset{x\to 0}{\lim}\dfrac{|x|}{x}[/latex]

 

This limit does not exist because

[latex]\underset{x\to 0^-}{\lim}\dfrac{|x|}{x}=-1 \, \text{and} \, \underset{x\to 0^+}{\lim}\dfrac{|x|}{x}=1[/latex]

 

See Figure 6.

The function f(x) = the absolute value of x is graphed. It consists of two straight line segments: the first follows the equation y = −x and ends at the origin; the second follows the equation y = x and starts at the origin.

Figure 6. The function [latex]f(x)=|x|[/latex] is continuous at 0 but is not differentiable at 0.

Let’s consider some additional situations in which a continuous function fails to be differentiable. Consider the function [latex]f(x)=\sqrt[3]{x}[/latex]:

[latex]f^{\prime}(0)=\underset{x\to 0}{\lim}\dfrac{\sqrt[3]{x}-0}{x-0}=\underset{x\to 0}{\lim}\dfrac{1}{\sqrt[3]{x^2}}=+\infty[/latex]

 

Thus [latex]f^{\prime}(0)[/latex] does not exist. A quick look at the graph of [latex]f(x)=\sqrt[3]{x}[/latex] clarifies the situation. The function has a vertical tangent line at 0 (Figure 7).

The function f(x) = the cube root of x is graphed. It has a vertical tangent at x = 0.

Figure 7. The function [latex]f(x)=\sqrt[3]{x}[/latex] has a vertical tangent at [latex]x=0[/latex]. It is continuous at 0 but is not differentiable at 0.

The function [latex]f(x)=\begin{cases} x \sin\left(\frac{1}{x}\right) & \text{ if } \, x \ne 0 \\ 0 & \text{ if } \, x = 0 \end{cases}[/latex] also has a derivative that exhibits interesting behavior at 0. We see that

[latex]f^{\prime}(0)=\underset{x\to 0}{\lim}\dfrac{x \sin\left(\frac{1}{x}\right)-0}{x-0}=\underset{x\to 0}{\lim} \sin\left(\dfrac{1}{x}\right)[/latex]

 

This limit does not exist, essentially because the slopes of the secant lines continuously change direction as they approach zero (Figure 8).

The function f(x) = x sin (1/2) if x does not equal 0 and f(x) = 0 if x = 0 is graphed. It looks like a rapidly oscillating sinusoidal function with amplitude decreasing to 0 at the origin.

Figure 8. The function [latex]f(x)=\begin{cases} x \sin(\frac{1}{x}) & \text{ if } \, x \ne 0 \\ 0 & \text{ if } \, x = 0 \end{cases}[/latex] is not differentiable at 0.

 

In summary:

  1. We observe that if a function is not continuous, it cannot be differentiable, since every differentiable function must be continuous. However, if a function is continuous, it may still fail to be differentiable.
  2. We saw that [latex]f(x)=|x|[/latex] failed to be differentiable at 0 because the limit of the slopes of the tangent lines on the left and right were not the same. Visually, this resulted in a sharp corner on the graph of the function at 0. From this we conclude that in order to be differentiable at a point, a function must be “smooth” at that point.
  3. As we saw in the example of [latex]f(x)=\sqrt[3]{x}[/latex], a function fails to be differentiable at a point where there is a vertical tangent line.
  4. As we saw with [latex]f(x)=\begin{cases} x \sin(\frac{1}{x}) & \text{ if } \, x \ne 0 \\ 0 & \text{ if } \, x = 0 \end{cases}[/latex] a function may fail to be differentiable at a point in more complicated ways as well.

 

Example: A Piecewise Function that is Continuous and Differentiable

A toy company wants to design a track for a toy car that starts out along a parabolic curve and then converts to a straight line (Figure 9). The function that describes the track is to have the form [latex]f(x)=\begin{cases} \frac{1}{10}x^2 + bx + c & \text{ if } \, x < -10 \\ -\frac{1}{4}x + \frac{5}{2} & \text{ if } \, x \ge -10 \end{cases}[/latex], where [latex]x[/latex] and [latex]f(x)[/latex] are in inches. For the car to move smoothly along the track, the function [latex]f(x)[/latex] must be both continuous and differentiable at -10. Find values of [latex]b[/latex] and [latex]c[/latex] that make [latex]f(x)[/latex] both continuous and differentiable.

A cart is drawn on a line that curves through (−10, 5) to (10, 0) with y-intercept roughly (0, 2).

Figure 9. For the car to move smoothly along the track, the function must be both continuous and differentiable.

Watch the following video to see the worked solution to Example: A Piecewise Function that is Continuous and Differentiable.

Try It

Find values of [latex]a[/latex] and [latex]b[/latex] that make [latex]f(x)=\begin{cases} ax+b & \text{ if } \, x < 3 \\ x^2 & \text{ if } \, x \ge 3 \end{cases}[/latex] both continuous and differentiable at 3.