Dove's LibraryDove's Library

2.7 - Derivatives of cos x, sin x, e^x, and ln x

Introduction

These are the derivative rules for sine, cosine, exponential, and logarithmic functions. You’ll use them constantly, so memorizing them isn’t optional.

Derivatives of Trig Functions

ddx[sin⁡x]=cos⁡x\frac{d}{dx}[\sin x] = \cos x
The derivative of sine is cosine.
ddx[cos⁡x]=−sin⁡x\frac{d}{dx}[\cos x] = -\sin x
The derivative of cosine is negative sine.
Memory tip: the derivative of cosine picks up a negative sign. Functions that start with “c” (cosine, and later cotangent and cosecant) all have a negative sign in front of their derivatives.

Example 1: Basic Trig Derivatives

Find the derivative of f(x)=3sin⁡x−4cos⁡xf(x) = 3\sin x - 4\cos x.
f′(x)=3cos⁡x−4(−sin⁡x)=3cos⁡x+4sin⁡xf'(x) = 3\cos x - 4(-\sin x) = 3\cos x + 4\sin x
The −4cos⁡x-4\cos x becomes −4(−sin⁡x)-4(-\sin x), and the two negatives cancel into a positive.

Example 2: Mixed Functions

Differentiate g(x)=5cos⁡x+2x3−sin⁡xg(x) = 5\cos x + 2x^3 - \sin x.
g′(x)=5(−sin⁡x)+6x2−cos⁡x=−5sin⁡x+6x2−cos⁡xg'(x) = 5(-\sin x) + 6x^2 - \cos x = -5\sin x + 6x^2 - \cos x

Properties Worth Remembering First

Natural Logarithm Properties

ln⁡(1)=0ln⁡(0)=undefined\ln(1) = 0 \qquad \ln(0) = \text{undefined}
Why is ln⁡(0)\ln(0) undefined? Because the graph of y=ln⁡(x)y = \ln(x) has a vertical asymptote at x=0x = 0.
2.7 - Derivatives of cos x, sin x, e^x, and ln x
Since the function never actually reaches x=0x = 0, ln⁡(0)\ln(0) is undefined.

Exponential Properties

e0=1e^0 = 1
(Any nonzero number to the zero power is 1.)

Inverse Properties

eln⁡(a)=aln⁡(ea)=ae^{\ln(a)} = a \qquad \ln(e^a) = a
The natural exponential and the natural log are inverses, so they undo each other.

Derivatives of Exponential Functions

Rule 1: Derivative of exe^x

ddx[ex]=ex\frac{d}{dx}[e^x] = e^x
The derivative of exe^x is itself. One of the most elegant results in calculus.

Rule 2: Derivative of axa^x (general base)

For any positive constant a≠1a \neq 1:
ddx[ax]=axln⁡(a)\frac{d}{dx}[a^x] = a^x \ln(a)
The pattern: keep the function, then multiply by the natural log of the base.
Why exe^x is special: when a=ea = e
ddx[ex]=ex⋅ln⁡(e)=ex⋅1=ex\frac{d}{dx}[e^x] = e^x \cdot \ln(e) = e^x \cdot 1 = e^x
Since ln⁡(e)=1\ln(e) = 1, the extra factor just disappears.

Example 3: Exponential with Base ee

Find the derivative of f(x)=7ex+3x2f(x) = 7e^x + 3x^2.
f′(x)=7ex+6xf'(x) = 7e^x + 6x
The derivative of exe^x is just exe^x, so the 7 stays put.

Example 4: Exponential with Another Base

Differentiate h(x)=5x−2xh(x) = 5^x - 2x.
h′(x)=5xln⁡(5)−2h'(x) = 5^x \ln(5) - 2
Since the base is 5 and not ee, you have to include ln⁡(5)\ln(5).

Example 5: Multiple Exponentials

Find g′(x)g'(x) for g(x)=4ex+2xg(x) = 4e^x + 2^x.
g′(x)=4ex+2xln⁡(2)g'(x) = 4e^x + 2^x \ln(2)
  • The 4ex4e^x term gives 4ex4e^x
  • The 2x2^x term gives 2xln⁡(2)2^x \ln(2)

