# 7.3 Exponential and Logarithmic Functions

In this section we will define general exponential and logarithmic functions and find their derivatives.

## General exponential functions

margin: Figure 7.3.1: The function $2^{x}$ for rational values of $x$. Λ

Consider first the function $f(x)=2^{x}$. If $x$ is rational, then we know how to compute $2^{x}$. What do we mean by $2^{\pi}$ though? We compute this by first looking at $2^{r}$ for rational numbers $r$ that are very close to $\pi$, then finding a limit. In our case we might compute $2^{3}$, $2^{3.1}$, $2^{3.14}$, etc. We then define $2^{\pi}$ to be the limit of these numbers. Note that this is actually a different kind of limit than we have dealt with before since we only consider rational numbers close to $\pi$, not all real numbers close to $\pi$. We will see one way to make this more precise in Chapter 9. Graphically, we can plot the values of $2^{x}$ for $x$ rational and get something like the dotted curve in Figure 7.3.1. In order to define the remaining values, we are “connecting the dots” in a way that makes the function continuous.

It follows from continuity and the properties of limits that exponential functions will satisfy the familiar properties of exponents (see Section 2.0). This implies that margin: Figure 7.3.2: The functions $2^{x}$ and $2^{-x}$. Λ

 $\left(\frac{1}{2}\right)^{x}=(2^{-1})^{x}=2^{-x},$

so the graph of $g(x)=(1/2)^{x}$ is the reflection of $f$ across the $y$-axis, as in Figure 7.3.2.

We can go through the same process as above for any base $a>0$, though we are not usually interested in the constant function $1^{x}$.

###### Key Idea 7.3.1 Properties of Exponential Functions

For $a>0$ and $a\neq 1$ the exponential function $f(x)=a^{x}$ satisfies:

1. (a)

$a^{0}=1$

2. (b)

$\displaystyle\lim_{x\to\infty}a^{x}=\begin{cases}\infty&a>1\\ 0&a<1\end{cases}$

3. (c)

$a^{x}>0$ for all $x$

4. (d)

$\displaystyle\lim_{x\to-\infty}a^{x}=\begin{cases}0&a>1\\ \infty&a<1\end{cases}$

## Derivatives of exponential functions

Suppose $f(x)=a^{x}$ for some $a>0$. We can use the rules of exponents to find the derivative of $f$:

 $\displaystyle f\,^{\prime}(x)$ $\displaystyle=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$ $\displaystyle=\lim_{h\to 0}\frac{a^{x+h}-a^{x}}{h}$ $\displaystyle=\lim_{h\to 0}\frac{a^{x}a^{h}-a^{x}}{h}$ $\displaystyle=\lim_{h\to 0}\frac{a^{x}(a^{h}-1)}{h}$ $\displaystyle=a^{x}\lim_{h\to 0}\frac{a^{h}-1}{h}\qquad\text{(since a^{x} % does not depend on h)}$

So we know that $f\,^{\prime}(x)=\displaystyle a^{x}\lim_{h\to 0}\frac{a^{h}-1}{h}$, but can we say anything about that remaining limit? First we note that

 $f\,^{\prime}(0)=\lim_{h\to 0}\frac{a^{0+h}-a^{0}}{h}=\lim_{h\to 0}\frac{a^{h}-% 1}{h},$

so we have $f\,^{\prime}(x)=a^{x}f\,^{\prime}(0)$. The actual value of the limit $\displaystyle\lim_{h\to 0}\frac{a^{h}-1}{h}$ depends on the base $a$, but it can be proved that it does exist. We will figure out just what this limit is later, but for now we note that the easiest differentiation formulas come from using a base $a$ that makes $\displaystyle\lim_{h\to 0}\frac{a^{h}-1}{h}=1$. This base is the number $e\approx 2.71828$ and the exponential function $e^{x}$ is called the natural exponential function. This leads to the following result.

###### Theorem 7.3.1 Derivative of Exponential Functions

For any base $a>0$, the exponential function $f(x)=a^{x}$ has derivative $f\,^{\prime}(x)=a^{x}f\,^{\prime}(0)$. The natural exponential function $g(x)=e^{x}$ has derivative $g\mkern 1.35mu ^{\prime}(x)=e^{x}$.

## General logarithmic functions

Before reviewing general logarithmic functions, we’ll first remind ourselves of the laws of logarithms.

###### Key Idea 7.3.2 Properties of Logarithms

