Derivatives of Logarithmic and Exponential Functions

Once you've worked through polynomial and trig derivatives, logarithmic and exponential functions are the natural next step. They show up constantly in calculus — in differential equations, integration techniques, growth models, and more. The good news is the core rules are compact, and everything else follows from two of them.

The Natural Logarithm and e^x

Two functions are at the center of this topic: the natural exponential function \(e^x\) and the natural logarithm \(\ln x\). They're inverses of each other, and their derivatives have an elegance that makes them especially useful.

Derivative of e^x

$$\frac{d}{dx}\left(e^x\right) = e^x$$

The natural exponential function is its own derivative. This is one of the most remarkable facts in calculus — and it's not a coincidence. The constant \(e \approx 2.71828\) is defined precisely so that this property holds. It's the unique base for which the exponential function and its derivative are identical.

Derivative of ln x

$$\frac{d}{dx}\left(\ln x\right) = \frac{1}{x}$$

This can be derived using implicit differentiation. Start with \(y = \ln x\), which means \(e^y = x\). Differentiate both sides with respect to \(x\):

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

Note that \(\ln x\) is only defined for \(x > 0\), so this derivative only applies there. A related result: \(\frac{d}{dx}\left(\ln|x|\right) = \frac{1}{x}\), valid for all \(x \neq 0\).

Other Bases

For exponentials and logarithms with bases other than \(e\), use the base-change formulas to rewrite in terms of \(\ln\) and \(e^x\), then differentiate.

Derivative of a^x

Write \(a^x\) using the natural exponential: since \(a = e^{\ln a}\), we have \(a^x = e^{x \ln a}\). Now differentiate using the chain rule:

$$\frac{d}{dx}\left(a^x\right) = \frac{d}{dx}\left(e^{x\ln a}\right) = \ln a \cdot e^{x\ln a} = \ln a \cdot a^x$$

So:

$$\boxed{\frac{d}{dx}\left(a^x\right) = a^x \ln a}$$

When \(a = e\), \(\ln e = 1\) and this reduces to the familiar \(\frac{d}{dx}(e^x) = e^x\).

Derivative of log_a(x)

Use the change of base formula: \(\log_a x = \frac{\ln x}{\ln a}\). Since \(\ln a\) is a constant:

$$\frac{d}{dx}\left(\log_a x\right) = \frac{d}{dx}\left(\frac{\ln x}{\ln a}\right) = \frac{1}{\ln a} \cdot \frac{1}{x} = \frac{1}{x \ln a}$$

So:

$$\boxed{\frac{d}{dx}\left(\log_a x\right) = \frac{1}{x \ln a}}$$

Again, when \(a = e\), \(\ln e = 1\) and this reduces to \(\frac{d}{dx}(\ln x) = \frac{1}{x}\).

Quick Reference Table

Function Derivative
\(e^x\) \(e^x\)
\(\ln x\) \(\dfrac{1}{x}\)
\(a^x\) \(a^x \ln a\)
\(\log_a x\) \(\dfrac{1}{x \ln a}\)

Chain Rule Applications

The rules above handle simple functions of \(x\). When the argument is a more complex expression, the chain rule applies: differentiate the outer function, then multiply by the derivative of the inner function.

The general forms are:

$$\frac{d}{dx}\left(e^{u}\right) = e^{u} \cdot u' \qquad \frac{d}{dx}\left(\ln u\right) = \frac{u'}{u}$$

$$\frac{d}{dx}\left(a^{u}\right) = a^{u} \ln a \cdot u' \qquad \frac{d}{dx}\left(\log_a u\right) = \frac{u'}{u \ln a}$$

where \(u\) is a function of \(x\) and \(u'\) is its derivative.

Example 1: Differentiate \(e^{3x^2}\)

Here \(u = 3x^2\), so \(u' = 6x\):

$$\frac{d}{dx}\left(e^{3x^2}\right) = e^{3x^2} \cdot 6x = 6xe^{3x^2}$$

Example 2: Differentiate \(\ln(x^2 + 1)\)

Here \(u = x^2 + 1\), so \(u' = 2x\):

$$\frac{d}{dx}\left(\ln(x^2+1)\right) = \frac{2x}{x^2+1}$$

Example 3: Differentiate \(4^{x^3}\)

Here \(a = 4\), \(u = x^3\), \(u' = 3x^2\):

$$\frac{d}{dx}\left(4^{x^3}\right) = 4^{x^3} \cdot \ln 4 \cdot 3x^2 = 3x^2 \ln 4 \cdot 4^{x^3}$$

Example 4: Differentiate \(\ln!\left(\sin x\right)\)

Here \(u = \sin x\), \(u' = \cos x\):

$$\frac{d}{dx}\left(\ln(\sin x)\right) = \frac{\cos x}{\sin x} = \cot x$$

Example 5: Differentiate \(x^2 e^{-x}\)

This is a product, so use the product rule first, then the chain rule on the exponential:

$$\frac{d}{dx}\left(x^2 e^{-x}\right) = 2x \cdot e^{-x} + x^2 \cdot e^{-x} \cdot (-1) = e^{-x}(2x - x^2) = xe^{-x}(2 - x)$$

Practice Problems

1. Find \(\dfrac{d}{dx}\left(3^x\right)\). Show answer\(3^x \ln 3\).

2. Find \(\dfrac{d}{dx}\left(\log_5 x\right)\). Show answer\(\dfrac{1}{x \ln 5}\).

3. Find \(\dfrac{d}{dx}\left(e^{\cos x}\right)\). Show answerChain rule: \(u = \cos x\), \(u' = -\sin x\). Result: \(-\sin x \cdot e^{\cos x}\).

4. Find \(\dfrac{d}{dx}\left(\ln(3x^4 - 1)\right)\). Show answer\(u = 3x^4 - 1\), \(u' = 12x^3\). Result: \(\dfrac{12x^3}{3x^4 - 1}\).

5. Find \(\dfrac{d}{dx}\left(x \ln x\right)\). Show answerProduct rule: \(1 \cdot \ln x + x \cdot \dfrac{1}{x} = \ln x + 1\).

6. Find \(\dfrac{d}{dx}\left(e^{2x} \cdot \sin x\right)\). Show answerProduct rule: \(2e^{2x}\sin x + e^{2x}\cos x = e^{2x}(2\sin x + \cos x)\).