AP Calculus AB · Topic 2.7 · Reading guide, about 5 min

Differentiating the basic trig, exponential and log functions

Derivatives of sin x, cos x, e^x and ln x, where the trig and e^x rules come from, and the versions for a^x and log base a.

In one minute

Powers of xx are only one family of functions. Sine, cosine, exe^x and ln⁡x\ln x show up in almost every model of waves, growth and decay, and each has a derivative you should know cold: sin⁡x\sin x gives cos⁡x\cos x, cos⁡x\cos x gives −sin⁡x-\sin x, exe^x gives itself, and ln⁡x\ln x gives 1x\frac{1}{x}.

You will use these constantly, so this guide also shows where the sine, cosine and exponential rules come from. Two special limits do the heavy lifting, and knowing them lets you recognize a limit as a derivative later.

Key terms

Derivative of sine
ddxsin⁡x=cos⁡x\frac{d}{dx}\sin x=\cos x, valid when xx is measured in radians.
Derivative of cosine
ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x=-\sin x; the minus sign is part of the rule.
Natural exponential
exe^x with e≈2.718e\approx 2.718; it is the one exponential whose derivative equals the function itself.
Natural logarithm
ln⁡x\ln x, the inverse of exe^x, defined for x>0x>0, with derivative 1x\frac{1}{x}.
Sine limit
lim⁡h→0sin⁡hh=1\lim_{h\to 0}\frac{\sin h}{h}=1 in radians; it gives the slope of sine at 00.
Cosine limit
lim⁡h→0cos⁡h−1h=0\lim_{h\to 0}\frac{\cos h-1}{h}=0, the companion limit needed to differentiate sine.
Exponential limit
lim⁡h→0eh−1h=1\lim_{h\to 0}\frac{e^h-1}{h}=1; it is what makes ee the special base.
General exponential
axa^x for a>0a>0 has derivative axln⁡aa^x\ln a; the factor ln⁡a\ln a equals 11 only when a=ea=e.
Logarithm base a
log⁡ax=ln⁡xln⁡a\log_a x=\frac{\ln x}{\ln a}, with derivative 1xln⁡a\frac{1}{x\ln a} for x>0x>0.
Radian measure
Angles measured by arc length on a unit circle; every trigonometric derivative in calculus assumes it.

The four basic rules

Memorize these as a set. For sine and cosine the pattern is a cycle: sine goes to cosine, cosine goes to negative sine, negative sine goes to negative cosine, and negative cosine goes back to sine. Taking four derivatives of sin⁡x\sin x returns sin⁡x\sin x, which is why these functions model repeating motion.

The exponential exe^x is its own derivative. That means its slope at any point equals its height, so the graph is steep where it is tall. It also makes exe^x the natural choice for modeling growth proportional to the current amount.

The logarithm ln⁡x\ln x has derivative 1x\frac{1}{x}, which is positive for every x>0x>0. That matches the graph: ln⁡x\ln x is always rising, but the slope shrinks toward 00 as xx grows, so it climbs more and more slowly.

Where the rules come from

For sine, write the difference quotient and use the angle-addition identity sin⁡(x+h)=sin⁡xcos⁡h+cos⁡xsin⁡h\sin(x+h)=\sin x\cos h+\cos x\sin h. Then sin⁡(x+h)−sin⁡xh=sin⁡x⋅cos⁡h−1h+cos⁡x⋅sin⁡hh\frac{\sin(x+h)-\sin x}{h}=\sin x\cdot\frac{\cos h-1}{h}+\cos x\cdot\frac{\sin h}{h}. As h→0h\to 0 the first fraction tends to 00 and the second to 11, leaving cos⁡x\cos x. Cosine is handled the same way, with cos⁡(x+h)=cos⁡xcos⁡h−sin⁡xsin⁡h\cos(x+h)=\cos x\cos h-\sin x\sin h, which produces −sin⁡x-\sin x.

For the exponential, ex+h−exh=ex⋅eh−1h\frac{e^{x+h}-e^x}{h}=e^x\cdot\frac{e^h-1}{h}. The factor eh−1h\frac{e^h-1}{h} tends to 11, so the derivative is exe^x. The base ee is defined so that this limit is exactly 11. For any other base the same steps give ax⋅lim⁡ah−1ha^x\cdot\lim\frac{a^h-1}{h}, and that limit equals ln⁡a\ln a.

These limits are also useful in reverse. A limit like lim⁡h→0sin⁡(π6+h)−12h\lim_{h\to 0}\frac{\sin(\frac{\pi}{6}+h)-\frac12}{h} is the derivative of sin⁡x\sin x at x=π6x=\frac{\pi}{6}, which is cos⁡π6=32\cos\frac{\pi}{6}=\frac{\sqrt3}{2}.

Derivative reference
FunctionDerivativeDomain note
sin⁡x\sin xcos⁡x\cos xAll real x, radians
cos⁡x\cos x−sin⁡x-\sin xAll real x, radians
exe^xexe^xAll real x
ln⁡x\ln x1x\frac{1}{x}x greater than 0
axa^xaxln⁡aa^x\ln aa greater than 0 and a not equal to 1
log⁡ax\log_a x1xln⁡a\frac{1}{x\ln a}x greater than 0; a greater than 0 and a not equal to 1

