Calculus3Differentiation Rules3 of 9
Differentiation Rules · 3

Trig, Exponential, and Log Derivatives

1

Derivatives of sin⁡x\sin x and cos⁡x\cos x

We know how to find the derivative of any power of xx, like x2x^2 or x3x^3. But functions like sin⁡x\sn{\sin x}, exe^x and ln⁡x\ln x aren't powers of xx, so the power rule can't tell us their derivatives.

To find the derivative of sin⁡x\sn{\sin x}, let's look at the slopes of its tangent lines, starting at x=0x = 0, where the slope is easiest to find. There we can use a limit from the Squeeze Theorem:

lim⁡h→0sin⁡hh\displaystyle \lim_{h\to 0}\frac{\sn{\sin h}}{h} =1,sin⁡h≈h\displaystyle = 1, \qquad \sn{\sin h} \approx h
Find the derivative of sin⁡x\sin x from the slopes of its graph
11
−1-1
yy
xx
00
π2\dfrac{\pi}{2}
π\pi
3π2\dfrac{3\pi}{2}
2π2\pi
y=sin⁡x\htmlClass{lc-violet}{y = \sin x}
Text solution
The slope at x=0x = 0For small hh, sin⁡h≈h\sn{\sin h} \approx h, so stepping right by hh raises sin⁡x\sn{\sin x} by about hh.
slope at 0\displaystyle \text{slope at } 0 =1\displaystyle = \sl{1}
The slope at x=πx = \piStepping right by hh from π\pi lowers sin⁡x\sn{\sin x} by about hh.
sin⁡(π+h)\displaystyle \sn{\sin(\pi + h)} =−sin⁡h≈−h  →  slope −1\displaystyle = -\sn{\sin h} \approx -h \;\to\; \text{slope } \ng{-1}
The other three pointsAt the maximum x=π2x = \frac{\pi}{2} and the minimum x=3π2x = \frac{3\pi}{2}, the tangent line is horizontal, so the slope is 00. At x=2πx = 2\pi, the graph repeats, so the slope is 1\sl{1} again.

Here are those five slopes on the graph:

xx
xx
11
−1-1
y=sin⁡x\htmlClass{lc-violet}{y = \sin x}
y=cos⁡x\htmlClass{lc-blue}{y = \cos x}
00
π2\dfrac{\pi}{2}
π\pi
3π2\dfrac{3\pi}{2}
2π2\pi
x=0 ⁣:slope 1=cos⁡0x=π2 ⁣:slope 0=cos⁡π2x=π ⁣:slope −1=cos⁡πx=3π2 ⁣:slope 0=cos⁡3π2x=2π ⁣:slope 1=cos⁡2π\displaystyle \begin{aligned} x = 0\!:&\quad \text{slope } \sl{1} = \cs{\cos 0}\\[4pt] x = \frac{\pi}{2}\!:&\quad \text{slope } 0 = \cs{\cos\frac{\pi}{2}}\\[4pt] x = \pi\!:&\quad \text{slope } \ng{-1} = \cs{\cos \pi}\\[4pt] x = \frac{3\pi}{2}\!:&\quad \text{slope } 0 = \cs{\cos\frac{3\pi}{2}}\\[4pt] x = 2\pi\!:&\quad \text{slope } \sl{1} = \cs{\cos 2\pi}\end{aligned}

Plotting the slope of sin⁡x\sn{\sin x} at every xx traces the graph of cos⁡x\cs{\cos x}.

ddxsin⁡x\displaystyle \frac{d}{dx}\sn{\sin x} =cos⁡x\displaystyle = \cs{\cos x}

For the derivative of cos⁡x\cs{\cos x}, we don't have to trace its slopes from scratch. The graph of cos⁡x\cs{\cos x} is just the graph of sin⁡x\sn{\sin x} shifted left by π2\frac{\pi}{2}, so its tangent lines are shifted too.

Find the derivative of cos⁡x\cos x by shifting the graph of sin⁡x\sin x
11
−1-1
11
−1-1
yy
slope\text{slope}
xx
xx
00
π2\dfrac{\pi}{2}
π\pi
3π2\dfrac{3\pi}{2}
2π2\pi
y=sin⁡x\htmlClass{lc-violet}{y = \sin x}
y=cos⁡x\htmlClass{lc-blue}{y = \cos x}
Text solution
Shift the slopes tooShifting a curve to the left moves each tangent line with it, keeping the same slope. So the graph of the slopes of cos⁡x\cs{\cos x} is the graph of the slopes of sin⁡x\sn{\sin x}, which is cos⁡x\cs{\cos x}, shifted left by π2\frac{\pi}{2}. That gives −sin⁡x\ng{-}\sn{\sin x}.
Check the minus signOn 0<x<π0 < x < \pi, cos⁡x\cs{\cos x} decreases from 11 to −1-1, so its slope is negative. But sin⁡x\sn{\sin x} is positive there, so the derivative has to be −sin⁡x\ng{-}\sn{\sin x}.
ddxcos⁡x\displaystyle \frac{d}{dx}\cs{\cos x} =−sin⁡x\displaystyle = \ng{-}\sn{\sin x}

Each derivative shifts the graph left by another π2\frac{\pi}{2}, so after four of them we're back at sin⁡x\sn{\sin x}.

