Unit 2 · Topic 2.7 Beta

Derivatives of sin x, cos x, e to the x and ln x

5 min read · freeNot practiced

Polynomials are only the beginning. Waves, growth and decay are described by sine, cosine, the exponential exe^x and the natural logarithm ln⁡x\ln x. Their derivatives are short and worth memorizing, and each one makes sense from a picture. This page gives all four, shows where they come from, and uses them to evaluate limits that are derivatives in disguise.

Sine and cosine

Look at the graph of y=sin⁡xy = \sin x and track its slope. At x=0x = 0 it rises with slope 1. At π2\frac{\pi}{2}, the top of the wave, its tangent line is level: slope 0. At π\pi it falls with slope −1-1. At 3π2\frac{3\pi}{2}, the bottom, the slope is 0 again, and at 2π2\pi it is back to 1. The list 1,0,−1,0,11, 0, -1, 0, 1 is exactly the list of heights of cos⁡x\cos x at those inputs.

Top: y = sin x from 0 to 2 pi with short tangent segments at 0, pi/2, pi, 3pi/2 and 2pi, whose slopes are 1, 0, minus 1, 0 and 1. Bottom, on the same scale: y = cos x, whose heights at those x values are 1, 0, minus 1, 0 and 1. The derivative of sin x is cos x.
Figure 1. Each slope of sin⁡x\sin x (top) is the height of cos⁡x\cos x (bottom) at the same xx. LevlPrep original diagram.

That match holds at every xx:

ddx(sin⁡x)=cos⁡x,ddx(cos⁡x)=−sin⁡x.\frac{d}{dx}(\sin x) = \cos x, \qquad \frac{d}{dx}(\cos x) = -\sin x.

The minus sign for cosine is easy to check: just right of x=0x = 0, the graph of cos⁡x\cos x starts to fall, so its slope is negative, while sin⁡x\sin x is positive there.

Why is the slope of sin⁡x\sin x at 0 exactly 1? The difference quotient at 0 is sin⁡h−sin⁡0h\frac{\sin h - \sin 0}{h}=sin⁡hh= \frac{\sin h}{h}, and Unit 1 showed with the squeeze theorem that limh→0sin⁡hh\lim_{h \to 0} \frac{\sin h}{h}=1= 1. That limit is true only when angles are measured in radians, so these formulas are radian formulas. In degrees, every slope would pick up an extra factor of π180\frac{\pi}{180}.

The exponential exe^x

Every exponential graph bxb^x has a slope equal to a fixed multiple of its height. For one special base, the slope at x=0x = 0 is exactly 1, and then the slope at every point equals the height. That base is e≈2.718e \approx 2.718, and so

ddx(ex)=ex.\frac{d}{dx}\left( e^x \right) = e^x.

The function is its own derivative. At x=0x = 0 the slope is 1; at x=ln⁡3x = \ln 3 the height is 3 and so is the slope. Do not use the power rule here: in exe^x the variable is the exponent, so xex−1xe^{x - 1} is wrong.

The natural logarithm

For x>0x > 0,

ddx(ln⁡x)=1x.\frac{d}{dx}(\ln x) = \frac{1}{x}.

The graph of ln⁡x\ln x is steep near 0 and flattens as xx grows, matching 1x\frac{1}{x}: large for small xx, small for large xx, and always positive, because ln⁡x\ln x always increases. Unit 3 shows why this formula follows from the one for exe^x.

f(x)f(x)f′(x)f'(x)A check from the graph
sin⁡x\sin xcos⁡x\cos xslope 1 at 0, level at π2\frac{\pi}{2}
cos⁡x\cos x−sin⁡x-\sin xlevel at 0, slope −1-1 at π2\frac{\pi}{2}
exe^xexe^xslope 1 at 0, slope equals height
ln⁡x\ln x1x\frac{1}{x}, for x>0x > 0slope 1 at x=1x = 1, flattening out

Worked example 1. Differentiate f(x)f(x)=4ex−3cos⁡x+5ln⁡x= 4e^x - 3\cos x + 5\ln x for x>0x > 0, and find f′(π)f'(\pi).

Term by term, with the constant multiple and sum rules: f′(x)f'(x)=4ex−3(−sin⁡x)= 4e^x - 3(-\sin x)+5x+ \frac{5}{x}=4ex= 4e^x+3sin⁡x+ 3\sin x+5x+ \frac{5}{x}.

At x=πx = \pi: f′(π)f'(\pi)=4eπ= 4e^{\pi}+3(0)+ 3(0)+5π+ \frac{5}{\pi}=4eπ= 4e^{\pi}+5π+ \frac{5}{\pi}.

The step to watch is the double negative: −3cos⁡x-3\cos x becomes +3sin⁡x+3\sin x.

Worked example 2. Write the line tangent to y=ln⁡xy = \ln x at x=ex = e.

Point: ln⁡e=1\ln e = 1, so (e,1)(e, 1). Slope: 1e\frac{1}{e}.

Line: y=1+1e(x−e)y = 1 + \frac{1}{e}(x - e), which simplifies to y=xey = \frac{x}{e}. It passes through the origin.

Limits that are derivatives

Now that you know these derivatives, you can evaluate some limits instantly by reading them as derivatives at a point. This is the limit as a derivative idea, and it appears on the exam every year. The method:

  1. Match the shape limh→0f(a+h)−f(a)h\lim_{h \to 0} \frac{f(a + h) - f(a)}{h} or limx→af(x)−f(a)x−a\lim_{x \to a} \frac{f(x) - f(a)}{x - a}.
  2. Name ff and aa. Check that the subtracted number really is f(a)f(a).
  3. The limit is f′(a)f'(a). Evaluate it with a derivative rule.

Worked example 3. Evaluate limh→0sin⁡(π6+h)−12h\lim_{h \to 0} \frac{\sin\left( \frac{\pi}{6} + h \right) - \frac{1}{2}}{h}.

Shape: f(x)=sin⁡xf(x) = \sin x, a=π6a = \frac{\pi}{6}, and sin⁡π6=12\sin \frac{\pi}{6} = \frac{1}{2} is indeed f(a)f(a).

So the limit is f′(π6)f'\left( \frac{\pi}{6} \right)=cos⁡π6= \cos \frac{\pi}{6}=32= \frac{\sqrt{3}}{2}.

Worked example 4. Evaluate limh→0ln⁡(1+h)h\lim_{h \to 0} \frac{\ln(1 + h)}{h}.

The subtracted value is hidden: ln⁡1=0\ln 1 = 0, so the numerator is ln⁡(1+h)−ln⁡1\ln(1 + h) - \ln 1. That is the shape with f(x)=ln⁡xf(x) = \ln x and a=1a = 1.

The limit is f′(1)=11=1f'(1) = \frac{1}{1} = 1.

Substituting h=0h = 0 in these limits gives 00\frac{0}{0}, which never settles anything. Recognizing the derivative does.

Common mistakes

  • Sign on cosine: ddx(cos⁡x)=−sin⁡x\frac{d}{dx}(\cos x) = -\sin x, not sin⁡x\sin x.
  • Power rule on exe^x: the answer is exe^x.
  • Degrees: the trigonometric formulas need radians, on paper and on the calculator.
  • Answering f(a)f(a) instead of f′(a)f'(a) when a limit is a derivative.

Spot a mistake on this page?