## Section6.4The Derivative

### Subsection6.4.1Overview

Given a function, the derivative at a point allows us to measure the instantaneous rate of change at that point. This rate of change is defined as the limiting value of the average rate of change as the space between the two points used approaches zero. It would be quite tedious to compute the derivative at each point using this process. Fortunately, we can create a function known as the derivative that does this for us.

In this section, we introduce the derivative as a function rather than an isolated calculation. The definition of the derivative is still in terms of a limit, but with the point in question represented by a variable. The domain of the derivative consists of all points where the limit exists, and corresponds to the set of points where a tangent line can be defined as a function. For algebraically defined functions, we can use the limit and algebra to find an algebraic formula for the derivative. Several examples illustrate this process. The derivative function can then be used to calculate the instantaneous rate at any desired point.

### Subsection6.4.2Introducing the Derivative

A function is a rule that associates a unique output with each input value. When we look at the graph of a function, the points on the graph are placed so that the input value is the first coordinate (e.g., $x$) and the output value is the second coordinate (e.g., $y$). Using the graph, we can find the value of the function for a given input by looking for the input along the horizontal ($x$) axis and then finding the point on the graph intersecting the corresponding vertical line. The height of that point gives the output value of the function.

If that point of the graph has a well-defined tangent line, then we could define another function that has as its output the slope of the tangent line at that point. This function is called the derivative function. The following website provides an interactive illustration of this concept: http://www.intmath.com/differentiation/derivative-graphs.php

Consider the figure illustrated below. The graph of a function $y=f(x)$is given and short segments of the tangent lines at various points have also been included. The point at $x=-1$ has a $y$-value of 2 and a slope of 0 (horizontal tangent line). So $f(-1)=2$ while $\frac{df}{dx}(-1)=0\text{.}$ The point at $x=0$ has a $y$-value of 0 and a slope of -3, so $f(0)=0$ and $\frac{df}{dx}(0)=-3\text{.}$ The third point, at $x=2$ has a $y$-value of 2 and a slope of 9, corresponding to $f(2)=2$ and $\frac{df}{dx}(2)=9\text{.}$ The equations of these tangent lines, listed in the same order as described above, and written in point–slope form, are given by

\begin{align*} y &= 2, \\ y &= -3x, \\ y &= 9(x-2)+2. \end{align*}
###### Definition6.4.1The Derivative

Suppose $f$ is a function relating two variables $f:x \mapsto y\text{.}$ The derivative of $y$ is a new dependent variable $\frac{dy}{dx}$ that for every value of the independent variable, $x=a\text{,}$ has a value equal to the instantaneous rate of change, $\frac{dy}{dx}=\frac{dy}{dx}\Big|_a\text{.}$ The function $f' : x \mapsto \frac{dy}{dx}$ is called the derivative of $f\text{.}$ That is,

\begin{equation*} f'(x) = \lim_{h \to 0} \frac{f(x+h)-f(x)}{h}\text{.} \end{equation*}

The domain of $f'$ is the set of all values $x$ where the limit exists.

Our previous use of the notation $f'$ to represent the rate of accumulation of an accumulation function was intentional. It looked ahead to the Fundamental Theorem of Calculus that connects the ideas of derivatives and integrals. In this section, we will use the names $f'$ and $\frac{df}{dx}$ interchangeably. The Fundamental Theorem of Calculus will justify this equivalence later.

### Subsection6.4.3Examples of Calculation

Recall that the definition of the instantaneous rate of change (which is what the derivative measures) is the limiting value of an average rate of change of the function between two points as the second point approaches the first. When computing the derivative, we will use two points at symbolic values $x$ (the point of interest) and $x+h$ (the second point), where $h$ is the spacing between the two points. The second point approaches the first when $h \to 0\text{.}$ The basic process is outlined in the following steps:

1. Compute $f(x+h)$ using the rule for $f(x)\text{.}$ (Find the output for the second point.)

2. Compute $f(x+h)-f(x)$ and simplify. (Find the change in output.)

3. Simplify $\displaystyle \frac{\Delta f}{\Delta x} = \frac{f(x+h)-f(x)}{h}\text{.}$ (Determine a simplified formula for the average rate of change.)

4. Determine $\displaystyle \frac{df}{dx} = \lim_{h \to 0} \frac{f(x+h)-f(x)}{h}\text{.}$ (Evaluate the limiting value as the second point approaches the first.)

###### Example6.4.2

Use the definition of the derivative to find $\frac{df}{dx}$ where $f(x) = x^2-3x\text{.}$

