Kim’s Math NotesCourse index

Derivatives of sin x, cos x, eˣ, ln x, and aˣ

How are the derivatives of sine and cosine obtained?

Find derivatives that use sinx, cosx, ex, lnx, and ax, know why the sine, cosine, and ex rules hold, and use them for tangent lines and rates with units.

The minus sign of cosine

Common mistake ddx[2cosx]=2sinx

Correction ddx[2cosx]=−2sinx. The “co” function gets the minus.

ex is not a power

Common mistake ddxex=xex−1

Correction The variable is in the exponent, so the power rule does not apply: ddxex=ex.

Stay in the domain of lnx

Common mistake f(x)=4lnx−x2: f′(x)=0 at x=2 and x=−2.

Correction lnx needs x>0, so only x=2.

Today's question

Last time I promised you four new functions. Here's the catch: the power rule only works on x to the n. Sine x, cosine x, e to the x, the natural log of x. None of these is a power of x. So where does the slope come from?

By the end, you'll have all four rules, plus a to the x.

Watch this part of the concept lesson

Read the rest of this scene

We go back to the definition, one more time.

Sine

Start with sine. We need an identity from precalculus: sine of x plus h is sine x cosine h, plus cosine x sine h. And we need two limits from Unit 1, too. As h goes to zero, sine h over h goes to one. And cosine h minus one, all over h, goes to zero.

Both of those are true only when h is measured in radians.

Watch this part of the concept lesson

Read the rest of this scene

That's why calculus always uses radians. Now the slope of sine. The limit as h goes to zero, of sine of x plus h, minus sine x, all over h. Put the identity in, and park the two sine x terms next to each other. Sine x cosine h, minus sine x, plus cosine x sine h, all over h.

Pull sine x out of the first two terms. Why group the sine x terms like that? Because now the fraction splits into two pieces, and both pieces are the Unit 1 limits. As h goes to zero, this piece goes to zero, and this piece goes to one. Sine x times zero, plus cosine x times one.

Only cosine x is left. So that's rule one. The derivative of sine x is cosine x.

Cosine

Cosine works the same way. Its identity: cosine of x plus h is cosine x cosine h, minus sine x sine h. This identity brings a minus, and that minus rides all the way down. The limit as h goes to zero, of cosine of x plus h, minus cosine x, all over h. Put the identity in and group the cosine x terms, just like before.

Cosine x times cosine h minus one over h, minus sine x times sine h over h.

Watch this part of the concept lesson

Read the rest of this scene

Same two pieces again, zero and one. Cosine x times zero, minus sine x times one. Here's rule two. The derivative of cosine x is negative sine x. That minus came straight from the identity.

e to the x

Now e to the x. Here's its difference quotient: e to the x plus h, minus e to the x, all over h. Split e to the x plus h into e to the x times e to the h, and pull e to the x out. Equals e to the x, times e to the h minus one, over h. Look at that last fraction.

Its limit is the slope of e to the x right at zero. And that's exactly what the number e is. e is the base whose tangent at zero has slope one. So the limit is one, and e to the x times one is e to the x. That's rule three.

Watch this part of the concept lesson

Read the rest of this scene

The derivative of e to the x is e to the x. Slope equals height. Careful with one look-alike. x to the e: here x is the base, and e is just a number up top. So the power rule works: e, times x to the e minus one.

Now turn it around. In e to the x, x sits in the exponent. That's not a power of x, so no power rule. It stays e to the x.

a^x and ln x

What if the base isn't e? Take a to the x, where a is positive. So the rule is: a to the x, times the natural log of a. For example, the derivative of two to the x is two to the x, times the natural log of two. And if a is e, the natural log of e is one, so we're back to e to the x.

Now the natural log.

Watch this part of the concept lesson

Read the rest of this scene

We'll prove this rule in Unit 3; today we use it. The derivative of the natural log of x is one over x, for x greater than zero. Why insist on x greater than zero? Plug in negative two: one over x gives negative one half. But the natural log of negative two isn't defined.

