### Learning Objectives

• Find the derivative of all exponential functions.
• Find the derivative of logarithmic functions.
• Use logarithmic differentiation to determine the derivative of a function.

So far, we have learned how to differentiate a variety of functions, including trigonometric, inverse, and implicit functions. In this section, we explore derivatives of exponential and logarithmic functions. As we discussed in Introduction to Functions and Graphs , exponential functions play an important role in modeling population growth and the decay of radioactive materials. Logarithmic functions can help rescale large quantities and are particularly helpful for rewriting complicated expressions.

### Applying the Natural Exponential Function

A colony of mosquitoes has an initial population of 1000. After $t$ days, the population is given by $A(t)=1000e^{0.3t}$. Show that the ratio of the rate of change of the population, $A^{\prime}(t)$, to the population size, $A(t)$ is constant.

#### Solution

First find $A^{\prime}(t)$. By using the chain rule, we have $A^{\prime}(t)=300e^{0.3t}$. Thus, the ratio of the rate of change of the population to the population size is given by

$\large \frac{A^{\prime}(t)}{A(t)} \normalsize = \large \frac{300e^{0.3t}}{1000e^{0.3t}}=0.3$.

The ratio of the rate of change of the population to the population size is the constant 0.3.

If $A(t)=1000e^{0.3t}$ describes the mosquito population after $t$ days, as in the preceding example, what is the rate of change of $A(t)$ after 4 days?

#### Hint

Find $A^{\prime}(4)$.

996

# Derivative of the Logarithmic Function

Now that we have the derivative of the natural exponential function, we can use implicit differentiation to find the derivative of its inverse, the natural logarithmic function.

### The Derivative of the Natural Logarithmic Function

If $x < 0$ and $y=\ln x$, then

$\frac{dy}{dx}=\frac{1}{x}$.

More generally, let $g(x)$ be a differentiable function. For all values of $x$ for which $g^{\prime}(x) < 0$, the derivative of $h(x)=\ln(g(x))$ is given by

$h^{\prime}(x)=\frac{1}{g(x)} g^{\prime}(x)$.

## Proof

If $x < 0$ and $y=\ln x$, then $e^y=x$. Differentiating both sides of this equation results in the equation

$e^y\frac{dy}{dx}=1$.

Solving for $\frac{dy}{dx}$ yields

$\frac{dy}{dx}=\frac{1}{e^y}$.

Finally, we substitute $x=e^y$ to obtain

$\frac{dy}{dx}=\frac{1}{x}$.

We may also derive this result by applying the inverse function theorem, as follows. Since $y=g(x)=\ln x$ is the inverse of $f(x)=e^x$, by applying the inverse function theorem we have

$\frac{dy}{dx}=\frac{1}{f^{\prime}(g(x))}=\frac{1}{e^{\ln x}}=\frac{1}{x}$.

Using this result and applying the chain rule to $h(x)=\ln(g(x))$ yields

$h^{\prime}(x)=\frac{1}{g(x)} g^{\prime}(x). _\blacksquare$

The graph of $y=\ln x$ and its derivative $\frac{dy}{dx}=\frac{1}{x}$ are shown in (Figure) .

### Taking a Derivative of a Natural Logarithm

Find the derivative of $f(x)=\ln(x^3+3x-4)$.

#### Solution

Use (Figure) directly.

$\begin{array}{lllll} f^{\prime}(x) & =\frac{1}{x^3+3x-4} \cdot (3x^2+3) & & & \text{Use} \, g(x)=x^3+3x-4 \, \text{in} \, h^{\prime}(x)=\frac{1}{g(x)} g^{\prime}(x). \\ & =\frac{3x^2+3}{x^3+3x-4} & & & \text{Rewrite.} \end{array}$

### Using Properties of Logarithms in a Derivative

Find the derivative of $f(x)=\ln(\frac{x^2 \sin x}{2x+1})$.

