Home›Courses›Calculus I›§4.3 Differentiation of Exp & Log
Pre-CalculusCalculus ILinear Algebra I
Calculus I  ·  Chapter 4  ·  Section 4.3

Differentiation of Exponential
& Logarithmic Functions

The Calculus of Growth and Decay

The derivatives of $e^x$ and $\ln x$ are the two most elegant results in elementary calculus — and the engine behind every model of growth, decay, and optimisation in the sciences.

Why This Section Matters

The Function That Is
Its Own Derivative

The Most Remarkable Fact in Calculus

Every function you have differentiated so far changes when you differentiate it. $x^3$ becomes $3x^2$. $\sin x$ becomes $\cos x$. Something always changes.

Except one. The function $f(x) = e^x$ satisfies $f'(x) = e^x = f(x)$. It is its own derivative. This is not a coincidence — it is the defining property of $e$, and it is the reason $e$ appears in every natural growth model in physics, biology, economics, and engineering.

The corresponding result for logarithms, $\frac{d}{dx}[\ln x] = \frac{1}{x}$, gives us the antiderivative of $1/x$ — the one missing case from the power rule (which fails at $n=-1$). Together, these two derivatives unlock an entirely new class of problems.

Coming back full circle: In §4.1 we computed doubling times. In §4.2 we solved exponential equations. Now we add the missing piece — the rate of change of exponential and logarithmic functions — which lets us optimise, find marginal quantities, and analyse elasticity.
§ 1 — Core Derivative Formulas

The Two Fundamental
Derivative Rules

Derivative of eˣ

$$\frac{d}{dx}[e^x] = e^x$$

The exponential function is its own derivative.

From the limit definition:

$$\frac{d}{dx}[e^x] = \lim_{h\to 0}\frac{e^{x+h}-e^x}{h} = \lim_{h\to 0}\frac{e^x(e^h-1)}{h} = e^x\lim_{h\to 0}\frac{e^h-1}{h}$$

The key limit: $\lim_{h\to 0}\frac{e^h-1}{h} = 1$ (this can be shown using L\'Hôpital\'s rule or the series expansion of $e^h$).

$$\Rightarrow \frac{d}{dx}[e^x] = e^x \cdot 1 = e^x \quad \blacksquare$$

Derivative of ln x

$$\frac{d}{dx}[\ln x] = \frac{1}{x}, \quad x > 0$$

Valid for $x>0$. For all $x\neq 0$: $\frac{d}{dx}[\ln|x|]=\frac{1}{x}$.

Using implicit differentiation: If $y=\ln x$, then $e^y=x$. Differentiate both sides:

$$e^y\frac{dy}{dx} = 1 \Rightarrow \frac{dy}{dx} = \frac{1}{e^y} = \frac{1}{x} \quad \blacksquare$$

Direct limit approach:

$$\frac{d}{dx}[\ln x] = \lim_{h\to 0}\frac{\ln(x+h)-\ln x}{h} = \lim_{h\to 0}\frac{1}{h}\ln\!\left(1+\frac{h}{x}\right) = \frac{1}{x}\lim_{t\to 0}\frac{\ln(1+t)}{t} = \frac{1}{x}$$

📐 Derivative Explorer — f(x) and f'(x)
x = 1 — drag to see tangent slope
💡 f'(x) = f(x) — the function IS its own derivative!
§ 2 — Chain Rule Versions

When the Exponent or
Argument is a Function

Chain Rule — eᵘ

$$\frac{d}{dx}[e^{u(x)}] = e^{u(x)}\cdot u'(x)$$

Differentiate the exponent, multiply by $e^u$.

Chain Rule — ln u

$$\frac{d}{dx}[\ln u(x)] = \frac{u'(x)}{u(x)}$$

Derivative of inside over inside.

How to remember: For $e^u$ — multiply by $u'$. For $\ln u$ — divide by $u$ (and multiply by $u'$). In both cases the chain rule says: derivative of outside × derivative of inside.
§ 3 — Differentiating eˣ and its Variants

Example Set 1:
Exponential Derivatives

Example 1 — Differentiating Exponential Functions

Find the derivative of each function:

(a)$f(x)=e^{3x}$

Chain rule: $u=3x$, $u'=3$.

$$f'(x)=3e^{3x}$$

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

Chain rule: $u=x^2+1$, $u'=2x$.

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

(c)$f(x)=x^3 e^{2x}$

Product rule: $(x^3)'e^{2x}+x^3(e^{2x})'$.

$$f'(x)=3x^2e^{2x}+x^3\cdot 2e^{2x}=e^{2x}(3x^2+2x^3)=\boxed{x^2e^{2x}(3+2x)}$$

(d)$f(x)=\dfrac{e^x}{1+e^x}$

Quotient rule:

$$f'(x)=\frac{e^x(1+e^x)-e^x\cdot e^x}{(1+e^x)^2}=\frac{e^x+e^{2x}-e^{2x}}{(1+e^x)^2}=\boxed{\frac{e^x}{(1+e^x)^2}}$$

(e)$f(x)=e^{\sqrt{x}}$

Chain rule: $u=x^{1/2}$, $u'=\frac{1}{2\sqrt{x}}$.

$$f'(x)=e^{\sqrt{x}}\cdot\frac{1}{2\sqrt{x}}=\boxed{\frac{e^{\sqrt{x}}}{2\sqrt{x}}}$$

§ 4 — Differentiating ln x and its Variants

Example Set 2:
Logarithmic Derivatives

Example 2 — Differentiating Logarithmic Functions

Find $f'(x)$ for each:

(a)$f(x)=\ln(3x+1)$

$u=3x+1$, $u'=3$. Chain rule: $\boxed{f'(x)=\frac{3}{3x+1}}$.