Solution
• Find the output at the second point:

\begin{equation*} f(x+h) = (x+h)^2-3(x+h) = x^2+2xh+h^2-3x-3h\text{.} \end{equation*}
• Find the change in output between the two points:

\begin{align*} f(x+h)-f(x) &= (x^2+2xh+h^2-3x-3h)- (x^2-3x) \\ & = x^2+2xh+h^2-3x-3h-x^2+3x \\ & = 2xh+h^2-3h \end{align*}
• Simplify the average rate of change between the two points:

\begin{align*} \frac{f(x+h)-f(x)}{h} & = \frac{2xh+h^2-3h}{h} \\ & = \frac{h(2x+h-3)}{h} \\ & = 2x+h-3 \end{align*}
• The derivative is the limit of the average rate of change:

\begin{align*} \frac{df}{dx} & = \lim_{h \to 0} \frac{f(x+h)-f(x)}{h} \\ & = \lim_{h \to 0} 2x+h-3 \\ & = 2x+0-3 = 2x-3 \end{align*}

So we have found the derivative function, $\frac{df}{dx}(x) = 2x-3\text{.}$ We can see this exactly agrees with the rate of accumulation $f'(x)=2x-3$ that we earlier learned to find in terms of the elementary accumulation formulas.

Often it is more convenient to combine some of these steps together. However, just be careful that you create valid equations. Always have an equation that says what you are computing, and do not write that two things are equal when they are not the same. In the previous example, note how each time I started to compute a new expression, I created a new system of equations.

In this next example, we are reminded of the need to find a common denominator when a fraction is involved. Also, it is useful to recall that division by a number $h$is the same as multiplication by its inverse $1/h\text{.}$

###### Example6.4.3

Use the definition of the derivative to find $f'(x)$ where $\displaystyle f(x) = \frac{1}{2x+3}\text{.}$

Solution
• Find the output at the second point:

\begin{equation*} f(x+h) = \frac{1}{2(x+h)+3} = \frac{1}{2x+2h+3}\text{.} \end{equation*}
• Find the change in output between the two points:

\begin{equation*} f(x+h)-f(x) = \frac{1}{2x+2h+3}- \frac{1}{2x+3}\text{.} \end{equation*}

Here is where we will need to use a common denominator. Recall from ordinary fractions that a common denominator is formed by multiplying the top and bottom by a missing factor.

\begin{align*} f(x+h)-f(x) & = \frac{(2x+3)}{(2x+3)(2x+2h+3)} - \frac{(2x+2h+3)}{(2x+3)(2x+2h+3)} \\ & = \frac{(2x+3)-(2x+2h+3)}{(2x+3)(2x+2h+3)} \\ & = \frac{-2h}{(2x+3)(2x+2h+3)} \end{align*}
• Simplify the average rate of change between the two points. However, it is dangerous to write a fraction divided by something (division is not associative), so we will write division by $h$ as multiplication by $1/h$ and simplify the resulting expression:

\begin{align*} \frac{f(x+h)-f(x)}{h} & = \frac{-2h}{(2x+3)(2x+2h+3)} \cdot \frac{1}{h} \\ & = \frac{-2}{(2x+3)(2x+2h+3)} \end{align*}

Your goal at the simplification step should always be to make the $h$ cancel as a common factor.

• The derivative is the limit of the average rate of change:

\begin{align*} \frac{df}{dx} & = \lim_{h \to 0} \frac{f(x+h)-f(x)}{h} \\ & = \lim_{h \to 0} \frac{-2}{(2x+3)(2x+2h+3)} \\ & = \frac{-2}{(2x+3)(2x+0+3)} \\ & = \frac{-2}{(2x+3)^2} \end{align*}

This gives us the derivative function,

\begin{equation*} \frac{df}{dx} = \frac{-2}{(2x+3)^2}. \end{equation*}

For our last example, we consider finding the derivative using the definition when the function involves the square root. We will find it necessary to use a trick from algebra involving conjugate pairs. Recall that $(a+b)(a-b) = a^2-b^2\text{.}$ If $a$ or $b$ is a square root of some value, then the product of these conjugate pairs will have the square of the square root, thereby no longer involving the square root. For example,

\begin{equation*} (\sqrt{x}-2)(\sqrt{x}+2) = (\sqrt{x})^2 - (2)^2 = x-4. \end{equation*}
###### Example6.4.4

Use the definition of the derivative to find $f'(x)$ where $\displaystyle f(x) = \sqrt{2x-5}\text{.}$

Solution
• Find the output at the second point:

\begin{equation*} f(x+h) = \sqrt{2(x+h)-5} = \sqrt{2x+2h-5} \end{equation*}
• Find the change in output between the two points:

\begin{equation*} f(x+h)-f(x) = \sqrt{2x+2h-5}- \sqrt{2x-5}\text{.} \end{equation*}
• Simplify the average rate of change between the two points. This will require multiplying the numerator and denominator by the conjugate pair:

\begin{align*} \frac{f(x+h)-f(x)}{h} & = \frac{\sqrt{2x+2h-5}-\sqrt{2x-5}}{h} \\ & = \frac{(\sqrt{2x+2h-5}-\sqrt{2x-5})(\sqrt{2x+2h-5}+\sqrt{2x-5})}{h(\sqrt{2x+2h-5}+\sqrt{2x-5})} \\ & = \frac{(\sqrt{2x+2h-5})^2-(\sqrt{2x-5})^2}{h(\sqrt{2x+2h-5}+\sqrt{2x-5})} = \frac{(2x+2h-5)-(2x-5)} {h(\sqrt{2x+2h-5}+\sqrt{2x-5})} \\ & = \frac{2h}{h(\sqrt{2x+2h-5}+\sqrt{2x-5})} = \frac{2}{\sqrt{2x+2h-5}+\sqrt{2x-5}} \end{align*}
• The derivative is the limit of the average rate of change:

\begin{align*} f'(x) & = \lim_{h \to 0} \frac{f(x+h)-f(x)}{h} \\ & = \lim_{h \to 0} \frac{2}{\sqrt{2x+2h-5}+\sqrt{2x-5}} \\ & = \frac{2}{\sqrt{2x+0-5}+\sqrt{2x-5}} \\ & = \frac{1}{\sqrt{2x-5}} \end{align*}

This gives us the derivative function,

\begin{equation*} f'(x) = \frac{1}{\sqrt{2x-5}}. \end{equation*}

### Subsection6.4.4Differentiability

A function is differentiable at points where the derivative is defined. Alternatively, because the derivative at a point represents the slope of the tangent line, we say the function is differentiable at a point wherever the function has a well-defined tangent line.

###### Definition6.4.5Differentiability

A function $f$ is differentiable at $a$ if $f'(a)$ exists, or more precisely the limit

\begin{equation*} \lim_{h \to 0} \frac{f(a+h)-f(a)}{h} = \lim_{x \to a} \frac{f(x)-f(a)}{x-a} \end{equation*}

exists.

A function $f$ is not differentiable at $x=a$ if the limit defining $f'(a)$ does not exist. There are several reasons this might occur. The first reason is if the function is not continuous.

Suppose that $f$ is differentiable at $a\text{.}$ This means that $f'(a)$ is a value defined by

\begin{equation*} \lim_{x \to a}\frac{f(x)-f(a)}{x-a} = f'(a). \end{equation*}

We also know that

\begin{equation*} \lim_{x \to a}[x-a] = a-a = 0. \end{equation*}

Using the product rule for limits (LC:Product), this implies

\begin{equation*} \lim_{x \to a} [f(x)-f(a)] = \lim_{x \to a} \frac{f(x)-f(a)}{x-a} \cdot (x-a) = f'(a) \cdot 0 = 0. \end{equation*}

Because $\displaystyle \lim_{x \to a} f(a) = f(a)$ (LE:Constant), we know that

\begin{equation*} \lim_{x \to a} f(x) = \lim_{x \to a} [f(x)-f(a) + f(a)] = 0 + f(a) = f(a) \end{equation*}

using the sum rule (LC:Sum). Therefore, $f$ is continuous at $a\text{.}$

###### Example6.4.7

Show that $f(x)$ defined below is not continuous and not differentiable at $x=1\text{.}$

\begin{equation*} f(x) = \begin{cases} 5-2x, & x \lt 1 \\ 3x+1, & x \ge 1 \end{cases} \end{equation*}
Solution

To check continuity, we evaluate limits from the left and right and compare it to the value of the function $f(1)=3(1)+1=4\text{.}$

\begin{align*} \lim_{x \to 1^-} f(x) &= \lim_{x \to 1^-} 5-2x \\ &= 5-2(1) = 3\\ \lim_{x \to 1^+} f(x) &= \lim_{x \to 1^+} 3x+1 \\ &= 3(1)+1 = 4 \end{align*}

The function has a jump discontinuity at $x=1\text{.}$ The value on the function does agree with the limit on the right, but not the limit on the left.