No curve there, so no slope there. Hold on to that; it comes back in Example one.

Combining derivative rules

These new rules mix with the old ones. Sums and constant multiples work the same way. Try three e to the x, minus two cosine x. Three e to the x, minus two times negative sine x. Two minuses meet.

So it's three e to the x, plus two sine x.

Watch this part of the concept lesson

Problem 1

Example one. f of x is four times the natural log of x, minus x squared, for x greater than zero. In part a, find f prime. In part b, find the tangent line at x equals one. In part c, where is the tangent line horizontal? The plan: go term by term, then the point and the slope, then set f prime to zero, and stay inside the domain.

Part a. f prime of x is four times one over x, minus two x.

Watch this part of the concept lesson

Read the rest of this scene

That's four over x, minus two x. In part b, find the point first. f of one is four times the natural log of one, minus one squared. The natural log of one is zero, so f of one is negative one. Now the slope. f prime of one is four over one, minus two, which is two.

Point and slope go into the line. y equals negative one, plus two times x minus one. Part c. Horizontal means slope zero. So set f prime equal to zero. Multiply through by x.

Four minus two x squared equals zero, so x squared is two. So x is plus or minus root two. But look back at the function. The natural log of x needs x greater than zero. So only root two counts.

On the graph, that's the one flat spot at the top. There's one like it in your workbook. Here's the slip: plus or minus root two, so two horizontal tangents. But f is only defined where x is positive. Negative root two is outside the domain.

No curve there, no tangent there.

Problem 2

Example two. This is the graph of f prime, not f. There's no formula for f, and that's fine. g of x is f of x, minus four times the natural log of x. Find g prime, then g prime of one, and decide whether g has a horizontal tangent at x equals four. The plan: write the structure first, then read f prime off the graph.

In part a, go term by term.

Watch this part of the concept lesson

Read the rest of this scene

g prime of x is f prime of x, minus four times one over x. Part b. g prime of one is f prime of one, minus four over one. Read f prime of one off the graph. It's the height at one, not the slope. The height at one is two.

So g prime of one is two minus four, negative two. Part c. A horizontal tangent means g prime of four is zero. g prime of four is f prime of four, minus four over four. Again, it's a height. The height at four is one.

So it's one minus one, which is zero. g prime of four is zero, so yes: the tangent to g is horizontal at x equals four. One more like this is in your workbook.

Worked examples

Example 1

Let f(x)=4lnx−x2 for x>0.
(a) Find f′(x).
(b) Write an equation of the tangent line at x=1.
(c) Where is the tangent line horizontal?
Hint

lnx lives only where x>0.

Answer and solution
  1. f′(x)=4x−2x
  2. y=−1+2(x−1)
  3. x=2 (not −2: lnx needs x>0)
  1. Type: tangent lines and a horizontal tangent. Method: f'(x) term by term; point and slope at x = 1; solve f'(x) = 0 inside the domain.
  2. f′(x)=4⋅1x−2x=4x−2x
  3. (b) f(1) = 4 ln 1 - 1 = -1 and f'(1) = 4 - 2 = 2, so y = -1 + 2(x - 1).
  4. 4x−2x=0⇒4=2x2⇒x2=2
  5. (c) x = sqrt(2) or x = -sqrt(2), but ln x is defined only for x > 0, so x = sqrt(2).

Example 2

The graph of f′, the derivative of f, is shown for 0<x<5.
Let g(x)=f(x)−4lnx.
(a) Write g′(x) in terms of f′(x).
(b) Find g′(1).
(c) Is the tangent line to the graph of g horizontal at x=4? Justify.
xy12345123y=f'(x)
Graph
Hint

Plan: structure first → then read f′ off the graph

Answer and solution
  1. f'(x)-4/x
  2. −2
  3. yes
  1. g′(x)=f′(x)−4⋅1x=f′(x)−4x
  2. f′(1) = the height of the graph at 1 =2, so g′(1)=2−4=−2.
  3. g′(4)=f′(4)−44=1−1=0: yes, the tangent line is horizontal at x=4.