For $a,x,y>0$ and $a\neq 1$, we have
1.  $\log_{a}(xy)=\log_{a}x+\log_{a}y$ 2.  $\log_{a}\dfrac{x}{y}=\log_{a}x-\log_{a}y$ 3.  $\log_{x}y=\dfrac{\log_{a}y}{\log_{a}x}$, when $x\neq 1$   4.  $\log_{a}x^{y}=y\log_{a}x$ 5.  $\log_{a}1=0$ 6.  $\log_{a}a=1$

margin: Figure 7.3.3: The functions $y=a^{x}$ and $y=\log_{a}x$ for $a>1$. Λ

Let us consider the function $f(x)=a^{x}$ where $a\neq 1$. We know that $f\,^{\prime}(x)=f\,^{\prime}(0)a^{x}$, where $f\,^{\prime}(0)$ is a constant that depends on the base $a$. Since $a^{x}>0$ for all $x$, this implies that $f\,^{\prime}(x)$ is either always positive or always negative, depending on the sign of $f\,^{\prime}(0)$. This in turn implies that $f$ is strictly monotonic, so $f$ is one-to-one. We can now say that $f$ has an inverse. We call this inverse the logarithm with base $a$, denoted $f^{-1}(x)=\log_{a}x$. When $a=e$, this is the natural logarithm function $\ln x$. So we can say that $y=\log_{a}x$ if and only if $a^{y}=x$. Since the range of the exponential function is the set of positive real numbers, the domain of the logarithm function is also the set of positive real numbers. Reflecting the graph of $y=a^{x}$ across the line $y=x$ we find that (for $a>1$) the graph of the logarithm looks like Figure 7.3.3.

###### Key Idea 7.3.3 Properties of Logarithmic Functions

For $a>0$ and $a\neq 1$ the logarithmic function $f(x)=\log_{a}x$ satisfies:

1. (a)

The domain of $f(x)=log_{a}x$ is $(0,\infty)$ and the range is $(-\infty,\infty)$.

2. (b)

$y=\log_{a}x$ if and only if $a^{y}=x$.

3. (c)

$\displaystyle\lim_{x\to\infty}\log_{a}x=\begin{cases}\infty&\text{ if a>1}\\ -\infty&\text{ if a<1}\end{cases}$

4. (d)

$\displaystyle\lim_{x\to 0^{+}}\log_{a}x=\begin{cases}-\infty&\text{ if a>1}% \\ \infty&\text{ if a<1}\end{cases}$

Using the inverse of the natural exponential function, we can determine what the value of $f\,^{\prime}(0)$ is in the formula $(a^{x})^{\prime}=f\,^{\prime}(0)a^{x}$. To do so, we note that $a=e^{\ln a}$ since the exponential and logarithm functions are inverses. Hence we can write:

 $a^{x}=\left(e^{\ln a}\right)^{x}=e^{x\ln a}$

Now since $\ln a$ is a constant, we can use the Chain Rule to see that:

 $\frac{d}{\operatorname{d}\!x}a^{x}=\frac{d}{\operatorname{d}\!x}e^{x\ln a}=e^{% x\ln a}(\ln a)=a^{x}\ln a$

Comparing this to our previous result, we can restate our theorem:

###### Theorem 7.3.2 Derivative of Exponential Functions

For any base $a>0$, the exponential function $f(x)=a^{x}$ has derivative $f\,^{\prime}(x)=a^{x}\ln a$. The natural exponential function $g(x)=e^{x}$ has derivative $g\mkern 1.35mu ^{\prime}(x)=e^{x}$.

## Change of base

In the previous computation, we found it convenient to rewrite the general exponential function in terms of the natural exponential function. A related formula allows us to rewrite the general logarithmic function in terms of the natural logarithm. To see how this works, suppose that $y=\log_{a}x$, then we have:

 $\displaystyle a^{y}$ $\displaystyle=x$ $\displaystyle\ln(a^{y})$ $\displaystyle=\ln x$ $\displaystyle y\ln a$ $\displaystyle=\ln x$ $\displaystyle y$ $\displaystyle=\frac{\ln x}{\ln a}$ $\displaystyle\log_{a}x$ $\displaystyle=\frac{\ln x}{\ln a}.$

This change of base formula allows us to use facts about the natural logarithm to derive facts about the general logarithm.

## Derivatives of logarithmic functions