sin⁡x\htmlClass{lc-violet}{\sin x}
cos⁡x\htmlClass{lc-blue}{\cos x}
−sin⁡x\htmlClass{lc-pink}{-}\htmlClass{lc-violet}{\sin x}
−cos⁡x\htmlClass{lc-pink}{-}\htmlClass{lc-blue}{\cos x}
sin⁡x  → d/dx   cos⁡x  → d/dx   −sin⁡x  → d/dx   −cos⁡x  → d/dx   sin⁡x\displaystyle \sn{\sin x} \;\xrightarrow{\ d/dx\ }\; \cs{\cos x} \;\xrightarrow{\ d/dx\ }\; \ng{-}\sn{\sin x} \;\xrightarrow{\ d/dx\ }\; \ng{-}\cs{\cos x} \;\xrightarrow{\ d/dx\ }\; \sn{\sin x}
sin⁡x  → d/dx   cos⁡x  → d/dx   −sin⁡x  → d/dx   −cos⁡x  → d/dx   sin⁡x\displaystyle \begin{aligned}&\sn{\sin x} \;\xrightarrow{\ d/dx\ }\; \cs{\cos x} \;\xrightarrow{\ d/dx\ }\; \ng{-}\sn{\sin x}\\ &\quad\;\xrightarrow{\ d/dx\ }\; \ng{-}\cs{\cos x} \;\xrightarrow{\ d/dx\ }\; \sn{\sin x}\end{aligned}

What graphs do we get when we plot the slopes of sine and cosine?

Slopes of sine and cosine
2

Derivatives of the other four trig functions

We already have the derivatives of sin⁡x\sn{\sin x} and cos⁡x\cs{\cos x}. But what about tan⁡x\tan x, sec⁡x\sec x, cot⁡x\cot x, and csc⁡x\csc x?

Every one of these four functions is a fraction made of sin⁡x\sin x and cos⁡x\cos x. So we don't need any new limits. We can find all four derivatives with the quotient rule and the identity sin⁡2x+cos⁡2x=1\lk{\sin^2 x + \cos^2 x = 1}.

tan⁡x=sin⁡xcos⁡x,sec⁡x=1cos⁡x,cot⁡x=cos⁡xsin⁡x,csc⁡x=1sin⁡x\displaystyle \begin{aligned}\tan x &= \frac{\sin x}{\cos x}, &\qquad \sec x &= \frac{1}{\cos x},\\[4pt] \cot x &= \frac{\cos x}{\sin x}, & \csc x &= \frac{1}{\sin x}\end{aligned}
sin⁡2x+cos⁡2x=1\displaystyle \lk{\sin^2 x + \cos^2 x = 1}
(fg)′\displaystyle \left(\frac{f}{g}\right)' =f′g−fg′g2\displaystyle = \frac{f'g - fg'}{g^2}
Find the derivatives of tan⁡x\tan x, sec⁡x\sec x, cot⁡x\cot x, and csc⁡x\csc x
ddxtan⁡x=  ?ddxsec⁡x=  ?ddxcot⁡x=  ?ddxcsc⁡x=  ?\displaystyle \begin{aligned}\frac{d}{dx}\tan x &= \;? &\qquad \frac{d}{dx}\sec x &= \;?\\[6pt] \frac{d}{dx}\cot x &= \;? & \frac{d}{dx}\csc x &= \;?\end{aligned}
ddxtan⁡x=  ?ddxsec⁡x=  ?ddxcot⁡x=  ?ddxcsc⁡x=  ?\displaystyle \begin{aligned}\frac{d}{dx}\tan x &= \;?\\[4pt] \frac{d}{dx}\sec x &= \;?\\[4pt] \frac{d}{dx}\cot x &= \;?\\[4pt] \frac{d}{dx}\csc x &= \;?\end{aligned}
Text solution
tan⁡x\tan x: the top becomes 1\lk{1}The two minuses make +sin⁡2x+\sin^2 x, so the top is cos⁡2x+sin⁡2x\lk{\cos^2 x + \sin^2 x}.
(sin⁡xcos⁡x)′\displaystyle \left(\frac{\sin x}{\cos x}\right)' =cos⁡2x+sin⁡2xcos⁡2x\displaystyle = \frac{\lk{\cos^2 x + \sin^2 x}}{\cos^2 x} =1cos⁡2x\displaystyle = \frac{\lk{1}}{\cos^2 x} =sec⁡2x\displaystyle = \sec^2 x
sec⁡x\sec x: split the cos⁡2x\cos^2 xThe derivative of 11 is 00, which leaves sin⁡x\sin x over cos⁡2x\cos^2 x. Splitting cos⁡2x\cos^2 x into cos⁡x⋅cos⁡x\cos x \cdot \cos x writes it with trig functions we know.
sin⁡xcos⁡2x\displaystyle \frac{\sin x}{\cos^2 x} =1cos⁡x⋅sin⁡xcos⁡x\displaystyle = \frac{1}{\cos x}\cdot\frac{\sin x}{\cos x} =sec⁡xtan⁡x\displaystyle = \sec x\tan x
cot⁡x\cot x and csc⁡x\csc x: the same stepsFor cot⁡x\cot x, the minus comes from the derivative of cos⁡x\cos x. For csc⁡x\csc x, it comes from the subtraction in the quotient rule.
(cos⁡xsin⁡x)′\displaystyle \left(\frac{\cos x}{\sin x}\right)' =−1sin⁡2x\displaystyle = \ng{-}\frac{\lk{1}}{\sin^2 x} =−csc⁡2x\displaystyle = \ng{-}\csc^2 x
(1sin⁡x)′\displaystyle \left(\frac{1}{\sin x}\right)' =−cos⁡xsin⁡2x\displaystyle = \ng{-}\frac{\cos x}{\sin^2 x} =−csc⁡xcot⁡x\displaystyle = \ng{-}\csc x\cot x

Here are all six derivatives in co-function pairs. Every "co" function (cos⁡x\cos x, cot⁡x\cot x, and csc⁡x\csc x) has a minus sign in its derivative, so once you know the derivatives of sin⁡x\sin x, tan⁡x\tan x, and sec⁡x\sec x, you can swap each function for its co-function and add a minus sign to get the other three.

