So far, we can differentiate power functions (\(x^n\)), exponential functions (\(b^x\)), and the two fundamental trigonometric functions (\(\sin(x)\) and \(\cos(x)\)). With the sum rule and constant multiple rules, we can also compute the derivative of combined functions.

###
Example 2.7.1.

Differentiate

\begin{equation*}
f(x) = 7x^{11} - 4 \cdot 9^x + \pi \sin(x) - \sqrt{3}\cos(x)
\end{equation*}

Because \(f\) is a sum of basic functions, we can now quickly say that \(f'(x) = 77x^{10} - 4 \cdot 9^x \ln(9) + \pi \cos(x) + \sqrt{3} \sin(x)\text{.}\)

What about a product or quotient of two basic functions, such as

\begin{equation*}
p(z) = z^3 \cos(z)\text{,}
\end{equation*}

or

\begin{equation*}
q(t) = \frac{\sin(t)}{2^t}\text{?}
\end{equation*}

While the derivative of a sum is the sum of the derivatives, it turns out that the rules for computing derivatives of products and quotients are more complicated.

###
Subsection 2.7.1 The product rule

As part (b) of

Warm-Up 2.7.1 shows, it is not true in general that the derivative of a product of two functions is the product of the derivatives of those functions. To see why this is the case, we consider an example involving meaningful functions.

Say that we are tracking carbon emissions for a particular population over time. Let \(N(t)\) represent the number of individuals on day \(t\text{,}\) where \(t = 0\) represents the first day on which we begin tracking. Let \(S(t)\) give the amount of carbon emissions from one individual on day \(t\text{;}\) the units on \(S(t)\) are pounds per person (the rate of carbon emissions). To compute the total carbon emissions for the whole population on day \(t\text{,}\) we take the product

\begin{equation*}
V(t) = N(t) \, \text{individuals} \cdot S(t) \, \text{pounds per individual}\text{.}
\end{equation*}

Observe that over time, both the number of individuals and the rate of carbon emissions will vary. The derivative \(N'(t)\) measures the rate at which the number of individuals is changing, while \(S'(t)\) measures the rate at which the carbon emission per individual is changing. How do these respective rates of change affect the rate of change of the total carbon emission function?

To help us understand the relationship among changes in \(N\text{,}\) \(S\text{,}\) and \(V\text{,}\) let’s consider some specific data.

Suppose that on day 100, there are 520 individuals and the rate of carbon emission is 2.75 pounds per individual. This tells us that \(N(100) = 520\) and \(S(100) = 2.75\text{.}\)

On day 100, the population grows by an additional 12 individuals (so the number of individuals is rising at a rate of 12 individuals per day).

On that same day the rate of carbon emissions is rising at a rate of 0.75 pounds per individual per day.

In calculus notation, the latter two facts tell us that \(N'(100) = 12\) (individuals per day) and \(S'(100) = 0.75\) (pounds per individual per day). At what rate is the total carbon emission changing on day 100?

Observe that the increase in total value comes from two sources: the growing number of individuals, and the rising rate of carbon emissions per individual. If only the number of individuals is increasing (and the value of the rate of carbon emission is constant), the rate at which total carbon emissions would rise is the product of the current rate of carbon emission and the rate at which the number of individuals is changing. That is, the rate at which total carbon emissions would change is given by

\begin{equation*}
S(100) \cdot N'(100) = 2.75 \, \frac{\text{pounds} }{\text{individual} } \cdot 12 \, \frac{\text{individuals} }{\text{day} } = 33 \, \frac{\text{pounds} }{\text{day} }\text{.}
\end{equation*}

Note particularly how the units make sense and show the rate at which the total value \(V\) is changing, measured in pounds per day.

If instead the number of individuals is constant, but the rate of carbon emissions is rising, the rate at which the total carbon emission would rise is the product of the number of individuals and the rate of change of the carbon emission rate. The total carbon emission is rising at a rate of

\begin{equation*}
N(100) \cdot S'(100) = 520 \, \text{individuals} \cdot 0.75 \, \frac{\text{pounds per individual} }{\text{day} } = 390 \, \frac{\text{pounds} }{\text{day} }\text{.}
\end{equation*}

Of course, when both the number of individuals and the rate of carbon emissions are changing, we have to include both of these sources. In that case the rate at which the total carbon emission is rising is

\begin{equation*}
V'(100) = S(100) \cdot N'(100) + N(100) \cdot S'(100) = 33 + 390 = 423 \, \frac{\text{pounds} }{\text{day} }\text{.}
\end{equation*}

We expect the total carbon emission from the population to rise by about 423 pounds on the 100th day.

^{ 1 }
Next, we expand our perspective from the specific example above to the more general and abstract setting of a product \(p\) of two differentiable functions, \(f\) and \(g\text{.}\) If \(P(x) = f(x) \cdot g(x)\text{,}\) our work above suggests that \(P'(x) = f'(x) g(x) + f(x)g'(x)\text{.}\) Indeed, a formal proof using the limit definition of the derivative can be given to show that the following rule, called the *product rule*, holds in general.

#### Product Rule.

If \(f\) and \(g\) are differentiable functions, then their product \(P(x) = f(x) \cdot g(x)\) is also a differentiable function, and

\begin{equation*}
P'(x) = f'(x) g(x) + f(x)g'(x) \text{.}
\end{equation*}

In light of the earlier example involving carbon emissions, the product rule also makes sense intuitively: the rate of change of \(P\) should take into account both how fast \(f\) and \(g\) are changing, as well as how large \(f\) and \(g\) are at the point of interest. In words the product rule says: if \(P\) is the product of two functions \(f\) (the first function) and \(g\) (the second), then “the derivative of \(P\) is the derivative of the first times the second, plus the first times the derivative of the second.” It is often a helpful mental exercise to say this phrasing aloud when executing the product rule.

####
Example 2.7.2.

If \(P(z) = z^3 \cdot \cos(z)\text{,}\) we can use the product rule to differentiate \(P\text{.}\) The first function is \(z^3\) and the second function is \(\cos(z)\text{.}\) By the product rule, \(P'\) will be given by the derivative of the first, \(3z^2\text{,}\) times the second, \(\cos(z)\text{,}\) plus the first, \(z^3\text{,}\) times the derivative of the second, \(-\sin(z)\text{.}\) That is,

\begin{equation*}
P'(z) = 3z^2 \cos(z)+ z^3(-\sin(z)) = 3z^2 \cos(z)-z^3 \sin(z) \text{.}
\end{equation*}

####
Activity 2.7.2.

Use the product rule to answer each of the questions below. Throughout, be sure to carefully label any derivative you find by name. It is not necessary to algebraically simplify any of the derivatives you compute.

Let \(m(w)=3w^{17} 4^w\text{.}\) Find \(m'(w)\text{.}\)

Let \(h(t) = (\sin(t) + \cos(t))t^4\text{.}\) Find \(h'(t)\text{.}\)

Determine the slope of the tangent line to the curve \(y = f(x)\) at the point where \(a = 1\) if \(f\) is given by the rule \(f(x) = e^x \sin(x)\text{.}\)

Find the equation of the tangent line to the function \(y = g(x)\) at the point where \(a = -1\) if \(g\) is given by the rule \(g(x) = (x^2 + x) 2^x\text{.}\)

###
Subsection 2.7.2 The quotient rule

Because quotients and products are closely linked, we can use the product rule to understand how to take the derivative of a quotient. Let \(Q(x)\) be defined by \(Q(x) = f(x)/g(x)\text{,}\) where \(f\) and \(g\) are both differentiable functions. It turns out that \(Q\) is differentiable everywhere that \(g(x) \ne 0\text{.}\) We would like a formula for \(Q'\) in terms of \(f\text{,}\) \(g\text{,}\) \(f'\text{,}\) and \(g'\text{.}\) Multiplying both sides of the formula \(Q = f/g\) by \(g\text{,}\) we observe that

\begin{equation*}
f(x) = Q(x) \cdot g(x)\text{.}
\end{equation*}

Now we can use the product rule to differentiate \(f\text{.}\)

\begin{equation*}
f'(x) = Q'(x)g(x) + Q(x) g'(x)\text{.}
\end{equation*}

We want to know a formula for \(Q'\text{,}\) so we solve this equation for \(Q'(x)\text{.}\)

\begin{equation*}
Q'(x) g(x) = f'(x) - Q(x) g'(x)
\end{equation*}

and dividing both sides by \(g(x)\text{,}\) we have

\begin{equation*}
Q'(x) = \frac{f'(x) - Q(x) g'(x)}{g(x)}\text{.}
\end{equation*}

Finally, we recall that \(Q(x) = \frac{f(x)}{g(x)}\text{.}\) Substituting this expression in the preceding equation, we have

\begin{align*}
Q'(x) =\mathstrut \amp \frac{f'(x) - \frac{f(x)}{g(x)} g'(x)}{g(x)}\\
=\mathstrut \amp \frac{f'(x) - \frac{f(x)}{g(x)} g'(x)}{g(x)} \cdot \frac{g(x)}{g(x)}\\
=\mathstrut \amp \frac{ f'(x)g(x) - f(x) g'(x)}{g(x)^2}\text{.}
\end{align*}

This calculation gives us the *quotient rule*.

#### Quotient Rule.

If \(f\) and \(g\) are differentiable functions, then their quotient \(Q(x) = \frac{f(x)}{g(x)}\) is also a differentiable function for all \(x\) where \(g(x) \ne 0\) and

\begin{equation*}
Q'(x) = \frac{f'(x)g(x) - f(x) g'(x)}{g(x)^2}\text{.}
\end{equation*}

As with the product rule, it can be helpful to think of the quotient rule verbally. If a function \(Q\) is the quotient of a top function \(f\) and a bottom function \(g\text{,}\) then \(Q'\) is given by “the derivative of the top times the bottom, minus the top times the derivative of the bottom, all over the bottom squared.” Note that remembering the order of the product rule given in the previous subsection can help in remembering the correct order for the numerator of the quotient rule.

####
Example 2.7.3.

If \(Q(t) = \sin(t)/2^t\text{,}\) we call \(\sin(t)\) the top function and \(2^t\) the bottom function. By the quotient rule, \(Q'\) is given by the derivative of the top, \(\cos(t)\) times the bottom, \(2^t\text{,}\) minus the top, \(\sin(t)\text{,}\) times the derivative of the bottom, \(2^t \ln(2)\text{,}\) all over the bottom squared, \((2^t)^2\text{.}\) That is,

\begin{equation*}
Q'(t) = \frac{ \cos(t)2^t - \sin(t) 2^t \ln(2)}{(2^t)^2}\text{.}
\end{equation*}

In this particular example, it is possible to simplify \(Q'(t)\) by removing a factor of \(2^t\) from both the numerator and denominator, so that

\begin{equation*}
Q'(t) = \frac{\cos(t) - \sin(t) \ln(2)}{2^t}\text{.}
\end{equation*}

In general, we must be careful in doing any such simplification, as we don’t want to execute the quotient rule correctly but then make an algebra error.

####
Activity 2.7.3.

Use the quotient rule to answer each of the questions below. Throughout, be sure to carefully label any derivative you find by name. That is, if you’re given a formula for \(f(x)\text{,}\) clearly label the formula you find for \(f'(x)\text{.}\) It is not necessary to algebraically simplify any of the derivatives you compute.

Let \(r(z)=\frac{3^z}{z^4 + 1}\text{.}\) Find \(r'(z)\text{.}\)

Let \(v(t) = \frac{\sin(t)}{\cos(t) + t^2}\text{.}\) Find \(v'(t)\text{.}\)

Determine the slope of the tangent line to the curve \(\displaystyle R(x) = \frac{x^2 - 2x - 8}{x^2 - 9}\) at the point where \(x = 0\text{.}\)

When a camera flashes, the intensity \(I\) of light seen by the eye is given by the function

\begin{equation*}
I(t) = \frac{100t}{e^t}\text{,}
\end{equation*}

where \(I\) is measured in candles and \(t\) is measured in milliseconds. Compute \(I'(0.5)\text{,}\) \(I'(2)\text{,}\) and \(I'(5)\text{;}\) include appropriate units on each value; and discuss the meaning of each.

###
Subsection 2.7.3 Combining rules

In order to apply the derivative shortcut rules correctly we must recognize the fundamental structure of a function.

####
Example 2.7.4.

Determine the derivative of the function

\begin{equation*}
f(x) = x\sin(x) + \frac{x^2}{\cos(x) + 2}\text{.}
\end{equation*}

How do we decide which rules to apply? Our first task is to recognize the structure of the function. This function

\(f\) is a sum of two slightly less complicated functions, so we can apply the sum rule

^{ 2 } to get

\begin{align*}
f'(x) =\mathstrut \amp \frac{d}{dx} \left[ x\sin(x) + \frac{x^2}{\cos(x) + 2} \right]\\
=\mathstrut \amp \frac{d}{dx} \left[ x\sin(x) \right] + \frac{d}{dx}\left[ \frac{x^2}{\cos(x) + 2} \right]
\end{align*}

Now, the left-hand term above is a product, so the product rule is needed there, while the right-hand term is a quotient, so the quotient rule is required. Applying these rules respectively, we find that

\begin{align*}
f'(x) =\mathstrut \amp \left( x \cos(x) + \sin(x) \right) + \frac{(\cos(x) + 2) 2x - x^2(-\sin(x))}{(\cos(x) + 2)^2}\\
=\mathstrut \amp x \cos(x) + \sin(x) + \frac{2x\cos(x) + 4x + x^2\sin(x)}{(\cos(x) + 2)^2}\text{.}
\end{align*}

####
Example 2.7.5.

Differentiate

\begin{equation*}
s(y) = \frac{y \cdot 7^y}{y^2 + 1}\text{.}
\end{equation*}

The function \(s\) is a quotient of two simpler functions, so the quotient rule will be needed. To begin, we set up the quotient rule and use the notation \(\frac{d}{dy}\) to indicate the derivatives of the numerator and denominator. Thus,

\begin{equation*}
s'(y) = \frac{\frac{d}{dy}\left[ y \cdot 7^y \right] \cdot(y^2 + 1) - y \cdot 7^y \cdot \frac{d}{dy}\left[y^2 + 1 \right]}{(y^2 + 1)^2}\text{.}
\end{equation*}

Now, there remain two derivatives to calculate. The first one, \(\frac{d}{dy}\left[ y \cdot 7^y \right]\) calls for use of the product rule, while the second, \(\frac{d}{dy}\left[y^2 + 1 \right]\) needs only the sum rule. Applying these rules, we now have

\begin{equation*}
s'(y) = \frac{[1 \cdot 7^y + y \cdot 7^y \ln(7) ](y^2 + 1) - y \cdot 7^y [2y]}{(y^2 + 1)^2}\text{.}
\end{equation*}

While some simplification is possible, we are content to leave \(s'(y)\) in its current form.

Success in applying derivative rules begins with recognizing the structure of the function, followed by the careful and diligent application of the relevant derivative rules. The best way to become proficient at this process is to do a large number of examples.

####
Activity 2.7.4.

Use relevant derivative rules to answer each of the questions below. Throughout, be sure to use proper notation and carefully label any derivative you find by name.

Let \(f(r) = (5r^3 + \sin(r))(4^r - 2\cos(r))\text{.}\) Find \(f'(r)\text{.}\)

Let \(\displaystyle p(t) = \frac{\cos(t)}{t^6 \cdot 6^t}\text{.}\) Find \(p'(t)\text{.}\)

Let \(g(z) = 3z^7 e^z - 2z^2 \sin(z) + \frac{z}{z^2 + 1}\text{.}\) Find \(g'(z)\text{.}\)

A moving particle has its position in feet at time \(t\) in seconds given by the function \(s(t) = \frac{3\cos(t) - \sin(t)}{e^t}\text{.}\) Find the particle’s instantaneous velocity at the moment \(t = 1\text{.}\)

Suppose that \(f(x)\) and \(g(x)\) are differentiable functions and it is known that \(f(3) = -2\text{,}\) \(f'(3) = 7\text{,}\) \(g(3) = 4\text{,}\) and \(g'(3) = -1\text{.}\) If \(p(x) = f(x) \cdot g(x)\) and \(\displaystyle q(x) = \frac{f(x)}{g(x)}\text{,}\) calculate \(p'(3)\) and \(q'(3)\text{.}\)

As the algebraic complexity of the functions we are able to differentiate continues to increase, it is important to remember that all of the derivative’s meaning continues to hold. Regardless of the structure of the function \(f\text{,}\) the value of \(f'(a)\) tells us the instantaneous rate of change of \(f\) with respect to \(x\) at the moment \(x = a\text{,}\) as well as the slope of the tangent line to \(y = f(x)\) at the point \((a,f(a))\text{.}\)