(b)$f(x)=\ln(x^2+5x)$

$u=x^2+5x$, $u'=2x+5$.

$$f'(x)=\frac{2x+5}{x^2+5x}=\boxed{\frac{2x+5}{x(x+5)}}$$

(c)$f(x)=x^2\ln x$

Product rule: $(x^2)'\ln x + x^2(\ln x)'=2x\ln x+x^2\cdot\frac{1}{x}=\boxed{2x\ln x+x}$.

(d)$f(x)=\ln\!\left(\dfrac{x^2}{x+1}\right)$

Expand first using log rules: $\ln x^2 - \ln(x+1) = 2\ln x - \ln(x+1)$.

$$f'(x)=\frac{2}{x}-\frac{1}{x+1}=\boxed{\frac{x+2}{x(x+1)}}$$

(e)$f(x)=\ln\sqrt{(x+1)(x^2+3)}$

Simplify first: $\frac{1}{2}[\ln(x+1)+\ln(x^2+3)]$.

$$f'(x)=\frac{1}{2}\left(\frac{1}{x+1}+\frac{2x}{x^2+3}\right)=\boxed{\frac{1}{2(x+1)}+\frac{x}{x^2+3}}$$

§ 5 — Derivatives for General Bases

Differentiating $b^x$ and
$\log_b x$ for Any Base

Derivative of bˣ

$$\frac{d}{dx}[b^x] = b^x \ln b$$

Write $b^x = e^{x\ln b}$. Then:

$$\frac{d}{dx}[e^{x\ln b}] = e^{x\ln b}\cdot\ln b = b^x\ln b \quad\blacksquare$$

Derivative of log_b x

$$\frac{d}{dx}[\log_b x] = \frac{1}{x\ln b}$$

Write $\log_b x = \frac{\ln x}{\ln b}$. Since $\ln b$ is constant:

$$\frac{d}{dx}\left[\frac{\ln x}{\ln b}\right] = \frac{1}{\ln b}\cdot\frac{1}{x} = \frac{1}{x\ln b} \quad\blacksquare$$

Note: When $b=e$: $\frac{d}{dx}[e^x]=e^x\ln e=e^x$ ✓ and $\frac{d}{dx}[\log_e x]=\frac{1}{x\ln e}=\frac{1}{x}$ ✓. The natural base gives the cleanest formulas — no extra $\ln b$ factor.

Example 3 — Differentiate $f(x)=3^x$, $g(x)=10^{2x}$, $h(x)=\log_5(x^2+1)$

$f'(x)=3^x\ln 3$

$g'(x)=10^{2x}\cdot\ln 10\cdot 2=2\ln 10\cdot 10^{2x}$ (chain rule)

$h'(x)=\dfrac{1}{(x^2+1)\ln 5}\cdot 2x=\dfrac{2x}{(x^2+1)\ln 5}$ (chain rule)

Example 4 — Find all critical points of $f(x)=x\cdot 2^x$

