Skip to content
Family Table Math

Derivatives of Sine, Cosine, eˣ, and ln x

The power rule handles powers of xx, but calculus also needs trig, exponential, and logarithmic functions. Their derivatives turn out to be surprisingly neat: the slope of sin⁡x\sin x is cos⁡x\cos x, the slope of exe^x is exe^x itself, and the slope of ln⁡x\ln x is 1x\dfrac{1}{x}. All trig in calculus is in radians.

In Grade 11 you probably measured angles in degrees. Calculus uses radians, where π\pi radians =180∘= 180^\circ, so π2=90∘\dfrac{\pi}{2} = 90^\circ, π3=60∘\dfrac{\pi}{3} = 60^\circ, and π6=30∘\dfrac{\pi}{6} = 30^\circ. The derivative rules below are only true in radians. If you use a calculator on the AP exam, make sure it is in radian mode.

FunctionDerivative
sin⁡x\sin xcos⁡x\cos x
cos⁡x\cos x−sin⁡x-\sin x
exe^xexe^x
ln⁡x\ln x1x\dfrac{1}{x} (for x>0x \gt 0)

They work with the constant multiple, sum, and difference rules from the power rule page, so, for example, ddx[3sin⁡x−x2]=3cos⁡x−2x\dfrac{d}{dx}\big[3\sin x - x^2\big] = 3\cos x - 2x.

Look at the slopes of y=sin⁡xy = \sin x. At x=0x = 0 the graph climbs with slope 11; at x=π2x = \tfrac{\pi}{2} it’s flat (slope 00); at x=πx = \pi it falls with slope −1-1. Plot those slopes and you get the graph of cos⁡x\cos x.

Top: y = sin x from -π/4 to 9π/4 with short tangent lines at x = 0, π/2, π, 3π/2 and 2π, whose slopes are 1, 0, -1, 0 and 1. Bottom: y = cos x, which passes through the values 1, 0, -1, 0, 1 at those same x-values, so cos x gives the slope of sin x. −1 1 y = sin x (slopes shown in orange) −1 1 y = cos x (the slopes of sin x) π/2 π 3π/2 2π π/2 π 3π/2 2π
The slopes of y=sin⁡xy = \sin x (top) are the values of y=cos⁡xy = \cos x (bottom). The xx-axis is in radians.

The algebra behind this uses the limit lim⁡h→0sin⁡hh=1\displaystyle\lim_{h \to 0} \frac{\sin h}{h} = 1, which is only true when hh is in radians. That’s why radians matter.

The derivative of cos⁡x\cos x works the same way. Its graph falls just after x=0x = 0, which is why its derivative, −sin⁡x-\sin x, has a minus sign.

Every exponential graph y=bxy = b^x has a slope at x=0x = 0. The number e≈2.718e \approx 2.718 is the base where that slope is exactly 11. With that choice, the slope of exe^x at every point equals its height, so ddx[ex]=ex\dfrac{d}{dx}\big[e^x\big] = e^x.

The natural logarithm ln⁡x\ln x is the inverse of exe^x. Its slope is 1x\dfrac{1}{x}: steep near x=0x = 0 and flattening out as xx grows.

The derivatives of tan⁡x\tan x, cot⁡x\cot x, sec⁡x\sec x, and csc⁡x\csc x come from writing them as quotients of sine and cosine. See the quotient rule. Functions like sin⁡(2x)\sin(2x) or e3xe^{3x} need the chain rule, in the next unit.

Differentiate y=3sin⁡x−4cos⁡xy = 3\sin x - 4\cos x.

Solution. Use the constant multiple rule on each term. Careful with the sign on the cosine term:

dydx=3cos⁡x−4(−sin⁡x)=3cos⁡x+4sin⁡x\frac{dy}{dx} = 3\cos x - 4(-\sin x) = 3\cos x + 4\sin x

Find f′(x)f'(x) for f(x)=2ex−5ln⁡x+x2f(x) = 2e^x - 5\ln x + x^2.