A fully worked example

Problem A: let f(x)=3sin⁡x−cos⁡xf(x)=3\sin x-\cos x. Find the tangent line at x=π2x=\frac{\pi}{2}.

Differentiate with linearity: f′(x)=3cos⁡x−(−sin⁡x)=3cos⁡x+sin⁡xf'(x)=3\cos x-(-\sin x)=3\cos x+\sin x. The minus sign on the cosine term combines with the derivative's own minus sign to give a plus. At x=π2x=\frac{\pi}{2}, cos⁡π2=0\cos\frac{\pi}{2}=0 and sin⁡π2=1\sin\frac{\pi}{2}=1, so f′(π2)=3(0)+1=1f'(\frac{\pi}{2})=3(0)+1=1. The function value is f(π2)=3(1)−0=3f(\frac{\pi}{2})=3(1)-0=3. The tangent line is y−3=1⋅(x−π2)y-3=1\cdot(x-\frac{\pi}{2}).

Problem B: let g(x)=7ex−3x+4log⁡2xg(x)=7e^x-3^x+4\log_2 x. Find g′(1)g'(1). Differentiate each term: 7ex7e^x gives 7ex7e^x; 3x3^x gives 3xln⁡33^x\ln 3; 4log⁡2x4\log_2 x gives 4xln⁡2\frac{4}{x\ln 2}. So g′(x)=7ex−3xln⁡3+4xln⁡2g'(x)=7e^x-3^x\ln 3+\frac{4}{x\ln 2}. At x=1x=1 this is 7e−3ln⁡3+4ln⁡27e-3\ln 3+\frac{4}{\ln 2}. Numerically, 7e≈19.0287e\approx 19.028, 3ln⁡3≈3.2963\ln 3\approx 3.296 and 4ln⁡2≈5.771\frac{4}{\ln 2}\approx 5.771, so g′(1)≈19.028−3.296+5.771=21.503g'(1)\approx 19.028-3.296+5.771=21.503. A graphing calculator's numerical derivative at x=1x=1 should agree with this value.

Radians and domains

Every sine and cosine derivative above assumes radians. If xx were measured in degrees, an extra factor of π180\frac{\pi}{180} would appear. In calculus problems you always work in radians, and a graphing calculator must be set to radian mode when you check a trig derivative numerically.

Domains matter for ln⁡x\ln x. Its derivative 1x\frac{1}{x} is also defined for negative xx, but ln⁡x\ln x itself is only defined for x>0x>0, so the rule ddxln⁡x=1x\frac{d}{dx}\ln x=\frac1x applies only on x>0x>0. Pay attention to this when a problem asks about a tangent line to a logarithm or where a combined function is differentiable.

How it connects

  • Back to 2.2: each rule is the limit definition applied to a specific function, using the special limits above.
  • Back to 2.6: linearity lets you add and scale these terms freely, as in 3sin⁡x−cos⁡x3\sin x-\cos x.
  • Forward to 2.10: tangent, secant, cotangent and cosecant derivatives are built from the sine and cosine rules.
  • Forward to 3.1: the chain rule extends these to forms like sin⁡(3x)\sin(3x), ex2e^{x^2} and ln⁡(x2+1)\ln(x^2+1).
  • Forward to 3.3: the derivative of ln⁡x\ln x is derived there as the slope of the inverse of exe^x.

Common mistakes

  • Losing the minus sign on cosine. ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x=-\sin x. Check it on the graph: cosine falls just after x=0x=0, so its slope there is negative.
  • **Differentiating axa^x with the power rule.** ddx3x\frac{d}{dx}3^x is 3xln⁡33^x\ln 3, not x⋅3x−1x\cdot 3^{x-1}. The power rule needs a variable base and a constant exponent.
  • **Mixing up exe^x and xex^e.** The first is an exponential and is its own derivative; the second is a power and gives e xe−1e\,x^{e-1}.
  • **Forgetting ln⁡a\ln a for other bases.** The factor appears for axa^x in the numerator and for log⁡ax\log_a x in the denominator.

How it shows up on the exam

  • Direct derivatives of sums and scaled combinations of these functions in the no-calculator section, often followed by a tangent line.
  • Limit expressions to be recognized as a derivative at a point, such as a difference quotient for sin⁡x\sin x or exe^x.
  • Questions about slopes read from a table or graph that you connect to cos⁡x\cos x, exe^x or 1x\frac1x.

Check yourself

  1. Which limit lets you show that the derivative of sine is cosine, and why does it need radians?
  2. What is ddx(5ex−2ln⁡x+cos⁡x)\frac{d}{dx}\left(5e^x-2\ln x+\cos x\right), and where is it defined?
  3. Why is the slope of exe^x at x=2x=2 equal to the height of the graph at x=2x=2?
  4. How would you take the derivative of 5x5^x, and what number replaces the missing power-rule exponent?

Practice this topic. AP Practice questions on exactly what this lesson covers, with an explanation for every answer.