Since the natural logarithm function is the inverse of the natural exponential function, we can use the formula $(f^{-1}(x))^{\prime}=\dfrac{1}{f\,^{\prime}(f^{-1}(x))}$ to find the derivative of $y=\ln x$. We know that $\dfrac{\operatorname{d}\!}{\operatorname{d}\!x}e^{x}=e^{x}$, so we get:

 $\frac{\operatorname{d}\!}{\operatorname{d}\!x}\ln x=\frac{1}{e^{y}}=\frac{1}{e% ^{\ln x}}=\frac{1}{x}.$

Now we can apply the change of base formula to find the derivative of a general logarithmic function:

 $\frac{\operatorname{d}\!}{\operatorname{d}\!x}\log_{a}x=\frac{\operatorname{d}% \!}{\operatorname{d}\!x}\left(\frac{\ln x}{\ln a}\right)=\frac{1}{\ln a}\left(% \frac{\operatorname{d}\!}{\operatorname{d}\!x}\ln x\right)=\frac{1}{x\ln a}.$
###### Example 7.3.1 Finding Derivatives of Logs and Exponentials

Find derivatives of the following functions.

 $\text{1.}\quad f(x)=x3^{4x-7}\qquad\text{2.}\quad g(x)=2^{x^{2}}\qquad\text{3.% }\quad h(x)=\frac{x}{\log_{5}x}$

Solution

1. (a)

We apply both the Product and Chain Rules:

 $f\,^{\prime}(x)=3^{4x-7}+x\left(3^{4x-7}\ln 3\right)(4)=(1+4x\ln 3)3^{4x-7}$
2. (b)

We apply the Chain Rule:

 $g\mkern 1.35mu ^{\prime}(x)=2^{x^{2}}(\ln 2)(2x)=2^{x^{2}+1}x\ln 2.$
3. (c)

Applying the Quotient Rule:

 $h\mkern 1.35mu ^{\prime}(x)=\frac{\log_{5}x-x\left(\frac{1}{x\ln 5}\right)}{(% \log_{5}x)^{2}}=\frac{(\log_{5}x)(\ln 5)-1}{(\log_{5}x)^{2}\ln 5}$
###### Example 7.3.2 The Derivative of the Natural Log

Find the derivative of the function $y=\ln\left\lvert x\right\rvert$.

SolutionWe can rewrite our function as

 $y=\begin{cases}\ln x&\text{if x>0}\\ \ln(-x)&\text{if x<0}\\ \end{cases}$

Applying the Chain Rule, we see that $\frac{\operatorname{d}\!y}{\operatorname{d}\!x}=\frac{1}{x}$ for $x>0$, and $\frac{\operatorname{d}\!y}{\operatorname{d}\!x}=\frac{-1}{-x}=\frac{1}{x}$ for $x<0$. Hence we have

 $\frac{\operatorname{d}\!}{\operatorname{d}\!x}\ln\left\lvert x\right\rvert=% \frac{1}{x}\quad\text{ for x\neq 0.}$

## Antiderivatives

Combining these new results, we arrive at the following theorem:

###### Theorem 7.3.3 Derivatives and Antiderivatives of Exponentials and Logarithms

Given a base $a>0$ and $a\neq 1$, the following hold:

1. (a)

$\dfrac{\operatorname{d}\!}{\operatorname{d}\!x}e^{x}=e^{x}$

2. (b)

$\dfrac{\operatorname{d}\!}{\operatorname{d}\!x}a^{x}=a^{x}\ln a$

3. (c)

$\dfrac{\operatorname{d}\!}{\operatorname{d}\!x}\ln x=\dfrac{1}{x}$

4. (d)

$\dfrac{\operatorname{d}\!}{\operatorname{d}\!x}\log_{a}x=\dfrac{1}{x\ln a}$

5. (e)

$\displaystyle\int e^{x}\operatorname{d}\!x=e^{x}+C$

6. (f)

$\displaystyle\int a^{x}\operatorname{d}\!x=\frac{a^{x}}{\ln a}+C$

7. (g)

$\displaystyle\int\frac{\operatorname{d}\!x}{x}=\ln\left\lvert x\right\rvert+C$

###### Example 7.3.3 Finding Antiderivatives

Find the following antiderivatives.

 $\text{1. }\int 3^{x}\operatorname{d}\!x\qquad\text{2. }\int x^{2}e^{x^{3}}% \operatorname{d}\!x\qquad\text{3. }\int\frac{x\operatorname{d}\!x}{x^{2}+1}$

Solution

1. (a)