Workbook

Problem 1

Let f(x)=x+2cosx for 0≤x≤2π. (a) Find all values of x where the line tangent to the graph of f is horizontal. (b) Write an equation of the tangent line at the smaller of these values.
Hint

Solve f′(x)=0 on the interval: sinx=12 has two solutions.

Answer and solution
  1. x=π6 and x=5π6
  2. y=π6+3
  1. f'(x) = 1 - 2 sin x. Horizontal tangent: 1 - 2 sin x = 0, so sin x = 1/2.
  2. (a) In [0, 2pi]: x = pi/6 and x = 5pi/6.
  3. (b) f(pi/6) = pi/6 + 2(sqrt(3)/2) = pi/6 + sqrt(3). The slope is 0, so the line is y = pi/6 + sqrt(3).

Common mistake Finding only one solution of sin x = 1/2 on [0, 2π].

Watch the worked solution to Problem 1

Problem 2

Let f(x)=sinx+cosx. (a) Find f′(x). (b) Find all x with 0≤x<2π where the line tangent to the graph of f is horizontal.
Hint

The derivative of cosx is −sinx.

Answer and solution
  1. f′(x)=cosx−sinx
  2. x=π4 and x=5π4, where cosx=sinx
  1. f′(x)=cosx+(−sinx)=cosx−sinx
  2. (b) Horizontal tangent: f'(x) = 0, so cos x = sin x. On [0, 2pi) that happens where both are sqrt(2)/2 or both are -sqrt(2)/2.
  3. x=π4,x=5π4

Common mistake Writing (cos x)' = sin x.

Watch the worked solution to Problem 2

Problem 3

The graph of f(x)=sinx is shown, with four points marked. At which of these values of x is the slope of the line tangent to the graph the greatest?
xy123456-11
Graph of f(x)
  1. π2
  2. π
  3. π6
  4. 3π2
Hint

The slope of sinx is cosx. Compare cosx at the four points.

Answer and solution

Answer C. π6

  1. The slope of the tangent line is f'(x) = cos x, not the height sin x.
  2. cosπ2=0,cosπ=−1,cosπ6=32,cos3π2=0
  3. The greatest slope is at pi/6 (C). (A) is the highest point, and (D) the lowest: there the slope is 0. (B) is the steepest drop, but its slope is -1, the least.

Common mistake Choosing the highest point π/2: height is not slope.

Watch the worked solution to Problem 3

Problem 4

The height of a buoy above the sea floor is H(t)=3+2sint meters, where t is the time in seconds. Which of the following is true at t=π3?
  1. The buoy is falling at 1 meter per second.
  2. The buoy is rising at 1 meter per second.
  3. The buoy is rising at 3 meters per second.
  4. The buoy is rising at 3+3 meters per second.
Hint

Rising or falling depends on the sign of H′(π/3).

Answer and solution

Answer B. The buoy is rising at 1 meter per second.

  1. The rate is H'(t) = 2 cos t meters per second.
  2. H′(π3)=2cosπ3=2⋅12=1
  3. Positive, so the buoy is rising at 1 meter per second: (B). (A) takes the derivative of sin t as -cos t. (C) takes it as sin t. (D) is the height H(pi/3), not the rate.

Common mistake Using sin instead of cos: √3 instead of 1.

Watch the worked solution to Problem 4

Problem 5

For which value of a>0 does the line tangent to the graph of y=lnx at x=a pass through the origin?
  1. 1
  2. 1e
  3. e
  4. There is no such value.
Hint

Write the tangent line at x=a and put in the point (0,0).

Answer and solution

Answer C. e

  1. At x = a the point is (a, ln a) and the slope is 1/a: y = ln a + (1/a)(x - a).
  2. 0=lna+1a(0−a)=lna−1⇒a=e
  3. Answer C.

Common mistake Putting the origin into ln x instead of into the tangent line.