Product rule: $f'(x)=2^x+x\cdot 2^x\ln 2=2^x(1+x\ln 2)$.

Set $f'(x)=0$: Since $2^x>0$ always, we need $1+x\ln 2=0$.

$$x=-\frac{1}{\ln 2}\approx -1.443$$

$f''(x)=2^x\ln 2(1+x\ln 2)+2^x\ln 2=2^x\ln 2(2+x\ln 2)$. At critical point: positive → local minimum.

§ 6 — Applications

Calculus with Exponential
& Logarithmic Functions

Marginal Revenue with Logarithmic Demand

A commodity's demand function is often logarithmic at high quantities. The derivative gives us marginal revenue — the revenue from selling one additional unit.

Example 5

Marginal Revenue — Log Demand

The demand for a product is $p = 120 - 30\ln q$ (PKR). Find the revenue function $R(q)$ and marginal revenue $R'(q)$. At what quantity is marginal revenue zero?

Revenue: $R(q)=q\cdot p=q(120-30\ln q)=120q-30q\ln q$

Marginal revenue (product rule for $q\ln q$):

$$R'(q)=120-30(\ln q+q\cdot\tfrac{1}{q})=120-30\ln q-30=\boxed{90-30\ln q}$$

Set $R'=0$: $90=30\ln q \Rightarrow \ln q=3 \Rightarrow q=e^3\approx 20.1$ units.

For $q<e^3$: MR$>0$ (revenue increasing). For $q>e^3$: MR$<0$ (revenue decreasing). Maximum revenue at $q=e^3$.

Example 6

Marginal Cost — Exponential Cost Function

A company's total cost is $C(q)=500+200e^{0.02q}$ (PKR). Find marginal cost at $q=50$ and $q=100$ units.

$C'(q)=200\cdot 0.02\cdot e^{0.02q}=4e^{0.02q}$

$C'(50)=4e^1=4e\approx\text{PKR }10.87$ per unit.

$C'(100)=4e^2\approx\text{PKR }29.56$ per unit. The marginal cost grows exponentially — each additional unit costs more than the previous.

Example 7

Marginal Revenue — Another Log Demand

Demand: $p=\dfrac{400}{\ln(q+1)}$ PKR. Find $R'(q)$ and evaluate at $q=9$.

$R(q)=\dfrac{400q}{\ln(q+1)}$. Quotient rule:

$$R'(q)=\frac{400\ln(q+1)-400q\cdot\frac{1}{q+1}}{[\ln(q+1)]^2}=\frac{400\left[\ln(q+1)-\frac{q}{q+1}\right]}{[\ln(q+1)]^2}$$

At $q=9$: $\ln 10\approx2.303$, $\frac{9}{10}=0.9$.

$R'(9)=\dfrac{400(2.303-0.9)}{(2.303)^2}\approx\dfrac{400\times1.403}{5.303}\approx\boxed{\text{PKR }105.8}$

Example 8

Optimisation — Maximising Profit

Profit: $P(q)=400q e^{-0.05q}-1000$ (PKR). Find the production level that maximises profit.

Product rule:

$$P'(q)=400e^{-0.05q}+400q\cdot(-0.05)e^{-0.05q}=400e^{-0.05q}(1-0.05q)$$

Since $400e^{-0.05q}>0$: set $1-0.05q=0 \Rightarrow \boxed{q=20}$ units.

$P(20)=400(20)e^{-1}-1000=8000e^{-1}-1000\approx 8000(0.368)-1000\approx\text{PKR }1{,}943$.

$P''(q)<0$ at $q=20$ → confirmed maximum.

Optimisation Problems

Example 9

Minimising Average Cost

Average cost: $\overline{C}(q)=\dfrac{e^{0.1q}}{q}+50$. Find the quantity minimising average cost.

Quotient rule on $e^{0.1q}/q$:

$$\overline{C}'(q)=\frac{0.1e^{0.1q}\cdot q-e^{0.1q}}{q^2}=\frac{e^{0.1q}(0.1q-1)}{q^2}$$

Set $\overline{C}'=0$: $0.1q-1=0 \Rightarrow \boxed{q=10}$ units.

Example 10

Optimal Pricing with Exponential Demand

Demand: $q=1000e^{-0.5p}$. Revenue: $R=pq=1000pe^{-0.5p}$. Find the price $p$ that maximises revenue.

