Lesson 21 of 24
In Progress

Derivatives of Exponential and Logarithmic Functions

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.

Derivative of the Exponential Function

Just as when we found the derivatives of other functions, we can find the derivatives of exponential and logarithmic functions using formulas. As we develop these formulas, we need to make certain basic assumptions. The proofs that these assumptions hold are beyond the scope of this course.

First of all, we begin with the assumption that the function B(x)=b^x, \, b>0″ height=”18″ width=”129″>, is defined for every real number and is continuous. In previous courses, the values of exponential functions for all rational numbers were defined—beginning with the definition of <img loading=, where n is a positive integer—as the product of b multiplied by itself n times. Later, we defined b^0=1, \, b^{−n}=\frac{1}{b^n} for a positive integer n, and b^{s/t}=(\sqrt[t]{b})^s for positive integers s and t. These definitions leave open the question of the value of b^r where r is an arbitrary real number. By assuming the continuity of B(x)=b^x, \, b>0″ height=”18″ width=”129″>, we may interpret <img loading= as \underset{x\to r}{\lim}b^x where the values of x as we take the limit are rational. For example, we may view {4}^{\pi} as the number satisfying

\begin{array}{l}4^3<4^{\pi}<4^4, \, 4^{3.1}<4^{\pi}<4^{3.2}, \, 4^{3.14}<4^{\pi}<4^{3.15},\\ 4^{3.141}<4^{\pi}<4^{3.142}, \, 4^{3.1415}<4^{\pi}<4^{3.1416}, \, \cdots \end{array}

As we see in the following table, 4^{\pi}\approx 77.88.


We also assume that for B(x)=b^x, \, b>0″ height=”18″ width=”129″>, the value <img loading= of the derivative exists. In this section, we show that by making this one additional assumption, it is possible to prove that the function B(x) is differentiable everywhere.

We make one final assumption: that there is a unique value of b>0 for which B^{\prime}(0)=1. We define e to be this unique value, as we did in Introduction to Functions and Graphs. (Figure) provides graphs of the functions y=2^x, \, y=3^x, \, y=2.7^x, and y=2.8^x. A visual estimate of the slopes of the tangent lines to these functions at 0 provides evidence that the value of e lies somewhere between 2.7 and 2.8. The function E(x)=e^x is called the natural exponential function. Its inverse, L(x)=\log_e x=\ln x is called the natural logarithmic function.

The graphs of 3x, 2.8x, 2.7x, and 2x are shown. In quadrant I, their order from least to greatest is 2x, 2.7x, 2.8x, and 3x. In quadrant II, this order is reversed. All cross the y-axis at (0, 1).
Figure 1. The graph of E(x)=e^x is between y=2^x and y=3^x.

For a better estimate of e, we may construct a table of estimates of B^{\prime}(0) for functions of the form B(x)=b^x. Before doing this, recall that

B^{\prime}(0)=\underset{x\to 0}{\lim}\frac{b^x-b^0}{x-0}=\underset{x\to 0}{\lim}\frac{b^x-1}{x} \approx \frac{b^x-1}{x}

for values of x very close to zero. For our estimates, we choose x=0.00001 and x=-0.00001 to obtain the estimate\frac{b^{-0.00001}-1}{-0.00001}<B^{\prime}(0)<\frac{b^{0.00001}-1}{0.00001}.

See the following table.


The evidence from the table suggests that 2.7182<e<2.7183.

The graph of E(x)=e^x together with the line y=x+1 are shown in (Figure). This line is tangent to the graph of E(x)=e^x at x=0.

Graph of the function ex along with its tangent at (0, 1), x + 1.
Figure 2. The tangent line to E(x)=e^x at x=0 has slope 1.

Now that we have laid out our basic assumptions, we begin our investigation by exploring the derivative of B(x)=b^x, \, b>0″ height=”18″ width=”129″>. Recall that we have assumed that <img loading= exists. By applying the limit definition to the derivative we conclude thatB^{\prime}(0)=\underset{h\to 0}{\lim}\frac{b^{0+h}-b^0}{h}=\underset{h\to 0}{\lim}\frac{b^h-1}{h}.

Turning to B^{\prime}(x), we obtain the following.