Solution.

f′(x)=2ex−5x+2xf'(x) = 2e^x - \frac{5}{x} + 2x

Find the equation of the tangent line to y=sin⁡xy = \sin x at x=π3x = \dfrac{\pi}{3}.

Solution. Point: sin⁡π3=32\sin \dfrac{\pi}{3} = \dfrac{\sqrt{3}}{2}. Slope: y′=cos⁡xy' = \cos x, and cos⁡π3=12\cos \dfrac{\pi}{3} = \dfrac{1}{2}.

y−32=12(x−π3)y - \frac{\sqrt{3}}{2} = \frac{1}{2}\left(x - \frac{\pi}{3}\right)

Point-slope form is the cleanest way to leave this answer.

Example 4: Horizontal tangents on an interval

Section titled “Example 4: Horizontal tangents on an interval”

Find the xx-values in [0,2π][0, 2\pi] where f(x)=x+2cos⁡xf(x) = x + 2\cos x has a horizontal tangent.

Solution. f′(x)=1−2sin⁡xf'(x) = 1 - 2\sin x. Set it equal to 00:

1−2sin⁡x=0⇒sin⁡x=121 - 2\sin x = 0 \quad\Rightarrow\quad \sin x = \frac{1}{2}

In [0,2π][0, 2\pi], sin⁡x=12\sin x = \tfrac{1}{2} at x=π6x = \dfrac{\pi}{6} and x=5π6x = \dfrac{5\pi}{6} (the special angles 30∘30^\circ and 150∘150^\circ, in radians).

Getting the sign of the cosine derivative wrong. ddx[cos⁡x]=−sin⁡x\dfrac{d}{dx}[\cos x] = -\sin x, but ddx[sin⁡x]=+cos⁡x\dfrac{d}{dx}[\sin x] = +\cos x. A quick check: cos⁡x\cos x is decreasing just after x=0x = 0, so its derivative must be negative there.

Working in degrees. ddx[sin⁡x]=cos⁡x\dfrac{d}{dx}[\sin x] = \cos x is only true in radians. Answers like x=30x = 30 instead of x=π6x = \dfrac{\pi}{6} lose marks, and a calculator in degree mode gives wrong slopes.

Using the power rule on exe^x. ddx[ex]\dfrac{d}{dx}\big[e^x\big] is exe^x, not xex−1xe^{x - 1}. The power rule only applies when the exponent is a constant.

Treating constants like functions. e2e^2, ln⁡5\ln 5, and sin⁡π4\sin \tfrac{\pi}{4} are numbers, so their derivatives are 00. Only expressions containing xx change.

Thinking ddx[sin⁡2x]=cos⁡2x\dfrac{d}{dx}[\sin 2x] = \cos 2x. When the inside is more than just xx, you need the chain rule (next unit). For now, stick to sin⁡x\sin x, cos⁡x\cos x, exe^x, and ln⁡x\ln x exactly.

1. (Warm-up) Differentiate each.

  • (a) 5cos⁡x5\cos x
  • (b) ex+4e^x + 4
  • (c) ln⁡x−x\ln x - x
Solution

(a) −5sin⁡x-5\sin x

(b) exe^x

(c) 1x−1\dfrac{1}{x} - 1

2. (Warm-up) Let f(x)=sin⁡x+cos⁡xf(x) = \sin x + \cos x. Find f′(π4)f'\left(\dfrac{\pi}{4}\right).

Solution

f′(x)=cos⁡x−sin⁡xf'(x) = \cos x - \sin x, so

f′(π4)=22−22=0f'\left(\frac{\pi}{4}\right) = \frac{\sqrt{2}}{2} - \frac{\sqrt{2}}{2} = 0

The graph has a horizontal tangent at x=π4x = \dfrac{\pi}{4}.

3. (Warm-up) Find the slope of y=4ln⁡xy = 4\ln x at x=2x = 2.