#### Solution

At first glance, taking this derivative appears rather complicated. However, by using the properties of logarithms prior to finding the derivative, we can make the problem much simpler.

$\begin{array}{lllll} f(x) & = \ln(\frac{x^2 \sin x}{2x+1})=2\ln x+\ln(\sin x)-\ln(2x+1) & & & \text{Apply properties of logarithms.} \\ f^{\prime}(x) & = \frac{2}{x} + \frac{\cos x}{\sin x} -\frac{2}{2x+1} & & & \text{Apply sum rule and} \, h^{\prime}(x)=\frac{1}{g(x)} g^{\prime}(x). \\ & = \frac{2}{x} + \cot x - \frac{2}{2x+1} & & & \text{Simplify using the quotient identity for cotangent.} \end{array}$

Differentiate: $f(x)=\ln (3x+2)^5$.

#### Hint

Use a property of logarithms to simplify before taking the derivative.

#### Solution

$f^{\prime}(x)=\frac{15}{3x+2}$

Now that we can differentiate the natural logarithmic function, we can use this result to find the derivatives of $y=\log_b x$ and $y=b^x$ for $b < 0, \, b\ne 1$.

### Derivatives of General Exponential and Logarithmic Functions

Let $b < 0, \, b\ne 1$, and let $g(x)$ be a differentiable function.

1. If $y=\log_b x$, then
$\frac{dy}{dx}=\frac{1}{x \ln b}$.

More generally, if $h(x)=\log_b (g(x))$, then for all values of $x$ for which $g(x) < 0$,

$h^{\prime}(x)=\frac{g^{\prime}(x)}{g(x) \ln b}$.

2. If $y=b^x$, then
$\frac{dy}{dx}=b^x \ln b$.

More generally, if $h(x)=b^{g(x)}$, then

$h^{\prime}(x)=b^{g(x)} g^{\prime}(x) \ln b$.

## Proof

If $y=\log_b x$, then $b^y=x$. It follows that $\ln(b^y)=\ln x$. Thus $y \ln b = \ln x$. Solving for $y$, we have $y=\frac{\ln x}{\ln b}$. Differentiating and keeping in mind that $\ln b$ is a constant, we see that

$\frac{dy}{dx}=\frac{1}{x \ln b}$.

The derivative in (Figure) now follows from the chain rule.

If $y=b^x$, then $\ln y=x \ln b$. Using implicit differentiation, again keeping in mind that $\ln b$ is constant, it follows that $\frac{1}{y}\frac{dy}{dx}=\text{ln}b.$ Solving for $\frac{dy}{dx}$ and substituting $y=b^x$, we see that

$\frac{dy}{dx}=y \ln b=b^x \ln b$.

The more general derivative ( (Figure) ) follows from the chain rule. $_\blacksquare$

### Applying Derivative Formulas

Find the derivative of $h(x)=\large \frac{3^x}{3^x+2}$.

#### Solution

Use the quotient rule and (Figure) .

$\begin{array}{lllll} h^{\prime}(x) & = \large \frac{3^x \ln 3(3^x+2)-3^x \ln 3(3^x)}{(3^x+2)^2} & & & \text{Apply the quotient rule.} \\ & = \large \frac{2 \cdot 3^x \ln 3}{(3^x+2)^2} & & & \text{Simplify.} \end{array}$

### Finding the Slope of a Tangent Line

Find the slope of the line tangent to the graph of $y=\log_2 (3x+1)$ at $x=1$.

#### Solution

To find the slope, we must evaluate $\frac{dy}{dx}$ at $x=1$. Using (Figure) , we see that

$\frac{dy}{dx}=\frac{3}{\ln 2(3x+1)}$.

By evaluating the derivative at $x=1$, we see that the tangent line has slope

$\frac{dy}{dx}|_{x=1} =\frac{3}{4 \ln 2}=\frac{3}{\ln 16}$.

