Derivatives of sin, cos, eˣ and ln x
Four functions appear everywhere in calculus, and each has a short derivative. This guide gives the four rules, shows the slope patterns behind them, and uses them with the sum and constant multiple rules.
\(\dfrac{d}{dx}[\sin x] = \cos x\), \(\dfrac{d}{dx}[\cos x] = -\sin x\), \(\dfrac{d}{dx}\left[e^x\right] = e^x\), and \(\dfrac{d}{dx}[\ln x] = \dfrac{1}{x}\). The trig rules need \(x\) in radians. Each rule can be seen on a graph: the slopes of sine trace out cosine, the slope of \(e^x\) always equals its height, and the slope of \(\ln x\) at \(x\) is \(\frac1x\).
1The four rules
| Function | Derivative | Picture |
|---|---|---|
| \(\sin x\) | \(\cos x\) | Slopes of the sine wave form the cosine wave |
| \(\cos x\) | \(-\sin x\) | Cosine starts by falling, so its slope starts negative |
| \(e^x\) | \(e^x\) | Slope equals height |
| \(\ln x\) | \(\dfrac1x\) (for \(x \gt 0\)) | Steep near 0, flattening out |
2Sine and cosine
Start from the limit definition and the angle-sum identity \(\sin(x + h) = \sin x\cos h + \cos x\sin h\):
\(\dfrac{\sin(x + h) - \sin x}{h} = \sin x \cdot \dfrac{\cos h - 1}{h} + \cos x \cdot \dfrac{\sin h}{h}\).
As \(h \rightarrow 0\), \(\dfrac{\cos h - 1}{h} \rightarrow 0\) and \(\dfrac{\sin h}{h} \rightarrow 1\), leaving \(\cos x\). Those two special limits hold only in radians, which is why the rule needs radians.
\(f(x) = 3\sin x - 2\cos x\); find \(f'\left(\frac{\pi}{3}\right)\)
- 1\(f'(x) = 3\cos x - 2(-\sin x) = 3\cos x + 2\sin x\).
- 2At \(\frac{\pi}{3}\): \(\cos\frac{\pi}{3} = \frac12\), \(\sin\frac{\pi}{3} = \frac{\sqrt3}{2}\).
- 3\(f'\left(\tfrac{\pi}{3}\right) = \tfrac32 + 2 \cdot \tfrac{\sqrt3}{2} = \tfrac32 + \sqrt3\).
\(\frac{d}{dx}[\cos x] = -\sin x\). Check with the graph: just right of 0, cosine is falling from its peak, so its slope is negative, and \(-\sin x\) is negative there.
The rules are only true with \(x\) in radians. In degree mode the slope of \(\sin x\) is \(\frac{\pi}{180}\cos x\), a different answer. Keep calculators in radian mode.
\(y = x - 2\sin x\) on \([0, 2\pi]\)
- 1\(y' = 1 - 2\cos x\). Set it to 0: \(\cos x = \frac12\).
- 2On \([0, 2\pi]\): \(x = \frac{\pi}{3}\) and \(x = \frac{5\pi}{3}\).
The derivatives of \(\sin x\) cycle
- 1Differentiate again and again: \(\sin x \rightarrow \cos x \rightarrow -\sin x \rightarrow -\cos x \rightarrow \sin x\).
- 2The pattern repeats every four derivatives. For the 27th derivative, \(27 = 4 \cdot 6 + 3\), so it matches the 3rd one: \(-\cos x\).
3eˣ and ln x
\(y = e^x\) at \(x = 0\)
- 1Point: \((0, e^0) = (0, 1)\). Slope: \(e^0 = 1\).
\(g(x) = 4\ln x - x\) at \(x = 2\)
- 1\(g'(x) = \dfrac{4}{x} - 1\), so \(g'(2) = 2 - 1 = 1\).
- 2Point: \(g(2) = 4\ln 2 - 2 \approx 0.773\).
How fast is a town growing?
A town’s population is modeled by \(P(t) = 200 + 50\ln t\) hundred people, \(t\) years after it was founded (\(t \ge 1\)). Find \(P'(10)\) and interpret it.
- 1\(P'(t) = \dfrac{50}{t}\), so \(P'(10) = 5\).
- 2Units: hundred people per year.
- 3The rate \(\frac{50}{t}\) keeps shrinking: a log model grows forever, but more and more slowly.
\(e^x\) is not a power of \(x\); the variable is in the exponent. \(\frac{d}{dx}\left[e^x\right] = e^x\), not \(xe^{x - 1}\).
4Rewriting first
Exponent and log rules can turn an unfamiliar function into a familiar one before you differentiate.
\(\dfrac{d}{dx}\left[\ln\left(x^3\right)\right]\) and \(\dfrac{d}{dx}\left[e^{x + 2}\right]\)
- 1\(\ln\left(x^3\right) = 3\ln x\) (for \(x \gt 0\)), so the derivative is \(\dfrac{3}{x}\).
- 2\(e^{x + 2} = e^2 \cdot e^x\), a constant times \(e^x\). Its derivative is \(e^2 e^x = e^{x + 2}\).
\(\ln(5x) = \ln 5 + \ln x\), and \(\ln 5\) is a constant. So \(\frac{d}{dx}[\ln(5x)] = \frac{1}{x}\), not \(\frac{1}{5x}\) and not \(\frac{5}{x}\).
Quick reference
| Function | Derivative |
|---|---|
| \(\sin x\) | \(\cos x\) |
| \(\cos x\) | \(-\sin x\) |
| \(e^x\) | \(e^x\) |
| \(\ln x\) | \(\frac{1}{x}\) |
| \(\ln\left(x^n\right)\), \(\ln(kx)\) | Rewrite first: \(\frac{n}{x}\), \(\frac{1}{x}\) |
| \(e^{x + c}\) | \(e^{x + c}\) |