ddxsin⁡x=cos⁡xddxcos⁡x=−sin⁡xddxtan⁡x=sec⁡2xddxcot⁡x=−csc⁡2xddxsec⁡x=sec⁡xtan⁡xddxcsc⁡x=−csc⁡xcot⁡x\displaystyle \begin{aligned}\frac{d}{dx}\sn{\sin x} &= \cs{\cos x} &\qquad\qquad \frac{d}{dx}\cs{\cos x} &= \ng{-}\sn{\sin x}\\[8pt] \frac{d}{dx}\tan x &= \sec^2 x & \frac{d}{dx}\cot x &= \ng{-}\csc^2 x\\[8pt] \frac{d}{dx}\sec x &= \sec x\tan x & \frac{d}{dx}\csc x &= \ng{-}\csc x\cot x\end{aligned}
ddxsin⁡x=cos⁡xddxcos⁡x=−sin⁡xddxtan⁡x=sec⁡2xddxcot⁡x=−csc⁡2xddxsec⁡x=sec⁡xtan⁡xddxcsc⁡x=−csc⁡xcot⁡x\displaystyle \begin{aligned}\frac{d}{dx}\sn{\sin x} &= \cs{\cos x}\\ \frac{d}{dx}\cs{\cos x} &= \ng{-}\sn{\sin x}\\[12pt] \frac{d}{dx}\tan x &= \sec^2 x\\ \frac{d}{dx}\cot x &= \ng{-}\csc^2 x\\[12pt] \frac{d}{dx}\sec x &= \sec x\tan x\\ \frac{d}{dx}\csc x &= \ng{-}\csc x\cot x\end{aligned}
3

The derivative of exe^x

We know the derivative of x2x^2 is 2x2x. But what if xx is in the exponent instead?

The power rule only works when the base is xx and the exponent is a constant, so the derivative of 2x\ex{2^x} is not x⋅2x−1x\cdot 2^{x-1}. Instead, we go back to the definition of the derivative, and the exponent rule 2x+h=2x⋅2h2^{x+h} = \ex{2^x} \cdot 2^h lets us factor 2x\ex{2^x} out:

2x+h\displaystyle 2^{x+h} =2x⋅2h\displaystyle = \ex{2^x}\cdot 2^h
2x+h−2xh\displaystyle \frac{2^{x+h} - \ex{2^x}}{h} =2x⋅2h−2xh\displaystyle = \frac{\ex{2^x}\cdot 2^h - \ex{2^x}}{h} =2x⋅2h−1h\displaystyle = \ex{2^x}\cdot\sl{\frac{2^h - 1}{h}}
2x+h−2xh=2x⋅2h−2xh=2x⋅2h−1h\displaystyle \begin{aligned}\frac{2^{x+h} - \ex{2^x}}{h} &= \frac{\ex{2^x}\cdot 2^h - \ex{2^x}}{h}\\[4pt] &= \ex{2^x}\cdot\sl{\frac{2^h - 1}{h}}\end{aligned}
Differentiate 2x2^x and find the base ee where the slope at 00 is 11
xx
yy
−1-1
11
22
y=2x\htmlClass{lc-blue}{y = 2^x}
Text solution
The fraction is the slope at 002h−1h\sl{\frac{2^h - 1}{h}} has no xx in it, and at x=0x = 0 it's the whole difference quotient. So its limit is the slope of 2x\ex{2^x} at 00, and every slope is the height times that number.
slope of 2x at x  \displaystyle \text{slope of } \ex{2^x} \text{ at } x \;=  2x⋅lim⁡h→02h−1h\displaystyle =\; \ex{2^x}\cdot\sl{\lim_{h\to 0}\frac{2^h - 1}{h}}
Estimate itWe can't plug in h=0h = 0, but a tiny hh gives a close value.
20.001−10.001≈0.693\displaystyle \sl{\frac{2^{0.001} - 1}{0.001} \approx 0.693}
slope≈0.693⋅2x\displaystyle \text{slope} \approx \sl{0.693}\cdot \ex{2^x}

For base 33, the slope at 00 is about 1.10\sl{1.10}. So somewhere between 22 and 33 there's a base whose slope at 00 is exactly 1\sl{1}, and that base is the number e≈2.718e \approx 2.718.

lim⁡h→02h−1h≈0.69lim⁡h→03h−1h≈1.10e≈2.718 ⁣:lim⁡h→0eh−1h=1\displaystyle \begin{aligned} &\sl{\lim_{h\to 0}\frac{2^h - 1}{h} \approx 0.69}\\[6pt] &\sl{\lim_{h\to 0}\frac{3^h - 1}{h} \approx 1.10}\\[6pt] e \approx 2.718\!: \quad &\sl{\lim_{h\to 0}\frac{e^h - 1}{h} = 1}\end{aligned}

Because the slope of ex\ex{e^x} at 00 is 1\sl{1}, its derivative is just ex⋅1\ex{e^x} \cdot \sl{1}, which is ex\ex{e^x}.

xx
yy
−2-2
−1-1
11
1/e\htmlClass{lc-blue}{1/e}
1\htmlClass{lc-blue}{1}
e\htmlClass{lc-blue}{e}
slope 1/e\htmlClass{lc-green}{\text{slope } 1/e}
slope 1\htmlClass{lc-green}{\text{slope } 1}
slope e\htmlClass{lc-green}{\text{slope } e}
y=ex\htmlClass{lc-blue}{y = e^x}
ddxex\displaystyle \frac{d}{dx}\ex{e^x} =ex\displaystyle = \ex{e^x}

So for ex\ex{e^x}, the slope equals the height at every point. At (0,1)(0, 1) the slope is 1\sl{1}, and near 00 the curve stays close to its tangent line, which we'll use in the next section:

tangent at (0,1) ⁣:y\displaystyle \text{tangent at } (0, 1)\!: \quad y =1+x\displaystyle = 1 + x
eu≈1+unear u\displaystyle e^u \approx 1 + u \quad \text{near } u =0\displaystyle = 0

How does the tangent slope compare with the height on each exponential graph?

Height and slope of an exponential

Now let's find where the curve y=xexy = x\ex{e^x} has a horizontal tangent. A horizontal tangent means the slope is 00, so we look for where y′=0y' = 0.

Find the point where y=xexy = xe^x has a horizontal tangent
xx
yy
−2-2
−1-1
y=xexy = x\htmlClass{lc-blue}{e^x}
Text solution
Product ruleThe derivative of xx is 11, and the derivative of ex\ex{e^x} is ex\ex{e^x}. Then factor out ex\ex{e^x}.
y′\displaystyle y' =1⋅ex+x⋅ex\displaystyle = 1\cdot \ex{e^x} + x\cdot \ex{e^x} =(x+1)ex\displaystyle = (x + 1)\ex{e^x}
ex\ex{e^x} is never 00For the product to be 00, one factor must be 00, and ex\ex{e^x} is positive for every xx.
x+1\displaystyle x + 1 =0  →  x\displaystyle = 0 \;\to\; x =−1\displaystyle = -1
The pointPlug x=−1x = -1 back into y=xexy = x\ex{e^x} to get the yy-coordinate.
y\displaystyle y =−1⋅e−1\displaystyle = -1\cdot \ex{e^{-1}} =−1e  →  (−1,−1e)\displaystyle = -\frac{1}{e} \;\to\; \left(-1, -\frac{1}{e}\right)
4

The derivative of bxb^x

Earlier we found that the slope of 2x\ex{2^x} at xx is 2x\ex{2^x} times its slope at 00, and we measured that slope at 00 to be about 0.693\sl{0.693}. But where does that number come from?

To find out, let's connect 2x\ex{2^x} to ex\ex{e^x}, whose slope near 00 we already know. The natural log undoes ex\ex{e^x}, so 2=eln⁡22 = e^{\ln 2}, and we can write 2h2^h as a power of ee:

2\displaystyle 2 =eln⁡2  →  2h\displaystyle = e^{\ln 2} \;\to\; 2^h =(eln⁡2)h\displaystyle = \left(e^{\ln 2}\right)^h =ehln⁡2\displaystyle = e^{h\ln 2}
2=eln⁡2→  2h=(eln⁡2)h=ehln⁡2\displaystyle \begin{aligned}&2 = e^{\ln 2}\\ &\quad\to\; 2^h = \left(e^{\ln 2}\right)^h = e^{h\ln 2}\end{aligned}
Find the slope of 2x2^x at 00 and the derivative of bxb^x
lim⁡h→02h−1h≈0.693\displaystyle \sl{\lim_{h\to 0}\frac{2^h - 1}{h} \approx 0.693} =  ?\displaystyle = \;?
ddxbx\displaystyle \frac{d}{dx}\ex{b^x} =  ?\displaystyle = \;?
Text solution
Use the tangent line of eue^uNear 00, eu≈1+ue^u \approx 1 + u. As hh goes to 00, so does u=hln⁡2u = h\ln 2.
2h\displaystyle 2^h =ehln⁡2≈1+hln⁡2\displaystyle = e^{h\ln 2} \approx 1 + h\ln 2
The 11s and the hhs cancel
2h−1h≈hln⁡2h\displaystyle \sl{\frac{2^h - 1}{h}} \approx \frac{h\ln 2}{h} =ln⁡2,lim⁡h→02h−1h=ln⁡2≈0.693\displaystyle = \sl{\ln 2}, \qquad \sl{\lim_{h\to 0}\frac{2^h - 1}{h} = \ln 2 \approx 0.693}
Any baseThe slope at xx is the height times the slope at 00. For any base b>0b > 0, writing b=eln⁡bb = e^{\ln b} makes the slope at 00 equal to ln⁡b\sl{\ln b}.

So the derivative of an exponential is the function times the natural log of its base:

ddx2x\displaystyle \frac{d}{dx}\ex{2^x} =2xln⁡2\displaystyle = \ex{2^x}\sl{\ln 2}
For any base b>0b > 0
ddxbx\displaystyle \frac{d}{dx}\ex{b^x} =bxln⁡b\displaystyle = \ex{b^x}\sl{\ln b}

When the base is ee, ln⁡e=1\sl{\ln e = 1}, so the derivative of ex\ex{e^x} is ex⋅1=ex\ex{e^x}\cdot \sl{1} = \ex{e^x}, just as we found before.

Be careful about where xx is. The power rule is for xx in the base with a constant exponent, and bxln⁡b\ex{b^x}\sl{\ln b} is for a constant base with xx in the exponent.

xx in the base
ddx x2\displaystyle \frac{d}{dx}\,\lk{x}^2 =2x\displaystyle = 2x
xx in the exponent
ddx 2x\displaystyle \frac{d}{dx}\,2^{\lk{x}} =2xln⁡2\displaystyle = \ex{2^x}\sl{\ln 2}

The number ee is a constant, about 2.7182.718. So for xe\lk{x}^e, xx is in the base and the power rule gives e xe−1e\,x^{e-1}. And e2e^2 is just a constant number, so its derivative is 00.

5

The derivative of ln⁡x\ln x

We know that the derivative of ex\ex{e^x} is ex\ex{e^x}, but what about its inverse, ln⁡x\lnx{\ln x}?

The graph of ln⁡x\lnx{\ln x} is the graph of ex\ex{e^x} reflected across the line y=xy = x. Reflecting swaps the coordinates of every point, so (a,b)(a, b) becomes (b,a)(b, a).