Solution

y′=4xy' = \dfrac{4}{x}, so the slope at x=2x = 2 is 42=2\dfrac{4}{2} = 2.

4. (Core) Find dydx\dfrac{dy}{dx} for y=3ex−2x+ln⁡(x4)y = 3e^x - 2\sqrt{x} + \ln\big(x^4\big), for x>0x \gt 0. (Hint: use a log law first.)

Solution

By the power law of logarithms, ln⁡(x4)=4ln⁡x\ln\big(x^4\big) = 4\ln x. Also 2x=2x1/22\sqrt{x} = 2x^{1/2}.

dydx=3ex−x−1/2+4x=3ex−1x+4x\frac{dy}{dx} = 3e^x - x^{-1/2} + \frac{4}{x} = 3e^x - \frac{1}{\sqrt{x}} + \frac{4}{x}

5. (Core) Find the tangent line to y=exy = e^x at x=0x = 0, and the tangent line to y=ln⁡xy = \ln x at x=1x = 1.

Solution

For y=exy = e^x: the point is (0,1)(0, 1) and the slope is e0=1e^0 = 1, so y=x+1y = x + 1.

For y=ln⁡xy = \ln x: the point is (1,0)(1, 0) and the slope is 11=1\dfrac{1}{1} = 1, so y=x−1y = x - 1.

(The two graphs are reflections of each other in y=xy = x, and so are these two tangent lines.)

6. (Core) Find all xx in [0,2π][0, 2\pi] where f(x)=2sin⁡x+xf(x) = 2\sin x + x has a horizontal tangent.

Solution

f′(x)=2cos⁡x+1=0f'(x) = 2\cos x + 1 = 0, so cos⁡x=−12\cos x = -\dfrac{1}{2}.

In [0,2π][0, 2\pi]: x=2π3x = \dfrac{2\pi}{3} or x=4π3x = \dfrac{4\pi}{3}.

7. (Core) (Calculator allowed.) Let f(x)=ex−4cos⁡xf(x) = e^x - 4\cos x. Find f′(1)f'(1), correct to three decimal places.

Solution

f′(x)=ex+4sin⁡xf'(x) = e^x + 4\sin x. In radian mode:

f′(1)=e+4sin⁡1≈2.71828+3.36588≈6.084f'(1) = e + 4\sin 1 \approx 2.71828 + 3.36588 \approx 6.084

8. (Challenge) Find the tangent line to y=ln⁡xy = \ln x that passes through the origin.

Solution

The tangent line at x=ax = a goes through (a,ln⁡a)(a, \ln a) with slope 1a\dfrac{1}{a}:

y−ln⁡a=1a(x−a)y - \ln a = \frac{1}{a}(x - a)

For it to pass through (0,0)(0, 0):

0−ln⁡a=1a(0−a)=−1⇒ln⁡a=1⇒a=e0 - \ln a = \frac{1}{a}(0 - a) = -1 \quad\Rightarrow\quad \ln a = 1 \quad\Rightarrow\quad a = e

The tangent line is y−1=1e(x−e)y - 1 = \dfrac{1}{e}(x - e), which simplifies to y=xey = \dfrac{x}{e}.

9. (Challenge) Find all xx in [0,2π)[0, 2\pi) where the tangent lines to y=sin⁡xy = \sin x and y=cos⁡xy = \cos x are parallel.

Solution

Parallel means equal slopes:

cos⁡x=−sin⁡x⇒tan⁡x=−1(cos⁡x≠0)\cos x = -\sin x \quad\Rightarrow\quad \tan x = -1 \quad (\cos x \ne 0)

(If cos⁡x=0\cos x = 0 then sin⁡x=±1\sin x = \pm 1, so the equation can’t hold. Dividing by cos⁡x\cos x is safe.)

In [0,2π)[0, 2\pi): x=3π4x = \dfrac{3\pi}{4} or x=7π4x = \dfrac{7\pi}{4}.