Theorem 6.4.6 guarantees that we will find $f$ is not differentiable at $x=1\text{.}$ We can verify this by computing the actual limits defining the derivative. When $h \lt 0\text{,}$

\begin{equation*} f(1+h) = 5-2(1+h) = 3-2h. \end{equation*}

Because $f$ is not continuous from the left, computing the derivative from the left will result in an infinite limit.

\begin{align*} \frac{df}{dx}\Big|_{1^-} &= \lim_{h \to 0^-} \frac{f(1+h)-f(1)}{h} \\ &= \lim_{h \to 0^-} \frac{(3-2h)-4}{h} \\ &= \lim_{h \to 0^-} \frac{-2h-1}{h} \\ &\to \frac{-1}{0^-} = +\infty \end{align*}

On the other side, when $h \gt 0\text{,}$

\begin{equation*} f(1+h) = 3(1+h)+1 = 4+3h \end{equation*}

so that

\begin{align*} \frac{df}{dx}\Big|_{1^+} &= \lim_{h \to 0^+} \frac{f(1+h)-f(1)}{h} \\ &= \lim_{h \to 0^+} \frac{(4+3h)-4}{h} \\ &= \lim_{h \to 0^+} \frac{3h}{h} \\ &= 3 \end{align*}

With the derivative from the left being infinite, $f'(1)$ is undefined and $f$ is not differentiable at $x=1\text{.}$

Another way that a function might not have be differentiable is where it is continuous but has a corner. This means that the slope at the point looks different from either of the two sides. Mathematically, if we computed the one-sided limits of the difference quotient defining the derivative, we would get two different values. The difference quotient has a jump discontinuity at $h=0\text{.}$

###### Example6.4.8

Consider the piecewise function defined by

\begin{equation*} f(x) = \begin{cases} x^2, & x \le 1, \\ x, & x \gt 1.\end{cases} \end{equation*}

Determine if $f$ is differentiable at $x=1\text{.}$

Solution

This function is continuous because the limit on the left and the limit on the right are equal to the value of the function at $x=1\text{,}$ as follows:

\begin{align*} \lim_{x \to 1^-}f(x) &= \lim_{x \to 1}x^2 = 1^2 = 1,\\ \lim_{x \to 1^+}f(x) &= \lim_{x \to 1}x = 1 = 1,\\ f(1) &= 1^2 = 1. \end{align*}

Now that we know the function is continuous, we can can compute the derivative using limits from the left and from the right. Using the function for $x \lt 1\text{,}$ we have $f(1+h) = (1+h)^2$ for $h \lt 0\text{.}$ Consequently, the slope computed from the left would be

\begin{align*} \frac{df}{dx} \Big|_{1^-} &= \lim_{h \to 0^-} \frac{f(1+h)-f(1)}{h} \\ &= \lim_{h \to 0^-} \frac{(1+h)^2 - 1}{h} \\ &= \lim_{h \to 0^-} \frac{1+2h+h^2 - 1}{h} \\ &= \lim_{h \to 0^-} \frac{2h+h^2}{h} \\ &= \lim_{h \to 0^-} 2+h \\ &= 2+0 = 2 \end{align*}

Next, using the function for $x \gt 1\text{,}$ we have $f(1+h) = 1+h$ when $h \gt 0\text{.}$ The slope computed from the right would be

\begin{align*} \frac{df}{dx} \Big|_{1^+} &= \lim_{h \to 0^+} \frac{f(1+h)-f(1)}{h} \\ &= \lim_{h \to 0^+} \frac{(1+h) - 1}{h} \\ &= \lim_{h \to 0^+} \frac{h}{h} \\ &= \lim_{h \to 0^+} 1 \\ &= 1 \end{align*}

With different limits from the left and right,

\begin{equation*} \frac{df}{dx}(1) = \lim_{h \to 0} \frac{f(1+h)-f(1)}{h} \end{equation*}

does not exist and $f$ is not differentiable at $x=1\text{.}$ The figure below illustrates the graph of this function, showing that there is a corner at $x=1\text{.}$

###### Example6.4.9

Consider the piecewise function defined by

\begin{equation*} f(x) = \begin{cases} x^2-3x+8 & x \lt 2, \\ 5x-x^2, & x \ge 2.\end{cases} \end{equation*}

Determine if $f$ is differentiable at $x=2\text{.}$

Solution

This function is continuous because the limit on the left and the limit on the right are equal to the value of the function at $x=2\text{,}$ as follows:

\begin{align*} \lim_{x \to 2^-}f(x) &= \lim_{x \to 2}(x^2-3x+8) = 2^2-3(2)+8 = 6,\\ \lim_{x \to 2^+}f(x) &= \lim_{x \to 2}(5x-x^2) = 5(2)-2^2 = 6,\\ f(2) &= 5(2)-2^2 = 6. \end{align*}

Now that we know the function is continuous, we can compute the derivative using left- and right-limits. Because $f(x) = x^2-3x+8$ for $x \lt 2\text{,}$ we have

\begin{equation*} f(2+h) = (2+h)^2-3(2+h)+8 = 6+h+h^2 \end{equation*}

when $h \lt 0\text{.}$ Consequently, the derivative from the left is

\begin{align*} \frac{df}{dx}\Big|_{2^-} &= \lim_{h \to 0^-} \frac{f(2+h)-f(2)}{h}\\ &= \lim_{h \to 0^-} \frac{(6+h+h^2) - 6}{h} \\ &= \lim_{h \to 0^-} \frac{h(1+h)}{h} \\ &= \lim_{h \to 0^-} 1+h \\ &= 1+0 = 1 \end{align*}

When $h \gt 0\text{,}$ we have

\begin{equation*} f(2+h) = 5(2+h)-(2+h)^2 = 6+h-h^2 \text{.} \end{equation*}

The derivative from the right is

\begin{align*} \frac{df}{dx}\Big|_{2^+} &= \lim_{h \to 0^+} \frac{f(2+h)-f(2)}{h}\\ &= \lim_{h \to 0^+} \frac{(6+h-h^2) - 6}{h} \\ &= \lim_{h \to 0^+} \frac{h(1-h)}{h} \\ &= \lim_{h \to 0^+} 1-h \\ &= 1-0 = 1 \end{align*}

Since the left and right limits computing the left and right derivatives are the same, we conclude that

\begin{equation*} \frac{df}{dx}(2) = \lim_{h \to 0}\frac{f(2+h)-f(2)}{h} = 1 \end{equation*}

So $f$ is differentiable at $x=2\text{.}$

The function consists of two parabolas joined together at $x=2\text{.}$ When the left and right derivatives agree, the function transitions smoothly with no corner at $x=2\text{.}$

### Subsection6.4.5Summary

• The derivative of a function $f$ is the function
\begin{equation*} \frac{df}{dx} : x=a \mapsto \frac{df}{dx}\Big|_{a} \end{equation*}
defined by the limit
\begin{equation*} \frac{df}{dx}(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} \end{equation*}
whenever the limit exists. Alternatively,
\begin{equation*} \frac{df}{dx}(x) = \lim_{t \to x} \frac{f(t) - f(x)}{t-x}. \end{equation*}
• The derivative function $\frac{df}{dx}$ is also written $f'(x)\text{.}$
• The value $f'(a)$ is the slope of the tangent line of $y=f(x)$ at $x=a\text{.}$
• Saying $f$ is differentiable at $x=a$ means $f'(a)$ exists. A function is not differentiable at any point where there is not a well-defined tangent line.
• If a function is differentiable, it must be continuous. If a function has a discontinuity, it will not be differentiable at that point.
• A function can be continuous without being differentiable. For example, a piecewise function that is continuous but that has mismatching slopes at a point (the graph shows a corner) will not be differentiable.

### Subsection6.4.6Exercises

For each function, compute the derivative using the definition of the derivative. Use the result to find the equation of the tangent line at $x=5\text{.}$

###### 1

$f(x) = 4x-7$

###### 2

$g(x) = x^2+4x$

###### 3

$k(x) = x^2 - 5x + 2$

###### 4

$p(t) = 3t-t^2$

###### 5

$q(x) = x^3$

###### 6

$\displaystyle V(p) = \frac{3}{p+2}$

###### 7

$\displaystyle F(x) = \frac{1}{2x-3}$

###### 8

$\displaystyle G(x) = \sqrt{x+4}$

###### 9

$\displaystyle H(x) = \sqrt{3x+1}$

For each piecewise function, determine if it is continuous and differentiable at the break point by evaluating the relevant limits.

###### 10

$\displaystyle f(x) = \begin{cases} 3x-2, & x \le 2, \\ x^2-x, & x \gt 2. \end{cases}$

###### 11

$\displaystyle g(x) = \begin{cases} 2x-3, & x \le 1, \\ x^2-2, & x \gt 1. \end{cases}$

###### 12

$\displaystyle k(x) = \begin{cases} x^2-2x, & x \lt 2, \\ -x^2+6x-8, & x \ge 2. \end{cases}$