Find the slope for the line tangent to $y=3^x$ at $x=2$.

#### Hint

Evaluate the derivative at $x=2$.

#### Solution

$9 \ln (3)$

# Logarithmic Differentiation

At this point, we can take derivatives of functions of the form $y=(g(x))^n$ for certain values of $n$, as well as functions of the form $y=b^{g(x)}$, where $b < 0$ and $b\ne 1$. Unfortunately, we still do not know the derivatives of functions such as $y=x^x$ or $y=x^{\pi}$. These functions require a technique called logarithmic differentiation , which allows us to differentiate any function of the form $h(x)=g(x)^{f(x)}$. It can also be used to convert a very complex differentiation problem into a simpler one, such as finding the derivative of $y=\frac{x\sqrt{2x+1}}{e^x \sin^3 x}$. We outline this technique in the following problem-solving strategy.

### Problem-Solving Strategy: Using Logarithmic Differentiation

1. To differentiate $y=h(x)$ using logarithmic differentiation, take the natural logarithm of both sides of the equation to obtain $\ln y=\ln (h(x))$.
2. Use properties of logarithms to expand $\ln (h(x))$ as much as possible.
3. Differentiate both sides of the equation. On the left we will have $\frac{1}{y}\frac{dy}{dx}$.
4. Multiply both sides of the equation by $y$ to solve for $\frac{dy}{dx}$.
5. Replace $y$ by $h(x)$.

### Using Logarithmic Differentiation

Find the derivative of $y=(2x^4+1)^{\tan x}$.

#### Solution

Use logarithmic differentiation to find this derivative.

$\begin{array}{lllll} \ln y & = \ln (2x^4+1)^{\tan x} & & & \text{Step 1. Take the natural logarithm of both sides.} \\ \ln y & = \tan x \ln (2x^4+1) & & & \text{Step 2. Expand using properties of logarithms.} \\ \frac{1}{y}\frac{dy}{dx} & = \sec^2 x \ln (2x^4+1)+\frac{8x^3}{2x^4+1} \cdot \tan x & & & \begin{array}{l}\text{Step 3. Differentiate both sides. Use the} \\ \text{product rule on the right.} \end{array} \\ \frac{dy}{dx} & =y \cdot (\sec^2 x \ln (2x^4+1)+\frac{8x^3}{2x^4+1} \cdot \tan x) & & & \text{Step 4. Multiply by} \, y \, \text{on both sides.} \\ \frac{dy}{dx} & = (2x^4+1)^{\tan x}(\sec^2 x \ln (2x^4+1)+\frac{8x^3}{2x^4+1} \cdot \tan x) & & & \text{Step 5. Substitute} \, y=(2x^4+1)^{\tan x}.\end{array}$

### Using Logarithmic Differentiation

Find the derivative of $y=\large \frac{x\sqrt{2x+1}}{e^x \sin^3 x}$.

#### Solution

This problem really makes use of the properties of logarithms and the differentiation rules given in this chapter.

$\begin{array}{lllll} \ln y & = \ln \large \frac{x\sqrt{2x+1}}{e^x \sin^3 x} & & & \text{Step 1. Take the natural logarithm of both sides.} \\ \ln y & = \ln x+\frac{1}{2} \ln (2x+1)-x \ln e-3 \ln \sin x & & & \text{Step 2. Expand using properties of logarithms.} \\ \frac{1}{y}\frac{dy}{dx} & = \frac{1}{x}+\frac{1}{2x+1}-1-3\big(\frac{\cos x}{\sin x}\big) & & & \text{Step 3. Differentiate both sides.} \\ \frac{dy}{dx} & = y (\frac{1}{x}+\frac{1}{2x+1}-1-3 \cot x) & & & \text{Step 4. Multiply by} \, y \, \text{on both sides and simplify.} \\ \frac{dy}{dx} & = \large \frac{x\sqrt{2x+1}}{e^x \sin^3 x} \normalsize (\frac{1}{x}+\frac{1}{2x+1}-1-3 \cot x) & & & \text{Step 5. Substitute} \, y=\large \frac{x\sqrt{2x+1}}{e^x \sin^3 x}. \end{array}$