(1,e) on y\displaystyle (1, e) \text{ on } y =ex  →  (e,1) on y\displaystyle = \ex{e^x} \;\to\; (e, 1) \text{ on } y =ln⁡x\displaystyle = \lnx{\ln x}
(1,e) on y=ex→  (e,1) on y=ln⁡x\displaystyle \begin{aligned}&(1, e) \text{ on } y = \ex{e^x}\\ &\quad\to\; (e, 1) \text{ on } y = \lnx{\ln x}\end{aligned}

Each tangent line reflects with its point. For example, the point (ln⁡2,2)(\ln 2, 2) on y=exy = \ex{e^x} has slope 2\ex{2}: a run of 1\rn{1} gives a rise of 2\ex{2}. Reflected, the run and the rise swap, so the slope of ln⁡x\lnx{\ln x} at x=2x = 2 is 12\frac{\rn{1}}{\ex{2}}:

xx
yy
y=x\htmlClass{lc-mute}{y = x}
1\htmlClass{lc-pink}{1}
2\htmlClass{lc-blue}{2}
1\htmlClass{lc-pink}{1}
2\htmlClass{lc-blue}{2}
y=ex\htmlClass{lc-blue}{y = e^x}
y=ln⁡x\htmlClass{lc-violet}{y = \ln x}
(ln⁡2,2) on y=ex ⁣:slope=21=2\displaystyle \begin{aligned}&(\ln 2, 2) \text{ on } y = \ex{e^x}\!:\\ &\quad \text{slope} = \frac{\ex{2}}{\rn{1}} = \sl{2}\end{aligned}
(2,ln⁡2) on y=ln⁡x ⁣:slope=12\displaystyle \begin{aligned}&(2, \ln 2) \text{ on } y = \lnx{\ln x}\!:\\ &\quad \text{slope} = \frac{\rn{1}}{\ex{2}}\end{aligned}
Find the derivative of ln⁡x\ln x and log⁡bx\log_b x
xx
yy
y=x\htmlClass{lc-mute}{y = x}
y=ex\htmlClass{lc-blue}{y = e^x}
y=ln⁡x\htmlClass{lc-violet}{y = \ln x}
Text solution
Any positive xxThe point (ln⁡x,x)(\ln x, x) on y=exy = \ex{e^x} has slope x\ex{x}, so its reflection (x,ln⁡x)(x, \ln x) has run x\ex{x} and rise 1\rn{1}.
ddxln⁡x\displaystyle \frac{d}{dx}\lnx{\ln x} =1x\displaystyle = \frac{\rn{1}}{\ex{x}}
Other basesThe change-of-base formula writes log⁡2x\log_2 x as ln⁡x\lnx{\ln x} over ln⁡2\sl{\ln 2}, and 1ln⁡2\frac{1}{\sl{\ln 2}} is a constant we just keep.
log⁡2x\displaystyle \log_2 x =ln⁡xln⁡2  →  ddxlog⁡2x\displaystyle = \frac{\lnx{\ln x}}{\sl{\ln 2}} \;\to\; \frac{d}{dx}\log_2 x =1xln⁡2\displaystyle = \frac{1}{x\sl{\ln 2}}

So the derivative of ln⁡x\lnx{\ln x} is 1x\frac{1}{x}.

ddxln⁡x\displaystyle \frac{d}{dx}\lnx{\ln x} =1x\displaystyle = \frac{1}{x}

At x=0.1x = 0.1, the slope of ln⁡x\lnx{\ln x} is 10.1=10\frac{1}{0.1} = \sl{10}, so the curve has a large slope near 00. At x=10x = 10, the slope is 110=0.1\frac{1}{10} = \sl{0.1}, so the slope decreases as xx gets large.

For a logarithm with any base bb, the change-of-base formula gives:

ddxlog⁡bx\displaystyle \frac{d}{dx}\log_b x =1xln⁡b\displaystyle = \frac{1}{x\sl{\ln b}}

When you have the log of a product, quotient, or power, split it with log laws before differentiating.

ln⁡(ab)\displaystyle \ln(ab) =ln⁡a+ln⁡b,ln⁡ab\displaystyle = \ln a + \ln b, \qquad \ln\frac{a}{b} =ln⁡a−ln⁡b,ln⁡(an)\displaystyle = \ln a - \ln b, \qquad \ln(a^n) =nln⁡a\displaystyle = n\ln a
ln⁡(ab)=ln⁡a+ln⁡bln⁡ab=ln⁡a−ln⁡bln⁡(an)=nln⁡a\displaystyle \begin{aligned}\ln(ab) &= \ln a + \ln b\\ \ln\frac{a}{b} &= \ln a - \ln b\\ \ln(a^n) &= n\ln a\end{aligned}

For ln⁡(5x)\ln(5x), splitting gives ln⁡5+ln⁡x\ln 5 + \lnx{\ln x}. The ln⁡5\ln 5 is a constant, so its derivative is 00.

ln⁡(5x)=ln⁡5+ln⁡x→  ddxln⁡(5x)=0+1x=1xln⁡(x3)=3ln⁡x→  ddxln⁡(x3)=3x\displaystyle \begin{aligned}\ln(5x) &= \ln 5 + \lnx{\ln x} &&\to\; \frac{d}{dx}\ln(5x) = 0 + \frac{1}{x} = \frac{1}{x}\\[6pt] \ln(x^3) &= 3\lnx{\ln x} &&\to\; \frac{d}{dx}\ln(x^3) = \frac{3}{x}\end{aligned}
ln⁡(5x)=ln⁡5+ln⁡x→  ddxln⁡(5x)=0+1x=1x\displaystyle \begin{aligned}&\ln(5x) = \ln 5 + \lnx{\ln x}\\ &\quad\to\; \frac{d}{dx}\ln(5x) = 0 + \frac{1}{x} = \frac{1}{x}\end{aligned}
ln⁡(x3)=3ln⁡x→  ddxln⁡(x3)=3x\displaystyle \begin{aligned}&\ln(x^3) = 3\lnx{\ln x}\\ &\quad\to\; \frac{d}{dx}\ln(x^3) = \frac{3}{x}\end{aligned}

