Derivatives of Exponentials, Logarithms, and Trigonometric Functions

Published on 2026-11-04·v1.0

Learning Objectives

  • Explain why ee is the base whose exponential function is its own derivative, and derive ddxbx=bxln⁡b\frac{d}{dx} b^x = b^x \ln b.
  • Derive ddxln⁡x=1x\frac{d}{dx}\ln x = \frac{1}{x} from the exponential, and state its domain.
  • State the derivatives of sin⁡\sin, cos⁡\cos, tan⁡\tan and the need for radians, and combine them with the chain rule.
  • Differentiate an expression defined implicitly, and recognize the points where the method breaks down.
  • Use logarithmic differentiation for expressions such as xxx^x that the basic rules do not reach.

Context & Motivation

The previous lesson, differentiation-rules-and-the-chain-rule, can differentiate any combination of powers, sums, products, quotients and compositions. Its reach stops at the first function that is not a power of xx. Exponentials, logarithms and trigonometric functions are the functions that model growth, decay, scale and oscillation: compound interest, algorithm running times measured in log⁡n\log n, probabilities in a classifier, a vibrating spring, a rotating coordinate frame. A differentiation toolkit that cannot handle them is not usable.

The exponential, sine and cosine have a property that polynomials lack: differentiating keeps them inside their family and never reduces them to 00. The exponential's derivative is a multiple of itself, and sin⁡\sin and cos⁡\cos differentiate into each other, while differentiating a polynomial lowers its degree until nothing is left. The logarithm and the tangent do leave their family, giving 1x\frac{1}{x} and 1cos⁡2x\frac{1}{\cos^2 x}, but the results are simple expressions in functions already known. The limit work differs from one to the next: the exponential needs one limit, sine and cosine need two, and the logarithm needs no new limit at all, because it follows from the exponential through the inverse relationship. Once a derivative is found, the chain rule carries it everywhere.

The lesson also covers two techniques that handle expressions where the variable sits where a basic rule does not expect it: implicit differentiation, for curves such as x2+y2=25x^2 + y^2 = 25 that are not given as y=f(x)y = f(x), and logarithmic differentiation, for expressions such as xxx^x.

Core Theory

The number ee and the exponential

For a base b>0b > 0 the difference quotient of bxb^x factors:

bx+h−bxh=bx⋅bh−1h.\frac{b^{x+h} - b^x}{h} = b^x \cdot \frac{b^h - 1}{h}.

The factor bxb^x does not depend on hh. If the limit L(b)=lim⁡h→0bh−1hL(b) = \lim_{h \to 0} \frac{b^h - 1}{h} exists, then ddxbx=L(b) bx\frac{d}{dx} b^x = L(b)\, b^x: the derivative of an exponential is proportional to itself, and the whole question is the constant. Numerically, with h=10−6h = 10^{-6}:

text
b L(b) 2 0.693147 2.5 0.916291 3 1.098613 10 2.302588

L(2)<1<L(3)L(2) < 1 < L(3). Three facts are taken as given here: the limit L(b)L(b) exists for every b>0b > 0, it changes continuously with bb, and it is strictly increasing in bb. Continuity and the Intermediate Value Theorem from continuity-and-the-intermediate-value-theorem then give a base between 22 and 33 with L(b)=1L(b) = 1, and the strict increase makes it the only one. That base is called e≈2.718281828e \approx 2.718281828. With b=eb = e the constant is 11:

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

So ee is not an arbitrary choice: it is the base for which the slope of the graph equals its height at every point. The same number is the limit of (1+1n)n\left(1 + \frac{1}{n}\right)^n, which takes the values 22, 2.59372.5937, 2.70482.7048, 2.718152.71815, 2.7182802.718280 for n=1,10,100,104,106n = 1, 10, 100, 10^4, 10^6 (the equivalence of the two descriptions is proved in the textbooks cited below).

The natural logarithm ln⁡\ln is the inverse of exe^x, so b=eln⁡bb = e^{\ln b} for any b>0b > 0. Writing bx=exln⁡bb^x = e^{x \ln b} and using the chain rule:

ddxbx=bxln⁡b.\frac{d}{dx} b^x = b^x \ln b.