### Extending the Power Rule

Find the derivative of $y=x^r$ where $r$ is an arbitrary real number.

#### Solution

The process is the same as in (Figure) , though with fewer complications.

$\begin{array}{lllll} \ln y & = \ln x^r & & & \text{Step 1. Take the natural logarithm of both sides.} \\ \ln y & = r \ln x & & & \text{Step 2. Expand using properties of logarithms.} \\ \frac{1}{y}\frac{dy}{dx} & = r \frac{1}{x} & & & \text{Step 3. Differentiate both sides.} \\ \frac{dy}{dx} & = y \frac{r}{x} & & & \text{Step 4. Multiply by} \, y \, \text{on both sides.} \\ \frac{dy}{dx} & = x^r \frac{r}{x} & & & \text{Step 5. Substitute} \, y=x^r. \\ \frac{dy}{dx} & = rx^{r-1} & & & \text{Simplify.} \end{array}$

Use logarithmic differentiation to find the derivative of $y=x^x$.

#### Solution

$\frac{dy}{dx}=x^x(1+\ln x)$

Find the derivative of $y=(\tan x)^{\pi}$.

#### Hint

Use the result from (Figure) .

#### Solution

$y^{\prime}=\pi (\tan x)^{\pi -1} \sec^2 x$

### Key Concepts

• On the basis of the assumption that the exponential function $y=b^x, \, b < 0$ is continuous everywhere and differentiable at 0, this function is differentiable everywhere and there is a formula for its derivative.
• We can use a formula to find the derivative of $y=\ln x$, and the relationship $\log_b x=\frac{\ln x}{\ln b}$ allows us to extend our differentiation formulas to include logarithms with arbitrary bases.
• Logarithmic differentiation allows us to differentiate functions of the form $y=g(x)^{f(x)}$ or very complex functions by taking the natural logarithm of both sides and exploiting the properties of logarithms before differentiating.

# Key Equations

• Derivative of the natural exponential function
$\frac{d}{dx}(e^{g(x)})=e^{g(x)} g^{\prime}(x)$
• Derivative of the natural logarithmic function
$\frac{d}{dx}(\ln (g(x)))=\frac{1}{g(x)} g^{\prime}(x)$
• Derivative of the general exponential function
$\frac{d}{dx}(b^{g(x)})=b^{g(x)} g^{\prime}(x) \ln b$
• Derivative of the general logarithmic function
$\frac{d}{dx}(\log_b (g(x)))=\frac{g^{\prime}(x)}{g(x) \ln b}$

For the following exercises, find the first derivative for each function.

1.  $f(x)=2^{4x}+4x^2$

#### Solution

$f^{\prime}(x) = 2^{4x+2} \cdot \ln 2+8x$

2.  $f(t)=3^{\sin {3t}}$

3.  $f(x)=x^{\pi} \cdot \pi^x$

#### Solution

$f^{\prime}(x) = \pi x^{\pi -1} \cdot \pi^x + x^{\pi} \cdot \pi^x \ln \pi$

4.  $g(x)=\ln(4x^3+x)$

5.  $f(x)=\ln \sqrt{5x-7}$

#### Solution

$f^{\prime}(x) = \frac{5}{2(5x-7)}$

6.  $f(x)=x^2 \ln 9x$

7.  $f(x)=\log(\sec x)$

#### Solution

$f^{\prime}(x) = \frac{\tan x}{\ln 10}$

8.  $f(x)=\log_7 (6x^4+3)^5$

9.  $f(x)=2^x \cdot \log_3 7^{x^2-4}$

#### Solution