The graph of ln⁡(5x)\lnx{\ln(5x)} is just the graph of ln⁡x\lnx{\ln x} shifted up by ln⁡5\ln 5. Shifting a graph straight up doesn't change its slope anywhere, so the tangents at x=2x = 2 are parallel and both have slope 12\sl{\frac12}.

xx
yy
22
ln⁡5\ln 5
slope 12\htmlClass{lc-green}{\text{slope } \tfrac{1}{2}}
slope 12\htmlClass{lc-green}{\text{slope } \tfrac{1}{2}}
y=ln⁡x\htmlClass{lc-violet}{y = \ln x}
y=ln⁡(5x)\htmlClass{lc-violet}{y = \ln(5x)}

Summary

The six trig derivatives
ddxsin⁡x=cos⁡xddxcos⁡x=−sin⁡xddxtan⁡x=sec⁡2xddxcot⁡x=−csc⁡2xddxsec⁡x=sec⁡xtan⁡xddxcsc⁡x=−csc⁡xcot⁡x\displaystyle \begin{aligned}\frac{d}{dx}\sn{\sin x} &= \cs{\cos x} &\qquad\qquad \frac{d}{dx}\cs{\cos x} &= \ng{-}\sn{\sin x}\\[6pt] \frac{d}{dx}\tan x &= \sec^2 x & \frac{d}{dx}\cot x &= \ng{-}\csc^2 x\\[6pt] \frac{d}{dx}\sec x &= \sec x\tan x & \frac{d}{dx}\csc x &= \ng{-}\csc x\cot x\end{aligned}
ddxsin⁡x=cos⁡xddxcos⁡x=−sin⁡xddxtan⁡x=sec⁡2xddxcot⁡x=−csc⁡2xddxsec⁡x=sec⁡xtan⁡xddxcsc⁡x=−csc⁡xcot⁡x\displaystyle \begin{aligned}\frac{d}{dx}\sn{\sin x} &= \cs{\cos x}\\ \frac{d}{dx}\cs{\cos x} &= \ng{-}\sn{\sin x}\\[10pt] \frac{d}{dx}\tan x &= \sec^2 x\\ \frac{d}{dx}\cot x &= \ng{-}\csc^2 x\\[10pt] \frac{d}{dx}\sec x &= \sec x\tan x\\ \frac{d}{dx}\csc x &= \ng{-}\csc x\cot x\end{aligned}

Every co-function (cos⁡x\cos x, cot⁡x\cot x, and csc⁡x\csc x) has a minus sign in its derivative, while sin⁡x\sin x, tan⁡x\tan x, and sec⁡x\sec x don't. When you find the derivative of tan⁡x\tan x or cot⁡x\cot x with the quotient rule, the numerator simplifies using sin⁡2x+cos⁡2x=1\lk{\sin^2 x + \cos^2 x = 1}.

Why the derivative of cos⁡x\cos x has a minus sign

Between 00 and π\pi, cos⁡x\cs{\cos x} is decreasing, so its slope is negative. Since sin⁡x\sn{\sin x} is positive on 0<x<π0 < x < \pi, the derivative can't be sin⁡x\sn{\sin x}. It has to be −sin⁡x\ng{-}\sn{\sin x}.

Solving equations with exe^x
(x+1)ex\displaystyle (x + 1)\ex{e^x} =0  →  x\displaystyle = 0 \;\to\; x =−1\displaystyle = -1

Because ex>0\ex{e^x} > 0 for every xx, ex\ex{e^x} is never 00. An equation like g(x)ex=0g(x)\ex{e^x} = 0 has solutions only where g(x)=0g(x) = 0.

Base versus exponent
ddxex\displaystyle \frac{d}{dx}\ex{e^x} =ex\displaystyle = \ex{e^x}
ddxbx\displaystyle \frac{d}{dx}\ex{b^x} =bxln⁡b\displaystyle = \ex{b^x}\sl{\ln b}
3x→3xln⁡3,x3→3x2\displaystyle 3^{\lk{x}} \to \ex{3^x}\sl{\ln 3}, \qquad \lk{x}^3 \to 3x^2
xe→e xe−1,e2→0\displaystyle \lk{x}^e \to e\,x^{e-1}, \qquad e^2 \to 0

When xx is in the exponent and the base is a positive constant bb, the derivative is bxln⁡b\ex{b^x}\sl{\ln b}. When xx is in the base and the exponent is a constant number, use the power rule. Since e≈2.718e \approx 2.718 is a constant number, xe\lk{x}^e uses the power rule, and e2e^2 is a constant whose derivative is 00.

Logarithms and log laws
ddxln⁡x\displaystyle \frac{d}{dx}\lnx{\ln x} =1x\displaystyle = \frac{1}{x}
ddxlog⁡bx\displaystyle \frac{d}{dx}\log_b x =1xln⁡b\displaystyle = \frac{1}{x\sl{\ln b}}
ln⁡(5x)\displaystyle \ln(5x) =ln⁡5+ln⁡x  →  1x\displaystyle = \ln 5 + \lnx{\ln x} \;\to\; \frac{1}{x}