Applying our theorem,

 $\int 3^{x}\operatorname{d}\!x=\frac{3^{x}}{\ln 3}+C$
2. (b)

We use the substitution $u=x^{3}$, $\operatorname{d}\!u=3x^{2}\operatorname{d}\!x$:

 $\displaystyle\int x^{2}e^{x^{3}}\operatorname{d}\!x$ $\displaystyle=\frac{1}{3}\int e^{u}\operatorname{d}\!u$ $\displaystyle=\frac{1}{3}e^{u}+C$ $\displaystyle=\frac{1}{3}e^{x^{3}}+C$
3. (c)

Using the substitution $u=x^{2}+1$, $\operatorname{d}\!u=2x\operatorname{d}\!x$:

 $\displaystyle\int\frac{x\operatorname{d}\!x}{x^{2}+1}$ $\displaystyle=\frac{1}{2}\int\frac{\operatorname{d}\!u}{u}$ $\displaystyle=\frac{1}{2}\ln\left\lvert u\right\rvert+C$ $\displaystyle=\frac{1}{2}\ln\left\lvert x^{2}+1\right\rvert+C$ $\displaystyle=\frac{1}{2}\ln(x^{2}+1)+$

Note that we do not yet have an antiderivative for the function $f(x)=\ln x$. We remedy this in Section 8.1 with Example 8.1.5.

## Logarithmic Differentiation

margin: Figure 7.3.4: A plot of $y=x^{x}$. Λ

Consider the function $y=x^{x}$; it is graphed in Figure 7.3.4. It is well-defined for $x>0$ and we might be interested in finding equations of lines tangent and normal to its graph. How do we take its derivative?

The function is not a power function: it has a “power” of $x$, not a constant. It is not an exponential function: it has a “base” of $x$, not a constant.

A differentiation technique known as logarithmic differentiation becomes useful here. The basic principle is this: take the natural log of both sides of an equation $y=f(x)$, then use implicit differentiation to find $y\mkern 1.35mu ^{\prime}$. We demonstrate this in the following example.

###### Example 7.3.4 Using Logarithmic Differentiation

Given $y=x^{x}$, use logarithmic differentiation to find $y\mkern 1.35mu ^{\prime}$.

SolutionAs suggested above, we start by taking the natural log of both sides then applying implicit differentiation.

 $\displaystyle y$ $\displaystyle=x^{x}$ $\displaystyle\ln(y)$ $\displaystyle=\ln(x^{x})$ (apply logarithm rule) $\displaystyle\ln(y)$ $\displaystyle=x\ln x$ (now use implicit differentiation) $\displaystyle\frac{\operatorname{d}\!}{\operatorname{d}\!x}\Bigl{(}\ln(y)\Bigr% {)}$ $\displaystyle=\frac{\operatorname{d}\!}{\operatorname{d}\!x}\Bigl{(}x\ln x% \Bigr{)}$ $\displaystyle\frac{y\mkern 1.35mu ^{\prime}}{y}$ $\displaystyle=\ln x+x\cdot\frac{1}{x}$ $\displaystyle\frac{y\mkern 1.35mu ^{\prime}}{y}$ $\displaystyle=\ln x+1$ $\displaystyle y\mkern 1.35mu ^{\prime}$ $\displaystyle=y\bigl{(}\ln x+1\bigr{)}$ (substitute $y=x^{x}$) $\displaystyle y\mkern 1.35mu ^{\prime}$ $\displaystyle=x^{x}\bigl{(}\ln x+1\bigr{)}.$
margin: Figure 7.3.5: A graph of $y=x^{x}$ and its tangent line at $x=1.5$. Λ

To “test” our answer, let’s use it to find the equation of the tangent line at $x=1.5$. The point on the graph our tangent line must pass through is $(1.5,1.5^{1.5})\approx(1.5,1.837)$. Using the equation for $y\mkern 1.35mu ^{\prime}$, we find the slope as

 $y\mkern 1.35mu ^{\prime}=1.5^{1.5}\bigl{(}\ln 1.5+1\bigr{)}\approx 1.837(1.405% )\approx 2.582.$

Thus the equation of the tangent line is $y=2.582(x-1.5)+1.837$. Figure 7.3.5 graphs $y=x^{x}$ along with this tangent line.

## Exercises 7.3

### Problems

In Exercises 1–4., find the domain of the function.

1. 1.

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

2. 2.

$f(t)=\ln(1-t^{2})$