$f^{\prime}(x) = 2^x \cdot \ln 2 \cdot \log_3 7^{x^2-4} + 2^x \cdot \frac{2x \ln 7}{\ln 3}$

10. $h(z)=\ln (\frac{2z^2}{\sqrt[3]{z+8}})$

11. $f(x)= \ln |x^4 - 9x^2|$

#### Solution

$f^{\prime}(x) = \frac{4x^3 - 18x}{x^4 - 9x^2}$ for $x \ne -3,0,3$

12. $f(x)=\frac{\ln (x^2)}{2e^{3x} - \pi^7}$

13. $f(x)= \ln (e^{x^3} + \sqrt[5]{x^4})$

#### Solution

$f^{\prime}(x) = \frac{3x^2 e^{x^3} + \frac{4}{5} x^{-\frac{1}{4}}}{e^{x^3} + \sqrt[5]{x^4}}$

14. $f(x)= \log_8 (5^x - e^{2x} + \sqrt{x})$

15. $f(x)= 6 ^ {2x^2 -\pi x}$

#### Solution

$f^{\prime}(x) = 6 ^ {2x^2 -\pi x} (\ln 6) (4x - \pi)$

For the following exercises, use logarithmic differentiation to find $\frac{dy}{dx}$.

16.  $y=x^{\sqrt{x}}$

17.  $y=(\sin 2x)^{4x}$

#### Solution

$\frac{dy}{dx} = (\sin 2x)^{4x} [4 \cdot \ln(\sin 2x) + 8x \cdot \cot 2x]$

18.  $y=(\ln x)^{\ln x}$

19.  $y=x^{\log_2 x}$

#### Solution

$\frac{dy}{dx} = x^{\log_2 x} \cdot \frac{2 \ln x}{x \ln 2}$

20.  $y=(x^2-1)^{\ln x}$

21.  $y=x^{\cot x}$

#### Solution

$\frac{dy}{dx} = x^{\cot x} \cdot [-\csc^2 x \cdot \ln x+\frac{\cot x}{x}]$

22.  $y= \large \frac{x+11}{\sqrt[3]{x^2-4}}$

23.  $y=x^{-1/2}(x^2+3)^{2/3}(3x-4)^4$

#### Solution

$\frac{dy}{dx} = x^{-1/2}(x^2+3)^{2/3}(3x-4)^4 \cdot [\frac{-1}{2x}+\frac{4x}{3(x^2+3)}+\frac{12}{3x-4}]$

24. [T] Find an equation of the tangent line to the graph of $f(x)=4xe^{x^2-1}$ at the point where

$x=-1$. Graph both the function and the tangent line.

25. [T] Find the equation of the line that is normal to the graph of $f(x)=x \cdot 5^x$ at the point where $x=1$. Graph both the function and the normal line.

#### Solution

$y=\frac{-1}{5+5 \ln 5}x+(5+\frac{1}{5+5 \ln 5})$

26. [T] Find the equation of the tangent line to the graph of $x^3-x \ln y+y^3=2x+5$ at the point where $x=2$. ( Hint : Use implicit differentiation to find $\frac{dy}{dx}$.) Graph both the curve and the tangent line.

27.  Consider the function $y=x^{1/x}$ for $x < 0$.

1. Determine the points on the graph where the tangent line is horizontal.
2. Determine the intervals where $y^{\prime} < 0$ and those where $y^{\prime} < 0$.

#### Solution

a. $x=e \approx 2.718$
b. $y^{\prime} < 0$ on $(e,\infty)$, and $y^{\prime} < 0$ on $(0,e)$

28.  The formula $I(t)=\frac{\sin t}{e^t}$ is the formula for a decaying alternating current.