Use the log laws to split apart products, quotients, or powers inside a logarithm before taking the derivative. For ln⁡(5x)\ln(5x), splitting gives ln⁡5+ln⁡x\ln 5 + \lnx{\ln x}. The constant ln⁡5\ln 5 differentiates to 00, so the derivative is 1x\frac{1}{x}, not 5x\frac{5}{x}.

6

Practice

Enter exact values.

1
Find ddx(4cos⁡x−3cot⁡x+5ex)\dfrac{d}{dx}\left(4\cos x - 3\cot x + 5e^x\right).

What are the derivatives of cos⁡x\cos x and cot⁡x\cot x? Remember to multiply the derivative of cot⁡x\cot x by −3-3.

If you got 4sin⁡x+3csc⁡2x+5ex4\sin x + 3\csc^2 x + 5e^x Check the derivative of cos⁡x\cos x. The derivative of cos⁡x\cos x has a minus sign.

If you got −4sin⁡x−3csc⁡2x+5ex-4\sin x - 3\csc^2 x + 5e^x Check the sign on the second term. The derivative of cot⁡x\cot x is −csc⁡2x-\csc^2 x, so multiplying by −3-3 gives a positive term.

Both cos⁡x\cos x and cot⁡x\cot x are co-functions, so each derivative gets a minus sign.
(cos⁡x)′\displaystyle (\cos x)' =−sin⁡x,(cot⁡x)′\displaystyle = \ng{-}\sin x, \qquad (\cot x)' =−csc⁡2x\displaystyle = \ng{-}\csc^2 x
Differentiate term by term, and watch the two minus signs on the second term.
ddx(4cos⁡x−3cot⁡x+5ex)=−4sin⁡x−3(−csc⁡2x)+5ex=−4sin⁡x+3csc⁡2x+5ex\displaystyle \begin{aligned}&\frac{d}{dx}\left(4\cos x - 3\cot x + 5\ex{e^x}\right)\\ &\quad= \ng{-}4\sin x - 3\left(\ng{-}\csc^2 x\right) + 5\ex{e^x}\\ &\quad= \ng{-}4\sin x + 3\csc^2 x + 5\ex{e^x}\end{aligned}
2
Find ddx(x2+2x+xe+e2)\dfrac{d}{dx}\left(x^2 + 2^x + x^e + e^2\right).

Look at where xx is in each term. Is xx the base, the exponent, or is there no xx at all?

If you got 2x+x⋅2x−1+e xe−12x + x\cdot 2^{x-1} + e\,x^{e-1} In 2x2^x, xx is in the exponent. Use the rule for bxb^x, not the power rule.

If you got 2x+2xln⁡2+e xe−1+2e2x + 2^x\ln 2 + e\,x^{e-1} + 2e ee is a constant number, so e2e^2 is a constant too. What is the derivative of any constant?

In x2\lk{x}^2, xx is in the base, so we use the power rule. In 2x2^{\lk{x}}, the base is fixed and xx is in the exponent, so we multiply by ln⁡2\sl{\ln 2}.
x2→2x,2x→2xln⁡2\displaystyle \lk{x}^2 \to 2x, \qquad 2^{\lk{x}} \to \ex{2^x}\sl{\ln 2}
In xe\lk{x}^e, the power ee is a constant number, so we use the power rule. e2e^2 has no xx, so its derivative is 00.
xe→e xe−1,e2→0\displaystyle \lk{x}^e \to e\,x^{e-1}, \qquad e^2 \to 0
Add the four derivatives together.
ddx(x2+2x+xe+e2)=2x+2xln⁡2+e xe−1\displaystyle \begin{aligned}&\frac{d}{dx}\left(x^2 + 2^x + x^e + e^2\right)\\ &\quad= 2x + \ex{2^x}\sl{\ln 2} + e\,x^{e-1}\end{aligned}
3
Find ddx(x3ln⁡x)\dfrac{d}{dx}\left(x^3\ln x\right).

x3ln⁡xx^3\ln x is a product of two functions, so we need the product rule. What does x3⋅1xx^3\cdot\frac{1}{x} simplify to?

If you got 3x3x That comes from multiplying the two derivatives together. Use the product rule, f′g+fg′f'g + fg'.

Use the product rule, then simplify x3⋅1xx^3\cdot\frac{1}{x} to x2x^2.
(x3ln⁡x)′=3x2⋅ln⁡x+x3⋅1x=3x2ln⁡x+x2\displaystyle \begin{aligned}\left(x^3\lnx{\ln x}\right)' &= 3x^2\cdot\lnx{\ln x} + x^3\cdot\frac{1}{x}\\ &= 3x^2\lnx{\ln x} + x^2\end{aligned}
4
Find ddx(sec⁡xtan⁡x)\dfrac{d}{dx}\left(\sec x\tan x\right).

Use the product rule on sec⁡xtan⁡x\sec x\tan x. What are the derivatives of sec⁡x\sec x and tan⁡x\tan x?

If you got sec⁡3xtan⁡x\sec^3 x\tan x That is the product of the two separate derivatives. Use the product rule, f′g+fg′f'g + fg'.

Find the derivative of each factor first.
(sec⁡x)′\displaystyle (\sec x)' =sec⁡xtan⁡x,(tan⁡x)′\displaystyle = \sec x\tan x, \qquad (\tan x)' =sec⁡2x\displaystyle = \sec^2 x
Plug both derivatives into the product rule, then multiply tan⁡x\tan x by tan⁡x\tan x and sec⁡x\sec x by sec⁡2x\sec^2 x.
(sec⁡xtan⁡x)′=sec⁡xtan⁡x⋅tan⁡x+sec⁡x⋅sec⁡2x=sec⁡xtan⁡2x+sec⁡3x\displaystyle \begin{aligned}&(\sec x\tan x)'\\ &\quad= \sec x\tan x\cdot\tan x + \sec x\cdot\sec^2 x\\ &\quad= \sec x\tan^2 x + \sec^3 x\end{aligned}
5
Differentiate y=sin⁡x1+cos⁡xy = \dfrac{\sin x}{1 + \cos x} and simplify.