\begin{array}{lllll} B^{\prime}(x) & =\underset{h\to 0}{\lim}\frac{b^{x+h}-b^x}{h} & & & \text{Apply the limit definition of the derivative.} \\ & =\underset{h\to 0}{\lim}\frac{b^xb^h-b^x}{h} & & & \text{Note that} \, b^{x+h}=b^x b^h. \\ & =\underset{h\to 0}{\lim}\frac{b^x(b^h-1)}{h} & & & \text{Factor out} \, b^x. \\ & =b^x\underset{h\to 0}{\lim}\frac{b^h-1}{h} & & & \text{Apply a property of limits.} \\ & =b^x B^{\prime}(0) & & & \text{Use} \, B^{\prime}(0)=\underset{h\to 0}{\lim}\frac{b^{0+h}-b^0}{h}=\underset{h\to 0}{\lim}\frac{b^h-1}{h}. \end{array}

We see that on the basis of the assumption that B(x)=b^x is differentiable at 0, \, B(x) is not only differentiable everywhere, but its derivative isB^{\prime}(x)=b^x B^{\prime}(0).

For E(x)=e^x, \, E^{\prime}(0)=1. Thus, we have E^{\prime}(x)=e^x. (The value of B^{\prime}(0) for an arbitrary function of the form B(x)=b^x, \, b>0″ height=”18″ width=”129″>, will be derived later.)</p>

<h3>Derivative of the Natural Exponential Function</h3>

<p id=Let E(x)=e^x be the natural exponential function. ThenE^{\prime}(x)=e^x.

In general,\frac{d}{dx}(e^{g(x)})=e^{g(x)} g^{\prime}(x).

Derivative of an Exponential Function

Find the derivative of f(x)=e^{\tan (2x)}.


Using the derivative formula and the chain rule,

\begin{array}{ll} f^{\prime}(x) & =e^{\tan (2x)}\frac{d}{dx}(\tan (2x)) \\ & = e^{\tan (2x)} \sec^2 (2x) \cdot 2. \end{array}

Combining Differentiation Rules

Find the derivative of y=\frac{e^{x^2}}{x}.


Use the derivative of the natural exponential function, the quotient rule, and the chain rule.

\begin{array}{lllll} y^{\prime} & =\large \frac{(e^{x^2} \cdot 2x) \cdot x - 1 \cdot e^{x^2}}{x^2} & & & \text{Apply the quotient rule.} \\ & = \large \frac{e^{x^2}(2x^2-1)}{x^2} & & & \text{Simplify.} \end{array}

Find the derivative of h(x)=xe^{2x}.




Don’t forget to use the product rule.

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.


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?




Find A^{\prime}(4).

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″ height=”12″ width=”43″> and <img loading=, 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″ height=”18″ width=”70″>, the derivative of <img loading= is given byh^{\prime}(x)=\frac{1}{g(x)} g^{\prime}(x).


If x>0″ height=”12″ width=”43″> and <img loading=, then e^y=x. Differentiating both sides of this equation results in the equatione^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).

Graph of the function ln x along with its derivative 1/x. The function ln x is increasing on (0, + ∞). Its derivative is decreasing but greater than 0 on (0, + ∞).
Figure 3. The function y=\ln x is increasing on (0,+\infty). Its derivative y^{\prime} =\frac{1}{x} is greater than zero on (0,+\infty).

Taking a Derivative of a Natural Logarithm

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


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}).


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.




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

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″ height=”17″ width=”90″>.</p>

<h3>Derivatives of General Exponential and Logarithmic Functions</h3>

<p id=Let b>0, \, b\ne 1″ height=”17″ width=”90″>, and let <img loading= 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″ height=”18″ width=”66″>,<img loading=.
  2. If y=b^x, then\frac{dy}{dx}=b^x \ln b.More generally, if h(x)=b^{g(x)}, thenh^{\prime}(x)=b^{g(x)} g^{\prime}(x) \ln b.


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}.


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.


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.


9 \ln (3)


Evaluate the derivative at x=2.

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″ height=”13″ width=”40″> and <img loading=. 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}.


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}.


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.


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.


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


Follow the problem solving strategy.

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


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″ height=”17″ width=”100″> is continuous everywhere and differentiable at 0, this function is differentiable everywhere and there is a formula for its derivative.</li><li>We can use a formula to find the derivative of <img loading=, 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}