Derivatives of Exponential and Logarithmic Functions

Money in a savings account, a colony of bacteria, a hot drink cooling to room temperature, the charge filling your phone's battery — each of these changes at a speed set by how much is already there, and calculus captures them all with the exponential function and its mirror-image, the logarithm. This page is about differentiating those two.

Most functions change their shape when you differentiate them — a parabola flattens to a line, a cubic drops to a parabola, a sine slides over to a cosine. In all of mathematics there is exactly one function that refuses to change at all. Its slope at every single point is equal to its own height. That function is the exponential e^{x}, built on the special number e \approx 2.718:

\frac{d}{dx} e^{x} = e^{x}.

Read that literally: the rate at which e^{x} is growing, at any moment, equals how big it already is. The bigger it gets, the faster it climbs; the faster it climbs, the bigger it gets. That runaway feedback is the mathematical definition of unchecked growth, and it is exactly why e is the most important number in calculus. For any other positive base a a constant tags along:

\frac{d}{dx} a^{x} = a^{x}\,\ln a.

When a = e the factor \ln e = 1 disappears, and you are back to e^{x} reproducing itself perfectly. That is the whole reason we single out this one base out of infinitely many: it is the base for which the clutter vanishes.

The natural logarithm

The natural logarithm \ln x is the inverse of e^{x} — it undoes the exponential. Its derivative is one of the cleanest, most surprising results in all of calculus:

\frac{d}{dx}\ln x = \frac{1}{x}.

Think how odd that is. All through calculus you differentiate powers with the rule \tfrac{d}{dx}x^{n} = n x^{n-1}, and every power lands on another power. Yet there was one power missing from that family — nobody ever produces x^{-1} = \tfrac{1}{x} as a derivative that way. Here is what fills the gap: \tfrac{1}{x} is the derivative of \ln x. The logarithm quietly plugs the one hole in the power rule.

See it being its own slope

Here is y = e^{x}. Because \frac{d}{dx}e^{x} = e^{x}, the height of the curve at any point is also its steepness there — where the curve is tall it is also rising fast. At x = 0 the height is e^{0} = 1, so the tangent line there climbs with slope exactly 1; by x = 2 the curve is over 7 high and rising more than seven times as steeply.

Worked example 1 — the chain rule on e^{2x}

Almost every real growth or decay model uses e^{kx}, not bare e^{x} — the k sets how fast things move. Differentiate y = e^{2x}.

\frac{d}{dx} e^{2x} = e^{2x}\cdot 2 = 2e^{2x}.

The 2 comes out the front and the exponential is untouched. Likewise \dfrac{d}{dx} e^{-3x} = -3e^{-3x} — a negative k gives a shrinking, decaying exponential.

Worked example 2 — a product, x e^{x}

Differentiate y = x e^{x}. It is one thing times another, so use the product rule, (uv)' = u'v + uv', with u = x and v = e^{x}.

\frac{d}{dx}\big(x e^{x}\big) = (1)\,e^{x} + x\,e^{x} = (1 + x)\,e^{x}.

Factoring out the common e^{x} tidies the answer to (1+x)e^{x}. It also tells you something: the slope is zero only when 1 + x = 0, i.e. at x = -1 — the single stationary point of x e^{x}.

Worked example 3 — logs, and a decay rate

First a quick log warm-up. \dfrac{d}{dx}\ln x = \dfrac{1}{x}, and the chain rule handles \ln(3x): outer derivative \tfrac{1}{3x} times inner derivative 3 gives

\frac{d}{dx}\ln(3x) = \frac{1}{3x}\cdot 3 = \frac{1}{x}.

The 3 cancels — differentiating \ln(3x) and \ln x give the same answer (because \ln(3x) = \ln 3 + \ln x, and the constant \ln 3 differentiates to zero).

Now a decay problem. A lump of radioactive material has mass m(t) = m_0\,e^{-kt}. How fast is it decaying? Differentiate:

\frac{dm}{dt} = -k\,m_0\,e^{-kt} = -k\,m(t).

The rate of change is -k times the amount present — the more there is, the faster it disappears; the less there is, the slower. That "rate proportional to amount" is the exponential's calling card, and it is only possible because e^{x} is its own derivative.

The self-replicating trick belongs to base e alone. Students blur these two, but they are different:

\frac{d}{dx} e^{x} = e^{x}, \qquad \frac{d}{dx} 2^{x} = 2^{x}\,\ln 2.

Every base except e drags along an extra \ln a factor (\ln 2 \approx 0.693). Only when a = e is that factor 1 and the function copies itself exactly. Two more traps to dodge:

Imagine £1 in a bank paying 100% interest a year. Paid once, you end with £2. Paid as 50% twice, you get (1 + \tfrac12)^2 = \pounds 2.25. Paid monthly, (1 + \tfrac{1}{12})^{12} \approx \pounds 2.61. Compound it more and more often — daily, hourly, every instant — and the total doesn't blow up; it homes in on a single number:

\lim_{n\to\infty}\left(1 + \frac{1}{n}\right)^{n} = e \approx 2.71828\ldots

So e is literally the number you reach from continuously compounded growth — growth that is constantly reinvesting itself. That is why this one self-replicating function turns up everywhere something grows or decays in proportion to its own size: compound interest, population booms, the spread of a virus, radioactive decay (e^{-kt}), the cooling of a hot drink, and the charging of every capacitor in every phone. The property \tfrac{d}{dx}e^{x} = e^{x} isn't a curiosity — it may be the single most important fact in applied mathematics and physics.

See it explained