# Calculus/Derivatives of Exponential and Logarithm Functions

 ← Implicit differentiation Calculus Some Important Theorems → Derivatives of Exponential and Logarithm Functions

## Exponential Function

First, we determine the derivative of $e^x$ using the definition of the derivative:

$\frac{d}{dx} e^x = \lim_{h \to 0} \frac{e^{x+h} - e^{x}}{h}$

Then we apply some basic algebra with powers (specifically that ab + c = ab ac):

$\frac{d}{dx} e^x = \lim_{h \to 0} \frac{e^{x} e^{h} - e^{x}}{h}$

Since ex does not depend on h, it is constant as h goes to 0. Thus, we can use the limit rules to move it to the outside, leaving us with:

$\frac{d}{dx} e^x = e^x \cdot \lim_{h \to 0} \frac{e^{h} - 1}{h}$

Now, the limit can be calculated by techniques we will learn later, for example Calculus/L'Hôpital's rule, and we will see that

$\lim_{h \to 0} \frac{e^h - 1}{h} = 1,$

so that we have proved the following rule:

 Derivative of the exponential function $\frac{d}{dx}e^x = e^x\,\!$

Now that we have derived a specific case, let us extend things to the general case. Assuming that a is a positive real constant, we wish to calculate:

$\frac{d}{dx}a^x$

One of the oldest tricks in mathematics is to break a problem down into a form that we already know we can handle. Since we have already determined the derivative of ex, we will attempt to rewrite ax in that form.

Using that eln(c) = c and that ln(ab) = b · ln(a), we find that:

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

Thus, we simply apply the chain rule:

$\frac{d}{dx}e^{x \cdot \ln(a)} = \frac{d}{dx} \left[ x\cdot \ln(a) \right] e^{x \cdot \ln(a)} = \ln(a) a^x$
 Derivative of the exponential function $\frac{d}{dx}a^x = \ln\left(a\right)a^x\,\!$

## Logarithm Function

Closely related to the exponentiation is the logarithm. Just as with exponents, we will derive the equation for a specific case first (the natural log, where the base is e), and then work to generalize it for any logarithm.

First let us create a variable y such that:

$y = \ln\left(x\right)$

It should be noted that what we want to find is the derivative of y or $\frac{dy}{dx}$.

Next we will put both sides to the power of e in an attempt to remove the logarithm from the right hand side:

$e^y = x$

Now, applying the chain rule and the property of exponents we derived earlier, we take the derivative of both sides:

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

This leaves us with the derivative:

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

Substituting back our original equation of x = ey, we find that:

 Derivative of the Natural Logarithm $\frac{d}{dx}\ln\left(x\right) = \frac{1}{x}\,\!$

If we wanted, we could go through that same process again for a generalized base, but it is easier just to use properties of logs and realize that:

$\log_b(x) = \frac{\ln(x)}{\ln(b)}$

Since 1 / ln(b) is a constant, we can just take it outside of the derivative:

$\frac{d}{dx}\log_b(x) = \frac{1}{\ln(b)} \cdot \frac{d}{dx} \ln(x)$

Which leaves us with the generalized form of:

 Derivative of the Logarithm $\frac{d}{dx}\log_b\left(x\right) = \frac{1}{x\ln\left(b\right)}\,\!$

## Logarithmic Differentiation

We can use the properties of the logarithm, particularly the natural log, to differentiate more difficult functions, such a products with many terms, quotients of composed functions, or functions with variable or function exponents. We do this by taking the natural logarithm of both sides, re-arranging terms using the logarithm laws below, and then differentiating both sides implicitly, before multiplying through by y.

 $\log\left(\frac{a}{b}\right) = \log(a) - \log(b)$ $\log(a^n) = n\log(a)\,\!$ $\log(a) + \log(b) = \log(ab)\,\!$

See the examples below.

Example 1
 Suppose we wished to differentiate $y = \frac{(6x^2+9)^2}{\sqrt{3x^3-2}}$ We take the natural logarithm of both sides \begin{align} \ln(y) & = \ln\Bigg(\frac{(6x^2+9)^2}{\sqrt{3x^3-2}}\Bigg) \\ & = \ln(6x^2+9)^2 - \ln(3x^3-2)^{\frac{1}{2}} \\ & = 2\ln(6x^2+9) - \frac{1}{2}\ln(3x^3-2) \\ \end{align} Differentiating implicitly, recalling the chain rule \begin{align} \frac{1}{y} \frac{dy}{dx} & = 2 \times \frac{12x}{6x^2+9} - \frac{1}{2} \times \frac{9x^2}{3x^3-2} \\ & = \frac{24x}{6x^2+9} - \frac{\frac{9}{2}x^2}{3x^3-2} \\ & = \frac{24x(3x^3-2) - \frac{9}{2}x^2(6x^2+9)}{(6x^2+9)(3x^3-2)} \\ \end{align} Multiplying by y, the original function $\frac{dy}{dx} = \frac{(6x^2+9)^2}{\sqrt{3x^3-2}} \times \frac{24x(3x^3-2) - \frac{9}{2}x^2(6x^2+9)}{(6x^2+9)(3x^3-2)}$
Example 2
 Let us differentiate a function $y=x^x\,\!$ Taking the natural logarithm of left and right \begin{align} \ln y & = \ln(x^x) \\ & = x\ln(x) \\ \end{align} We then differentiate both sides, recalling the product and chain rules \begin{align} \frac{1}{y} \frac{dy}{dx} & = \ln(x) + x\frac{1}{x} \\ & = \ln(x) + 1 \\ \end{align} Multiplying by the original function y $\frac{dy}{dx} = x^x(\ln(x) + 1)$
Example 3
 Take a function $y=x^{6\cos(x)}\,\!$ Then \begin{align} \ln y & = \ln(x^{6\cos(x)})\,\! \\ & = 6\cos(x)\ln(x)\,\! \\ \end{align} We then differentiate $\frac{1}{y} \frac{dy}{dx} = -6\sin(x)\ln(x)+\frac{6\cos(x)}{x}$ And finally multiply by y \begin{align} \frac{dy}{dx} & = y\Bigg(-6\sin(x)\ln(x)+\frac{6\cos(x)}{x}\Bigg)\\ & = x^{6\cos(x)}\Bigg(-6\sin(x)\ln(x)+\frac{6\cos(x)}{x}\Bigg)\\ \end{align}
 ← Implicit differentiation Calculus Some Important Theorems → Derivatives of Exponential and Logarithm Functions