This also identifies the table's constant, L(b)=ln⁡bL(b) = \ln b: indeed ln⁡2=0.693147\ln 2 = 0.693147 and ln⁡10=2.302585\ln 10 = 2.302585. Example: ddx2x\frac{d}{dx}2^x at x=3x = 3 is 8ln⁡2≈5.5458 \ln 2 \approx 5.545. A misapplied power rule would give x⋅2x−1=12x \cdot 2^{x-1} = 12 at x=3x = 3, which is wrong because 2x2^x is not a power of xx.

The logarithm

Let y=ln⁡xy = \ln x for x>0x > 0, so that ey=xe^y = x. Differentiate both sides with respect to xx. The right side gives 11. The left side, by the chain rule, gives ey⋅y′e^y \cdot y'. Therefore

ddxln⁡x=1ey=1x,x>0.\frac{d}{dx} \ln x = \frac{1}{e^y} = \frac{1}{x}, \qquad x > 0.

This step assumes yy is differentiable, which holds because the inverse of a differentiable function with nonzero derivative is differentiable; ey>0e^y > 0 ensures that. For x≠0x \neq 0, ddxln⁡∣x∣=1x\frac{d}{dx}\ln\lvert x \rvert = \frac{1}{x}, which is why antiderivatives of 1x\frac{1}{x} later carry an absolute value. With the chain rule, ddxln⁡g(x)=g′(x)g(x)\frac{d}{dx} \ln g(x) = \frac{g'(x)}{g(x)} wherever g(x)>0g(x) > 0. For another base, log⁡bx=ln⁡xln⁡b\log_b x = \frac{\ln x}{\ln b} gives 1xln⁡b\frac{1}{x \ln b}.

Sine, cosine and tangent

The derivatives of sin⁡\sin and cos⁡\cos come from the angle-addition formula and two limits. The first, lim⁡h→0sin⁡hh=1\lim_{h \to 0} \frac{\sin h}{h} = 1, is the squeeze-theorem result of limit-laws-and-indeterminate-forms. The second, lim⁡h→0cos⁡h−1h=0\lim_{h \to 0} \frac{\cos h - 1}{h} = 0, follows from that lesson's 1−cos⁡hh2→12\frac{1 - \cos h}{h^2} \to \frac{1}{2}, because cos⁡h−1h=−h⋅1−cos⁡hh2→0⋅12\frac{\cos h - 1}{h} = -h \cdot \frac{1 - \cos h}{h^2} \to 0 \cdot \frac{1}{2}. Then:

sin⁡(x+h)−sin⁡xh=sin⁡x⋅cos⁡h−1h+cos⁡x⋅sin⁡hh→cos⁡x.\frac{\sin(x+h) - \sin x}{h} = \sin x \cdot \frac{\cos h - 1}{h} + \cos x \cdot \frac{\sin h}{h} \to \cos x.

The same computation for cosine gives −sin⁡x-\sin x:

ddxsin⁡x=cos⁡x,ddxcos⁡x=−sin⁡x.\frac{d}{dx}\sin x = \cos x, \qquad \frac{d}{dx}\cos x = -\sin x.

Both limits are statements about angles in radians. In degrees, sin⁡h∘≈π180h\sin h^\circ \approx \frac{\pi}{180} h, so ddxsin⁡(x∘)=π180cos⁡(x∘)\frac{d}{dx}\sin(x^\circ) = \frac{\pi}{180}\cos(x^\circ), about 0.0174530.017453 at x=0x = 0. Radians are what make the derivative formula clean. By the quotient rule, ddxtan⁡x=1cos⁡2x=1+tan⁡2x\frac{d}{dx}\tan x = \frac{1}{\cos^2 x} = 1 + \tan^2 x, valid wherever cos⁡x≠0\cos x \neq 0. Two inverse functions follow from the same inverse argument used for the logarithm: ddxarctan⁡x=11+x2\frac{d}{dx}\arctan x = \frac{1}{1 + x^2} for all xx, and ddxarcsin⁡x=11−x2\frac{d}{dx}\arcsin x = \frac{1}{\sqrt{1 - x^2}} on (−1,1)(-1, 1) only. The latter grows without bound toward the endpoints: it is 2.292.29 at x=0.9x = 0.9, 7.097.09 at 0.990.99 and 707707 at 0.9999990.999999.

Implicit differentiation

Sometimes a curve is given by an equation relating xx and yy rather than by a formula y=f(x)y = f(x). If near a point yy is a differentiable function of xx, differentiate both sides of the equation with respect to xx, treating yy as y(x)y(x) so that the chain rule contributes a factor y′y' to every term containing yy, then solve for y′y'.

For x2+y2=25x^2 + y^2 = 25, differentiating gives 2x+2y y′=02x + 2y\,y' = 0, so y′=−xyy' = -\frac{x}{y}, valid where y≠0y \neq 0. At y=0y = 0 the circle has a vertical tangent and yy is not a function of xx near that point, so there is no y′y' to find. The method silently assumes what it needs; it returns a formula even in places where the assumption is false, and the denominator is where to look.

Logarithmic differentiation

When the variable is in both the base and the exponent, or an expression is a long product and quotient, take the logarithm first. For y=f(x)>0y = f(x) > 0:

ln⁡y=ln⁡f(x)⇒y′y=ddxln⁡f(x)⇒y′=y⋅ddxln⁡f(x).\ln y = \ln f(x) \quad\Rightarrow\quad \frac{y'}{y} = \frac{d}{dx}\ln f(x) \quad\Rightarrow\quad y' = y \cdot \frac{d}{dx}\ln f(x).

If yy can be negative but not zero, use ln⁡∣y∣\ln\lvert y \rvert, whose derivative is also y′y\frac{y'}{y}. The same idea proves the general power rule: for x>0x > 0 and any real rr, xr=erln⁡xx^r = e^{r \ln x} and ddxxr=erln⁡x⋅rx=rxr−1\frac{d}{dx} x^r = e^{r \ln x} \cdot \frac{r}{x} = r x^{r-1}.

Worked Examples

Example 1: the sigmoid

The logistic function σ(z)=11+e−z\sigma(z) = \dfrac{1}{1 + e^{-z}} is defined for all real zz and turns any real score into a number in (0,1)(0, 1). By the chain rule applied to the reciprocal,

σ′(z)=e−z(1+e−z)2=σ(z)(1−σ(z)).\sigma'(z) = \frac{e^{-z}}{(1 + e^{-z})^2} = \sigma(z)\big(1 - \sigma(z)\big).

The second form is obtained by writing e−z1+e−z=1−σ(z)\frac{e^{-z}}{1 + e^{-z}} = 1 - \sigma(z). Values, checked against a central difference:

text
z sigma(z) sigma'(z) -5 0.006693 0.006648 0 0.500000 0.250000 2 0.880797 0.104994 5 0.993307 0.006648

The derivative is largest at z=0z = 0 with value 14\frac{1}{4}, because p(1−p)≤14p(1-p) \leq \frac{1}{4} for any pp, and it decays on both sides. This is the factor each sigmoid layer contributes to the product in a backward pass: ten of them at their best multiply to at most 0.2510≈9.5×10−70.25^{10} \approx 9.5 \times 10^{-7}, a concrete reason why deep stacks of sigmoids train slowly.

Example 2: oscillation

A mass on a spring has position x(t)=3cos⁡(2t)x(t) = 3\cos(2t) (meters, tt in seconds). With the chain rule:

v(t)=x′(t)=−6sin⁡(2t),a(t)=v′(t)=−12cos⁡(2t).v(t) = x'(t) = -6\sin(2t), \qquad a(t) = v'(t) = -12\cos(2t).

Comparing, a(t)=−4 x(t)a(t) = -4\,x(t): acceleration is proportional to displacement and opposite in sign, the signature of harmonic motion. At t=0.5t = 0.5: x=1.6209x = 1.6209, v=−5.0488v = -5.0488 m/s, a=−6.4836a = -6.4836 m/s$^2$, and indeed −4×1.6209=−6.4836-4 \times 1.6209 = -6.4836. Because the function is cos⁡(2t)\cos(2t), not cos⁡t\cos t, each derivative picks up a factor 22 from the chain rule.

Example 3: implicit differentiation

For x3+y3=6xyx^3 + y^3 = 6xy (a curve called the folium of Descartes), the point (3,3)(3, 3) lies on it since 27+27=54=6⋅927 + 27 = 54 = 6 \cdot 9. Differentiate both sides, using the product rule on 6xy6xy:

3x2+3y2y′=6y+6xy′⇒y′=2y−x2y2−2x.3x^2 + 3y^2 y' = 6y + 6x y' \quad\Rightarrow\quad y' = \frac{2y - x^2}{y^2 - 2x}.

Solving requires y2≠2xy^2 \neq 2x. At (3,3)(3, 3): y′=6−99−6=−1y' = \frac{6 - 9}{9 - 6} = -1. The tangent line is y−3=−(x−3)y - 3 = -(x - 3). For the circle at (3,4)(3, 4) the same method gives y′=−34y' = -\frac{3}{4}, and at (5,0)(5, 0) the denominator yy is zero, matching the vertical tangent.

Example 4: logarithmic differentiation of xxx^x

For x>0x > 0, let y=xxy = x^x. Then ln⁡y=xln⁡x\ln y = x \ln x. Differentiate both sides, using the product rule on the right:

y′y=ln⁡x+x⋅1x=ln⁡x+1⇒y′=xx(ln⁡x+1).\frac{y'}{y} = \ln x + x \cdot \frac{1}{x} = \ln x + 1 \quad\Rightarrow\quad y' = x^x(\ln x + 1).

At x=2x = 2: y′=4(ln⁡2+1)≈6.7726y' = 4(\ln 2 + 1) \approx 6.7726, and a central difference gives 6.772596.77259. The power rule would give x⋅xx−1=xxx \cdot x^{x-1} = x^x here, and the exponential rule alone would give xxln⁡xx^x \ln x; each captures only one of the two places the variable appears, so the true derivative is the sum of both contributions.

Common Misconceptions & Pitfalls

  • "ddxex=xex−1\frac{d}{dx} e^x = x e^{x-1}." The power rule is for a variable base with a constant exponent. In exe^x the variable is in the exponent, and the derivative is exe^x.
  • "ddxln⁡(x2)=1x2\frac{d}{dx}\ln(x^2) = \frac{1}{x^2}." The chain rule gives 2xx2=2x\frac{2x}{x^2} = \frac{2}{x}, the same as the derivative of 2ln⁡∣x∣2\ln\lvert x \rvert.
  • "The derivative of cos⁡x\cos x is sin⁡x\sin x." The sign is negative. A quick check: cos⁡\cos is decreasing just after x=0x = 0, so its slope there must be negative, and −sin⁡x-\sin x is negative for small x>0x > 0.
  • "Trigonometric derivative formulas hold in any angle unit." They hold in radians. Using degrees brings a factor π180\frac{\pi}{180} into every derivative.
  • "Implicit differentiation always yields y′y'." It yields y′y' where yy is locally a differentiable function of xx. Where the denominator vanishes, as at (5,0)(5, 0) on the circle, the curve may have a vertical tangent and no y′y'.
  • "Logarithmic differentiation works for any yy." It needs y≠0y \neq 0 (use ln⁡∣y∣\ln\lvert y \rvert if y<0y < 0), and xxx^x is only defined as a real function for x>0x > 0 here.

Summary

The exponential bxb^x has derivative L(b) bxL(b)\,b^x, and ee is the base for which L(e)=1L(e) = 1, so ddxex=ex\frac{d}{dx}e^x = e^x and, in general, ddxbx=bxln⁡b\frac{d}{dx} b^x = b^x \ln b. The logarithm follows from the inverse relationship: ddxln⁡x=1x\frac{d}{dx}\ln x = \frac{1}{x} for x>0x > 0, and g′g\frac{g'}{g} for ln⁡g\ln g where g>0g > 0. For trigonometric functions, sin⁡′=cos⁡\sin' = \cos, cos⁡′=−sin⁡\cos' = -\sin and tan⁡′=1cos⁡2\tan' = \frac{1}{\cos^2} where cos⁡≠0\cos \neq 0, all in radians. With the chain rule these reach sigmoids, oscillations and growth laws. Implicit differentiation handles curves given by an equation, with the denominator showing where it fails, and logarithmic differentiation handles variable exponents, giving ddxxx=xx(ln⁡x+1)\frac{d}{dx}x^x = x^x(\ln x + 1) for x>0x > 0 and the general power rule for real exponents. These derivatives make the derivative toolkit complete for the elementary functions, and the next lesson, the-mean-value-theorem-and-monotonicity, begins using derivatives to draw conclusions about what a function does.

Documentation Links