Use the quotient rule, then look for cos⁡2x+sin⁡2x\cos^2 x + \sin^2 x in the numerator.

If you got cos⁡x+cos⁡2x−sin⁡2x(1+cos⁡x)2\dfrac{\cos x + \cos^2 x - \sin^2 x}{(1 + \cos x)^2} Check the sign on the second term in the numerator. Subtracting sin⁡x(−sin⁡x)\sin x(-\sin x) gives +sin⁡2x+\sin^2 x.

Apply the quotient rule. Subtracting sin⁡x (−sin⁡x)\sin x\,(\ng{-}\sin x) gives +sin⁡2x+\sin^2 x.
y′=cos⁡x (1+cos⁡x)−sin⁡x (−sin⁡x)(1+cos⁡x)2=cos⁡x+cos⁡2x+sin⁡2x(1+cos⁡x)2\displaystyle \begin{aligned}y' &= \frac{\cos x\,(1 + \cos x) - \sin x\,(\ng{-}\sin x)}{(1 + \cos x)^2}\\ &= \frac{\cos x + \lk{\cos^2 x + \sin^2 x}}{(1 + \cos x)^2}\end{aligned}
Replace cos⁡2x+sin⁡2x\lk{\cos^2 x + \sin^2 x} with 1\lk{1}, then cancel the common factor of 1+cos⁡x1 + \cos x.
cos⁡x+1(1+cos⁡x)2\displaystyle \frac{\cos x + \lk{1}}{(1 + \cos x)^2} =11+cos⁡x\displaystyle = \frac{1}{1 + \cos x}
6
Let f(x)=log⁡3x+3xf(x) = \log_3 x + 3^x. Find f′(1)f'(1).

Use the rule for each base-33 function. Where does ln⁡3\ln 3 go in the derivative of log⁡3x\log_3 x, and where does it go in the derivative of 3x3^x?

For log⁡3x\log_3 x, the ln⁡3\sl{\ln 3} goes in the denominator, but for 3x\ex{3^x}, we multiply by ln⁡3\sl{\ln 3}.
f′(x)\displaystyle f'(x) =1xln⁡3+3xln⁡3\displaystyle = \frac{1}{x\sl{\ln 3}} + \ex{3^x}\sl{\ln 3}
Plug in x=1x = 1.
f′(1)\displaystyle f'(1) =1ln⁡3+3ln⁡3\displaystyle = \frac{1}{\sl{\ln 3}} + 3\sl{\ln 3}
7
Find every xx in [0,2π][0, 2\pi] where f(x)=exsin⁡xf(x) = e^x\sin x has a horizontal tangent.

Use the product rule to find f′(x)f'(x), then factor out exe^x. Can exe^x ever equal 00?

After setting sin⁡x+cos⁡x=0\sin x + \cos x = 0, you get tan⁡x=−1\tan x = -1. What angles in [0,2π][0, 2\pi] have tan⁡x=−1\tan x = -1?

Find f′(x)f'(x) using the product rule, and factor out ex\ex{e^x}.
f′(x)=exsin⁡x+excos⁡x=ex(sin⁡x+cos⁡x)\displaystyle \begin{aligned}f'(x) &= \ex{e^x}\sin x + \ex{e^x}\cos x\\ &= \ex{e^x}(\sin x + \cos x)\end{aligned}
ex\ex{e^x} is always positive, so set sin⁡x+cos⁡x=0\sin x + \cos x = 0 and divide by cos⁡x\cos x.
ex>0  →  sin⁡x+cos⁡x=0→  tan⁡x=−1\displaystyle \begin{aligned}&\ex{e^x} > 0 \;\to\; \sin x + \cos x = 0\\ &\quad\to\; \tan x = -1\end{aligned}
On [0,2π][0, 2\pi], tan⁡x=−1\tan x = -1 in the second and fourth quadrants, at reference angle π4\frac{\pi}{4}.
x\displaystyle x =3π4,x\displaystyle = \frac{3\pi}{4}, \qquad x =7π4\displaystyle = \frac{7\pi}{4}
8
Find the equation of the line through the origin that is tangent to y=ln⁡xy = \ln x. Challenge

The origin is not on the curve. Write the tangent line at an unknown point of tangency (a,ln⁡a)(a, \ln a), then plug in (0,0)(0, 0) to find aa.

If you got y=x−1y = x - 1 That is the tangent line at (1,0)(1, 0), which has y-intercept −1-1 and does not pass through the origin.

Tangent line at an unknown pointThe derivative of ln⁡x\lnx{\ln x} is 1x\frac{1}{x}, so the tangent line at an unknown point of tangency (a,ln⁡a)(a, \ln a) has slope 1a\sl{\frac{1}{a}}.
tangent at (a,ln⁡a) ⁣:y=ln⁡a+1a(x−a)\displaystyle \begin{aligned}&\text{tangent at } (a, \ln a)\!:\\ &\quad y = \ln a + \frac{1}{a}(x - a)\end{aligned}
Find the point of tangencyThe line passes through (0,0)(0, 0), so plug in x=0x = 0 and y=0y = 0 to solve for aa.
(0,0) ⁣:0\displaystyle (0, 0)\!: \quad 0 =ln⁡a−1  →  a\displaystyle = \ln a - 1 \;\to\; a =e\displaystyle = e
Write the linePlug a=ea = e back into the tangent line equation and simplify.
y\displaystyle y =1+1e(x−e)\displaystyle = 1 + \frac{1}{e}(x - e) =xe\displaystyle = \frac{x}{e}