Product rule: $R'(p)=1000e^{-0.5p}+1000p(-0.5)e^{-0.5p}=1000e^{-0.5p}(1-0.5p)$

Set $R'=0$: $1-0.5p=0 \Rightarrow \boxed{p=\text{PKR }2}$.

$q=1000e^{-1}\approx368$ units at revenue $2\times368\approx\text{PKR }736$.

Example 11

Maximum of f(x) = ln x / x

Find the maximum value of $f(x)=\dfrac{\ln x}{x}$ for $x>0$.

Quotient rule: $f'(x)=\dfrac{\frac{1}{x}\cdot x-\ln x}{x^2}=\dfrac{1-\ln x}{x^2}$

Set $f'=0$: $1-\ln x=0 \Rightarrow \ln x=1 \Rightarrow x=e$.

Maximum value: $f(e)=\dfrac{\ln e}{e}=\boxed{\dfrac{1}{e}}$.

§ 7 — Elasticity of Demand

Elasticity:
How Sensitive Is Demand?

Elasticity of Demand

The elasticity of demand $\eta$ measures the percentage change in quantity demanded per 1% change in price:

$$\eta = \frac{p}{q}\cdot\frac{dq}{dp}$$

|η| < 1
Inelastic
Price ↑ → Revenue ↑
|η| = 1
Unit elastic
Max revenue
|η| > 1
Elastic
Price ↑ → Revenue ↓

Example 12 — Demand: $q=500e^{-0.4p}$. Find elasticity. Is demand elastic or inelastic at $p=5$?

Find $dq/dp$: $\frac{dq}{dp}=-200e^{-0.4p}$

$$\eta=\frac{p}{q}\cdot(-200e^{-0.4p})=\frac{p}{500e^{-0.4p}}\cdot(-200e^{-0.4p})=-\frac{200p}{500}=-0.4p$$

At $p=5$: $\eta=-0.4\times5=-2$. Since $|\eta|=2>1$: demand is elastic — a price increase reduces revenue.

Example 13 — Demand: $q=\dfrac{1000}{\ln(2p+1)}$. Find the elasticity at $p=10$.

Find $dq/dp$: $\frac{dq}{dp}=-\dfrac{1000}{[\ln(2p+1)]^2}\cdot\dfrac{2}{2p+1}=-\dfrac{2000}{(2p+1)[\ln(2p+1)]^2}$

At $p=10$: $q=\frac{1000}{\ln 21}\approx\frac{1000}{3.045}\approx328$, $\frac{dq}{dp}\approx\frac{-2000}{21\times9.272}\approx-10.27$.

$\eta=\frac{10}{328}\times(-10.27)\approx-0.313$. Since $|\eta|<1$: inelastic.

§ 8 — Logarithmic Differentiation

Using Logarithms to
Simplify Differentiation

When a function involves complicated products, quotients, or variable exponents, taking the natural log first — then differentiating implicitly — often produces a far simpler calculation.

Logarithmic Differentiation — Procedure
Step 1Step 1: Take the natural log of both sides: $y = f(x) \Rightarrow \ln y = \ln f(x)$
Step 2Step 2: Simplify $\ln f(x)$ using log rules (products → sums, powers → factors)
Step 3Step 3: Differentiate both sides implicitly with respect to $x$: $\frac{1}{y}\frac{dy}{dx} = \ldots$
Step 4Step 4: Solve for $\frac{dy}{dx}$ by multiplying both sides by $y = f(x)$

Direct vs Logarithmic Differentiation — Side by Side

Example 14 (Comparison) — $y = x^3(x+1)^4(x+2)^2$

✗ Direct (Product Rule Twice)

Apply product rule to $x^3\cdot[(x+1)^4(x+2)^2]$, then again inside. Results in three terms, each requiring simplification. Messy and error-prone.

✓ Logarithmic Differentiation

$\ln y = 3\ln x+4\ln(x+1)+2\ln(x+2)$