3. 3.

$g(x)=\ln(x^{2})$

4. 4.

$f(x)=\dfrac{2}{\log_{3}(x^{2}+1)}$

In Exercises 5–12., find the derivative of the function.

1. 5.

$f(t)=e^{t^{3}-1}$

2. 6.

$g(r)=r^{2}\log_{2}r$

3. 7.

$f(x)=\dfrac{\log_{5}x}{5^{x}}$

4. 8.

$f(x)=4^{x^{5}}$

5. 9.

$f(x)=7^{\log_{7}x}$

6. 10.

$g(x)=e^{x^{2}}\sin(x-\ln x)$

7. 11.

$h(r)=\tan^{-1}(3^{r})$

8. 12.

$h(x)=\log_{10}\left(\dfrac{x^{2}+1}{x^{4}}\right)$

In Exercises 13–24., evaluate the integral.

1. 13.

$\displaystyle\int_{0}^{2}5^{x}\operatorname{d}\!x$

2. 14.

$\displaystyle\int_{1}^{3}\frac{\log_{3}x}{x}\operatorname{d}\!x$

3. 15.

$\displaystyle\int x3^{x^{2}-1}\operatorname{d}\!x$

4. 16.

$\displaystyle\int\frac{\cos(\ln x)}{x}\operatorname{d}\!x$

5. 17.

$\displaystyle\int e^{x}\sin(e^{x})\cos(e^{x})\operatorname{d}\!x$

6. 18.

$\displaystyle\int_{1}^{8}\log_{2}x\operatorname{d}\!x$

7. 19.

$\displaystyle\int_{0}^{5}\frac{3^{x}}{3^{x}+2}\operatorname{d}\!x$

8. 20.

$\displaystyle\int\frac{1}{(1+x^{2})\tan^{-1}x}\operatorname{d}\!x$

9. 21.

$\displaystyle\int\frac{\ln x}{x}\operatorname{d}\!x$

10. 22.

$\displaystyle\int\frac{\bigl{(}\ln x\bigr{)}^{2}}{x}\operatorname{d}\!x$

11. 23.

$\displaystyle\int\frac{\ln\left(x^{3}\right)}{x}\operatorname{d}\!x$

12. 24.

$\displaystyle\int\frac{1}{x\ln\left(x^{2}\right)}\operatorname{d}\!x$

1. 25.

Find the two values of $n$ so that the function $y=e^{nx}$ satisfies the differential equation $y\mkern 1.35mu ^{\prime\prime}+y\mkern 1.35mu ^{\prime}-6y=0$.

2. 26.
Let $f(x)=x^{2}$ and $g(x)=2^{x}$. (a) Since $f(2)=2^{2}=4$ and $g(2)=2^{2}=4$, $f(2)=g(2)$. Find a positive number $c>2$ so that $f(c)=g(c)$. (b) Explain how you can be sure that there is at least one negative number $a$ so that $f(a)=g(a)$. (c) Use the Bisection Method to estimate the number $a$ accurate to within $.05$. (d) Assume you were to graph $f(x)$ and $g(x)$ on the same graph with unit length equal to 1 inch along both coordinate axes. Approximately how high is the graph of $f$ when $x=18$? The graph of $g$?

In Exercises 27–34., use logarithmic differentiation to find $\displaystyle\frac{\operatorname{d}\!y}{\operatorname{d}\!x}$, then find the equation of the tangent line at the indicated $x$-value.

1. 27.

$\displaystyle y=(1+x)^{1/x}$, $x=1$

2. 28.

$\displaystyle y=(2x)^{x^{2}}$, $x=1$

3. 29.

$\displaystyle y=\frac{x^{x}}{x+1}$, $x=1$

4. 30.

$\displaystyle y=x^{\sin(x)+2}$, $x=\pi/2$

5. 31.

$\displaystyle y=\frac{x+1}{x+2}$, $x=1$

6. 32.

$\displaystyle y=\frac{(x+1)(x+2)}{(x+3)(x+4)}$, $x=0$

7. 33.

$y=x^{e^{x}}$, $x=1$

8. 34.

$y=(\cot x)^{\cos x}$, $x=\pi$

1. 35.

The amount $y$ of C14 in an object decays according the the function $y(t)=y_{0}e^{-rt}$, where $y_{0}$ denotes the initial amount. If it takes 5730 years for half the initial amount to decay, find the rate constant $r$, and then determines how long it takes until only 10% remains. 