1. Complete the following table with the appropriate values.
$t$ $\frac{\sin t}{e^t}$
0 (i)
$\frac{\pi}{2}$ (ii)
$\pi$ (iii)
$\frac{3\pi}{2}$ (iv)
$2\pi$ (v)
$2\pi$ (vi)
$3\pi$ (vii)
$\frac{7\pi}{2}$ (viii)
$4\pi$ (ix)
2. Using only the values in the table, determine where the tangent line to the graph of $I(t)$ is horizontal.

29. [T] The population of Toledo, Ohio, in 2000 was approximately 500,000. Assume the population is increasing at a rate of 5% per year.

1. Write the exponential function that relates the total population as a function of $t$.
2. Use a. to determine the rate at which the population is increasing in $t$ years.
3. Use b. to determine the rate at which the population is increasing in 10 years.

#### Solution

a. $P=500,000(1.05)^t$ individuals
b. $P^{\prime}(t)=24395 \cdot (1.05)^t$ individuals per year
c. 39,737 individuals per year

30. [T] An isotope of the element erbium has a half-life of approximately 12 hours. Initially there are 9 grams of the isotope present.

1. Write the exponential function that relates the amount of substance remaining as a function of $t$, measured in hours.
2. Use a. to determine the rate at which the substance is decaying in $t$ hours.
3. Use b. to determine the rate of decay at $t=4$ hours.

31. [T] The number of cases of influenza in New York City from the beginning of 1960 to the beginning of 1961 is modeled by the function

$N(t)=5.3e^{0.093t^2-0.87t}, \, (0\le t\le 4)$,

where $N(t)$ gives the number of cases (in thousands) and $t$ is measured in years, with $t=0$ corresponding to the beginning of 1960.

1. Show work that evaluates $N(0)$ and $N(4)$. Briefly describe what these values indicate about the disease in New York City.
2. Show work that evaluates $N^{\prime}(0)$ and $N^{\prime}(3)$. Briefly describe what these values indicate about the disease in New York City.

#### Solution

a. At the beginning of 1960 there were 5.3 thousand cases of the disease in New York City. At the beginning of 1963 there were approximately 723 cases of the disease in New York City.
b. At the beginning of 1960 the number of cases of the disease was decreasing at rate of -4.611 thousand per year; at the beginning of 1963, the number of cases of the disease was decreasing at a rate of -0.2808 thousand per year.

32. [T] The relative rate of change of a differentiable function $y=f(x)$ is given by $\frac{100 \cdot f^{\prime}(x)}{f(x)}\%$. One model for population growth is a Gompertz growth function, given by $P(x)=ae^{-b \cdot e^{-cx}}$ where $a, \, b$, and $c$ are constants.

1. Find the relative rate of change formula for the generic Gompertz function.
2. Use a. to find the relative rate of change of a population in $x=20$ months when $a=204,b=0.0198,$ and $c=0.15.$
3. Briefly interpret what the result of b. means.

For the following exercises, use the population of New York City from 1790 to 1860, given in the following table.

New York City Population Over Time
 Years since 1790 Population 0 33,131 10 60,515 20 96,373 30 123,706 40 202,300 50 312,710 60 515,547 70 813,669

33. [T] Using a computer program or a calculator, fit a growth curve to the data of the form $p=ab^t$.

#### Solution

$p=35741(1.045)^t$

34. [T] Using the exponential best fit for the data, write a table containing the derivatives evaluated at each year.

35. [T] Using the exponential best fit for the data, write a table containing the second derivatives evaluated at each year.

#### Solution

Years since 1790 $P''$
0 69.25
10 107.5
20 167.0
30 259.4
40 402.8
50 625.5
60 971.4
70 1508.5

36. [T] Using the tables of first and second derivatives and the best fit, answer the following questions:

1. Will the model be accurate in predicting the future population of New York City? Why or why not?
2. Estimate the population in 2010. Was the prediction correct from a.?

## Glossary

logarithmic differentiation
is a technique that allows us to differentiate a function by first taking the natural logarithm of both sides of an equation, applying properties of logarithms to simplify the equation, and differentiating implicitly