$\dfrac{y'}{y}=\dfrac{3}{x}+\dfrac{4}{x+1}+\dfrac{2}{x+2}$

Step 1-2: $\ln y=3\ln x+4\ln(x+1)+2\ln(x+2)$

Step 3: $\dfrac{y'}{y}=\dfrac{3}{x}+\dfrac{4}{x+1}+\dfrac{2}{x+2}$

Step 4:

$$y'=x^3(x+1)^4(x+2)^2\left[\frac{3}{x}+\frac{4}{x+1}+\frac{2}{x+2}\right]$$

The answer is already factored — far cleaner than triple product-rule expansion.

Example 15 (Comparison) — $y = \dfrac{(x+1)^3\sqrt{x^2+2}}{(3x+1)^4}$

✗ Direct (Quotient + Product)

Quotient rule gives a numerator requiring product rule, which itself requires chain rule for $\sqrt{x^2+2}$. Result is a single unsimplified fraction with multiple terms. Extremely messy.

✓ Logarithmic Differentiation

$\ln y=3\ln(x+1)+\frac{1}{2}\ln(x^2+2)-4\ln(3x+1)$

Three clean fractions, each one easy.

Step 3:

$$\frac{y'}{y}=\frac{3}{x+1}+\frac{x}{x^2+2}-\frac{12}{3x+1}$$

Step 4:

$$y'=\frac{(x+1)^3\sqrt{x^2+2}}{(3x+1)^4}\left[\frac{3}{x+1}+\frac{x}{x^2+2}-\frac{12}{3x+1}\right]$$

Example 16 — Differentiate $y=x^x$ (variable base AND exponent)

Cannot use either power rule or exponential rule directly — the exponent is also a variable!

Log differentiation: $\ln y=x\ln x$.

$$\frac{y'}{y}=\ln x+x\cdot\frac{1}{x}=\ln x+1$$

$$\boxed{y'=x^x(1+\ln x)}$$

Critical point at $y'=0$: $\ln x=-1 \Rightarrow x=1/e$. Minimum at $y=(1/e)^{1/e}\approx 0.6922$.

Example 17 — Differentiate $y=(\ln x)^x$

Log differentiation: $\ln y=x\ln(\ln x)$. Chain rule on right side:

$$\frac{y'}{y}=\ln(\ln x)+x\cdot\frac{1}{\ln x}\cdot\frac{1}{x}=\ln(\ln x)+\frac{1}{\ln x}$$

$$\boxed{y'=(\ln x)^x\left[\ln(\ln x)+\frac{1}{\ln x}\right]}$$

Example 18 — Differentiate $y=\dfrac{x^4(x-1)^{3/2}}{(2x+1)^5 e^{2x}}$

Take log: $\ln y=4\ln x+\frac{3}{2}\ln(x-1)-5\ln(2x+1)-2x$

$$\frac{y'}{y}=\frac{4}{x}+\frac{3}{2(x-1)}-\frac{10}{2x+1}-2$$

$$y'=\frac{x^4(x-1)^{3/2}}{(2x+1)^5e^{2x}}\left[\frac{4}{x}+\frac{3}{2(x-1)}-\frac{10}{2x+1}-2\right]$$

Example 19 — Differentiate $y=x^{\sin x}$

Log differentiation: $\ln y=\sin x\cdot\ln x$. Product rule on right:

$$\frac{y'}{y}=\cos x\cdot\ln x+\sin x\cdot\frac{1}{x}$$

$$\boxed{y'=x^{\sin x}\left(\cos x\ln x+\frac{\sin x}{x}\right)}$$

Example 20 — Differentiate $y=\left(\dfrac{x^2+1}{x^2-1}\right)^{3/2}$ — compare direct vs log

Direct (chain + quotient): $y'=\frac{3}{2}\left(\frac{x^2+1}{x^2-1}\right)^{1/2}\cdot\frac{2x(x^2-1)-2x(x^2+1)}{(x^2-1)^2}$. The numerator simplifies to $-4x$, giving a messy expression.

Log differentiation (cleaner):

$\ln y=\frac{3}{2}[\ln(x^2+1)-\ln(x^2-1)]$

$$\frac{y'}{y}=\frac{3}{2}\left[\frac{2x}{x^2+1}-\frac{2x}{x^2-1}\right]=\frac{3}{2}\cdot\frac{2x[(x^2-1)-(x^2+1)]}{(x^2+1)(x^2-1)}=\frac{3}{2}\cdot\frac{-4x}{x^4-1}$$

$$y'=\left(\frac{x^2+1}{x^2-1}\right)^{3/2}\cdot\frac{-6x}{x^4-1}$$

Both approaches give the same answer but log differentiation avoids the messy quotient-inside-chain computation.

Coming up next — §4.4 Exponential Models — we apply everything from Ch 4 to build and analyse complete models: population growth, spread of disease, cooling laws, and compound growth with withdrawals.