Watch the worked solution to Problem 5

Problem 6

The amount of a medicine in a patient's blood is M(t)=20+12lnt−t milligrams, where t is the time in hours, 1≤t≤20.
  1. Find M′(4). Using correct units, explain the meaning of M′(4) in the context of the problem.
  2. Is the amount of medicine increasing or decreasing at time t=15? Give a reason for your answer.
  3. At what time t is the rate of change of the amount of medicine equal to 0?
Hint

Rate of change is M′(t). The sign tells increasing or decreasing.

Answer and solution
  1. M′(4)=2: at t=4 hours, the amount of medicine is increasing at a rate of 2 milligrams per hour
  2. decreasing, because M′(15)=−15<0
  3. t=12 hours
  1. M′(t)=12t−1
  2. (a) M'(4) = 3 - 1 = 2. At t = 4 hours, the amount of medicine is increasing at a rate of 2 milligrams per hour.
  3. (b) M'(15) = 12/15 - 1 = -1/5 < 0, so at t = 15 the amount is decreasing (at 1/5 milligram per hour).
  4. (c) 12/t - 1 = 0 gives t = 12 hours.

Common mistake Dropping the units, or the sign when deciding increasing or decreasing.

Watch the worked solution to Problem 6

Problem 7

The function f is differentiable, and selected values of f′ are given in the table. Let k(x)=3ex−2f(x).
x01
f′(x)5-2
  1. Write k′(x) in terms of f′(x).
  2. Find k′(0).
Hint

Use the f′ row of the table, not f.

Answer and solution
  1. k′(x)=3ex−2f′(x)
  2. k′(0)=3−10=−7
  1. k′(x)=3ex−2f′(x)
  2. (b) From the table, f'(0) = 5: k'(0) = 3e^0 - 2(5) = 3 - 10 = -7.

Common mistake Reading f instead of f' from the table.

Watch the worked solution to Problem 7

Problem 8

Let f(x)=5x+x5.
  1. Find f′(x).
  2. Find f′(1).
  3. Write an equation of the line tangent to the graph of f at x=0.
Hint

Ask where the x is. In x5 the base is x: power rule. In 5x the exponent is x: axlna.

Answer and solution
  1. f′(x)=5xln5+5x4
  2. f′(1)=5ln5+5
  3. f(0)=1, f′(0)=ln5: y=1+(ln5)x
  1. ddx5x=5xln5,ddxx5=5x4
  2. f′(x)=5xln5+5x4,f′(1)=5ln5+5
  3. f(0)=1+0=1,f′(0)=ln5,y=1+(ln5)x

Common mistake Using the power rule on 5^x.

Watch the worked solution to Problem 8

Problem 9

Let f(x)=x+acosx, where a≠0 is a constant.
  1. Show that the line y=x+a is tangent to the graph of f at x=0.
  2. Find all values of x in 0≤x≤4π where the line tangent to the graph of f is parallel to y=x+a. At which of these values is the line y=x+a itself the tangent line?
Hint

A tangent line needs the same slope and the same point. Parallel only means the same slope.

Answer and solution
  1. f(0)=a (on the line) and f′(0)=1−asin0=1 (same slope)
  2. parallel at x=0,π,2π,3π,4π; the tangent line is y=x+a at x=0,2π,4π (at π,3π it is y=x−a)
  1. f′(x)=1−asinx,f(0)=a,f′(0)=1
  2. (a) The point (0, a) is on y = x + a, and the slope is 1 there too, so y = x + a is the tangent line at x = 0.
  3. (b) Parallel: f'(x) = 1, so a sin x = 0, so sin x = 0: x = 0, pi, 2pi, 3pi, 4pi.
  4. The same line also needs f(x) = x + a, so cos x = 1: x = 0, 2pi, 4pi. At pi and 3pi, f(x) = x - a, so the tangent there is y = x - a.

Common mistake Calling every parallel tangent the line y = x + a without checking the height.

Watch the worked solution to Problem 9