Derivatives of Logarithmic Functions

Rule 1: Natural Log

ddx[ln⁡x]=1x\frac{d}{dx}[\ln x] = \frac{1}{x}
Simple and important.
This rule only works for x>0x > 0, because that’s the domain of ln⁡x\ln x. The formula 1x\frac{1}{x} gives a number for negative xx too, but ln⁡x\ln x doesn’t exist there, so neither does its derivative. (Remember from Topic 2.4: a point that isn’t in the domain of ff isn’t in the domain of f′f'.)

Rule 2: General Log

For any positive constant a≠1a \neq 1:
ddx[log⁡ax]=1xln⁡(a)\frac{d}{dx}[\log_a x] = \frac{1}{x \ln(a)}
The pattern: 1x\frac{1}{x} multiplied by 1ln⁡(base)\frac{1}{\ln(\text{base})}.
Why natural log is special: when a=ea = e
ddx[ln⁡x]=1xln⁡(e)=1x⋅1=1x\frac{d}{dx}[\ln x] = \frac{1}{x \ln(e)} = \frac{1}{x \cdot 1} = \frac{1}{x}

Example 6: Natural Log

Find the derivative of f(x)=3ln⁡x+5xf(x) = 3\ln x + 5x.
f′(x)=3⋅1x+5=3x+5f'(x) = 3 \cdot \frac{1}{x} + 5 = \frac{3}{x} + 5

Example 7: Log Base 10

Differentiate g(x)=log⁡10x+4x2g(x) = \log_{10} x + 4x^2.
g′(x)=1xln⁡(10)+8xg'(x) = \frac{1}{x \ln(10)} + 8x
Base 10 isn’t ee, so ln⁡(10)\ln(10) goes in the denominator.

Example 8: Log with Another Base

Find h′(x)h'(x) for h(x)=log⁡3x−2cos⁡xh(x) = \log_3 x - 2\cos x.
h′(x)=1xln⁡(3)−2(−sin⁡x)=1xln⁡(3)+2sin⁡xh'(x) = \frac{1}{x \ln(3)} - 2(-\sin x) = \frac{1}{x \ln(3)} + 2\sin x

Combining Multiple Rules

Example 9: Mixed Exponential and Trig

Find the derivative of f(x)=4sin⁡x+6exf(x) = 4\sin x + 6e^x.
f′(x)=4cos⁡x+6exf'(x) = 4\cos x + 6e^x

Example 10: All Function Types

Differentiate g(x)=3x−5cos⁡x+exg(x) = 3^x - 5\cos x + e^x.
g′(x)=3xln⁡(3)−5(−sin⁡x)+ex=3xln⁡(3)+5sin⁡x+exg'(x) = 3^x \ln(3) - 5(-\sin x) + e^x = 3^x \ln(3) + 5\sin x + e^x

Example 11: Log and Trig

Find h′(x)h'(x) for h(x)=2log⁡5x+sin⁡x3h(x) = 2\log_5 x + \dfrac{\sin x}{3}.
Rewrite: h(x)=2log⁡5x+13sin⁡xh(x) = 2\log_5 x + \frac{1}{3}\sin x
h′(x)=2xln⁡(5)+13cos⁡xh'(x) = \frac{2}{x \ln(5)} + \frac{1}{3}\cos x

Evaluating Derivatives at Specific Points

Example 12: Evaluate at a Point

Given f(x)=2ln⁡x+exf(x) = 2\ln x + e^x, find f′(3)f'(3).
Step 1: Find the derivative.
f′(x)=2x+exf'(x) = \frac{2}{x} + e^x
Step 2: Plug in x=3x = 3.
f′(3)=23+e3f'(3) = \frac{2}{3} + e^3
That’s the exact answer. Don’t try to simplify e3e^3 any further, it’s irrational (about 20.086).

Example 13: Trig Function at a Specific Point

Find g′(π)g'(\pi) if g(x)=4cos⁡x+sin⁡x2g(x) = 4\cos x + \dfrac{\sin x}{2}.
Step 1: Find the derivative.
g′(x)=−4sin⁡x+12cos⁡xg'(x) = -4\sin x + \frac{1}{2}\cos x
Step 2: Evaluate at x=πx = \pi.
g′(π)=−4sin⁡(π)+12cos⁡(π)g'(\pi) = -4\sin(\pi) + \frac{1}{2}\cos(\pi)
Step 3: Use unit circle values. sin⁡(π)=0\sin(\pi) = 0 and cos⁡(π)=−1\cos(\pi) = -1.
g′(π)=−4(0)+12(−1)=−12g'(\pi) = -4(0) + \frac{1}{2}(-1) = -\frac{1}{2}

Example 14: Another Trig Evaluation

Find h′(π2)h'\left(\frac{\pi}{2}\right) for h(x)=3sin⁡x−2cos⁡xh(x) = 3\sin x - 2\cos x.
h′(x)=3cos⁡x+2sin⁡xh'(x) = 3\cos x + 2\sin x
Using the unit circle, cos⁡(π2)=0\cos\left(\frac{\pi}{2}\right) = 0 and sin⁡(π2)=1\sin\left(\frac{\pi}{2}\right) = 1:
h′(π2)=3(0)+2(1)=2h'\left(\frac{\pi}{2}\right) = 3(0) + 2(1) = 2

Using Derivatives to Evaluate Limits

In Topic 2.1 you learned to spot the function and the point hiding in a limit like lim⁡h→0f(a+h)−f(a)h\lim_{h \to 0} \frac{f(a + h) - f(a)}{h}. Now that you know these derivative rules, you can go one step further and actually evaluate the limit, because it equals f′(a)f'(a). Many of these limits give 00\frac{0}{0} and are hard to do with algebra, but they take one line with a derivative rule.
Steps:
  1. Match the limit to f(a+h)−f(a)h\frac{f(a + h) - f(a)}{h} or f(x)−f(a)x−a\frac{f(x) - f(a)}{x - a}.
  1. Name the function ff and the point aa.
  1. Find f′(x)f'(x) with a derivative rule.
  1. Plug in aa. The limit equals f′(a)f'(a).

Example 15: A Sine Limit

Evaluate:
lim⁡h→0sin⁡(π6+h)−12h\lim_{h \to 0} \frac{\sin\left(\frac{\pi}{6} + h\right) - \frac{1}{2}}{h}
Step 1: Since sin⁡(π6)=12\sin\left(\frac{\pi}{6}\right) = \frac{1}{2}, this is f(a+h)−f(a)h\frac{f(a + h) - f(a)}{h} with f(x)=sin⁡xf(x) = \sin x and a=π6a = \frac{\pi}{6}.
Step 2: The derivative of sin⁡x\sin x is cos⁡x\cos x, so the limit is f′(π6)f'\left(\frac{\pi}{6}\right).
lim⁡h→0sin⁡(π6+h)−12h=cos⁡(π6)=32\lim_{h \to 0} \frac{\sin\left(\frac{\pi}{6} + h\right) - \frac{1}{2}}{h} = \cos\left(\frac{\pi}{6}\right) = \frac{\sqrt{3}}{2}

Example 16: A Natural Log Limit

Evaluate lim⁡x→1ln⁡xx−1\lim_{x \to 1} \frac{\ln x}{x - 1}.
Plugging in x=1x = 1 gives 00\frac{0}{0}. But ln⁡(1)=0\ln(1) = 0, so the numerator is really ln⁡x−ln⁡(1)\ln x - \ln(1):
lim⁡x→1ln⁡x−ln⁡(1)x−1\lim_{x \to 1} \frac{\ln x - \ln(1)}{x - 1}
That’s f(x)−f(a)x−a\frac{f(x) - f(a)}{x - a} with f(x)=ln⁡xf(x) = \ln x and a=1a = 1. Since f′(x)=1xf'(x) = \frac{1}{x}, the limit is f′(1)=11=1f'(1) = \frac{1}{1} = 1.

Example 17: A Cosine Limit

Evaluate lim⁡h→0cos⁡h−1h\lim_{h \to 0} \frac{\cos h - 1}{h}.
Since cos⁡(0)=1\cos(0) = 1, write it as cos⁡(0+h)−cos⁡(0)h\frac{\cos(0 + h) - \cos(0)}{h}. That’s f(a+h)−f(a)h\frac{f(a + h) - f(a)}{h} with f(x)=cos⁡xf(x) = \cos x and a=0a = 0.
lim⁡h→0cos⁡h−1h=−sin⁡(0)=0\lim_{h \to 0} \frac{\cos h - 1}{h} = -\sin(0) = 0
Key idea: the number being subtracted in the numerator has to equal f(a)f(a). Check that before you use the derivative.

Practice Problems

Problem 1. Find the derivative: f(x)=sin⁡x+cos⁡x+x2f(x) = \sin x + \cos x + x^2
f′(x)=cos⁡x−sin⁡x+2xf'(x) = \cos x - \sin x + 2x
Problem 2. Differentiate: g(x)=ex+4xg(x) = e^x + 4^x
g′(x)=ex+4xln⁡(4)g'(x) = e^x + 4^x \ln(4)
Problem 3. Find h′(x)h'(x) for h(x)=ln⁡x+log⁡2xh(x) = \ln x + \log_2 x
h′(x)=1x+1xln⁡(2)h'(x) = \frac{1}{x} + \frac{1}{x \ln(2)}
Problem 4. Evaluate f′(1)f'(1) if f(x)=5ln⁡x+3exf(x) = 5\ln x + 3e^x
f′(x)=5x+3exf'(x) = \frac{5}{x} + 3e^x, so f′(1)=5+3ef'(1) = 5 + 3e
Problem 5. Find g′(0)g'(0) for g(x)=sin⁡x+cos⁡xg(x) = \sin x + \cos x
g′(x)=cos⁡x−sin⁡xg'(x) = \cos x - \sin x, so g′(0)=1−0=1g'(0) = 1 - 0 = 1
Problem 6. Evaluate lim⁡h→0e3+h−e3h\lim_{h \to 0} \frac{e^{3 + h} - e^3}{h}
This is the derivative of exe^x at x=3x = 3, so the limit is e3e^3.

Summary of Derivative Rules

Most Common (memorize these)

Function
Derivative
sin⁡x\sin x
cos⁡x\cos x
cos⁡x\cos x
−sin⁡x-\sin x
exe^x
exe^x
ln⁡x\ln x
1x\frac{1}{x}

Less Common (still important)

Function
Derivative
axa^x
axln⁡(a)a^x \ln(a)
log⁡ax\log_a x
1xln⁡(a)\frac{1}{x \ln(a)}

Key Takeaways

  • Derivative of sine is cosine (positive)
  • Derivative of cosine is negative sine
  • Derivative of exe^x is itself
  • Derivative of ln⁡x\ln x is 1x\frac{1}{x}
  • For other bases (axa^x or log⁡ax\log_a x), you have to include ln⁡(a)\ln(a)
  • exe^x and ln⁡x\ln x are both special because ln⁡(e)=1\ln(e) = 1
  • Remember the inverse properties: eln⁡(a)=ae^{\ln(a)} = a and ln⁡(ea)=a\ln(e^a) = a
  • When evaluating at specific angles, use unit circle values
  • These rules combine with the power rule, constant multiple, and sum/difference rules
  • A limit that matches the definition of the derivative equals f′(a)f'(a), so you can evaluate it with a derivative rule

AP® is a registered trademark of the College Board, which is not affiliated with Dove's Library and was not involved in the production of, and does not endorse, this website.

Providing free, high-quality AP notes to help students succeed, earn college credit, and reach their educational goals, ensuring everyone has access to the resources they need.

© 2026 Standard Learning Group, Inc., which operates Dove's Library. All rights reserved.