Skip to content

Unit 2: Differentiation: Definition and Fundamental Properties

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

Know and use the derivatives of sin x, cos x, eˣ and ln x, see where each comes from, and spot a limit that is secretly one of these derivatives.

Topic 2.7 · 9 min read

The power rule handles xnx^n, where the base varies and the exponent is fixed. It says nothing about sin⁡x\sin x, about exe^x (where the exponent varies), or about ln⁡x\ln x. Each of these four functions gets its derivative from the limit definition and one special limit, and the results are short: the derivative of sin⁡x\sin x is cos⁡x\cos x, of cos⁡x\cos x is −sin⁡x-\sin x, of exe^x is exe^x itself, and of ln⁡x\ln x is 1x\frac{1}{x}.

Sine and cosine

Start with the picture. The graph of y=sin⁡xy = \sin x below has slope 1 as it crosses the origin, slope 0 at its peak at x=π2x = \frac{\pi}{2}, slope −1-1 crossing x=πx = \pi, and slope 0 again at its low point at x=3π2x = \frac{3\pi}{2}. Those slopes, 1,0,−1,0,11, 0, -1, 0, 1, are exactly the values of cos⁡x\cos x at the same points.

The graph of y equals sine x from 0 to 2 pi, with short tangent segments at x = 0, pi/2, pi, 3pi/2 and 2pi whose slopes are 1, 0, negative 1, 0 and 1. The dashed graph of y equals cosine x passes through those same values at those x: 1 at 0, 0 at pi/2, negative 1 at pi, 0 at 3pi/2, 1 at 2pi.

To prove it, use the angle-sum identity sin⁡(x+h)=sin⁡xcos⁡h+cos⁡xsin⁡h\sin(x+h) = \sin x\cos h + \cos x\sin h in the difference quotient and group the terms by what multiplies them:

sin⁡(x+h)−sin⁡xh=sin⁡x⋅cos⁡h−1h+cos⁡x⋅sin⁡hh.\frac{\sin(x+h) - \sin x}{h} = \sin x\cdot\frac{\cos h - 1}{h} + \cos x\cdot\frac{\sin h}{h}.

As h→0h \to 0, sin⁡x\sin x and cos⁡x\cos x don't change, because they don't involve hh. Two limits remain. The first, lim⁡h→0sin⁡hh=1\lim\limits_{h\to 0}\frac{\sin h}{h} = 1, comes from the squeeze theorem (topic 1.8). The second follows from it: multiplying top and bottom by cos⁡h+1\cos h + 1 and using cos⁡2h−1=−sin⁡2h\cos^2 h - 1 = -\sin^2 h,

cos⁡h−1h=−sin⁡hh⋅sin⁡hcos⁡h+1  ⟶  −1⋅02=0.\frac{\cos h - 1}{h} = -\frac{\sin h}{h}\cdot\frac{\sin h}{\cos h + 1} \;\longrightarrow\; -1\cdot\frac{0}{2} = 0.

So the difference quotient approaches sin⁡x⋅0+cos⁡x⋅1=cos⁡x\sin x\cdot 0 + \cos x\cdot 1 = \cos x. The same steps with cos⁡(x+h)=cos⁡xcos⁡h−sin⁡xsin⁡h\cos(x+h) = \cos x\cos h - \sin x\sin h give cos⁡x⋅0−sin⁡x⋅1=−sin⁡x\cos x\cdot 0 - \sin x\cdot 1 = -\sin x.

The minus sign on the cosine derivative matches the graph: on (0,π)(0, \pi), where sin⁡x>0\sin x > 0, the cosine curve is falling, so its slope −sin⁡x-\sin x is negative there.

These formulas need xx in radians. The limit sin⁡hh→1\frac{\sin h}{h} \to 1 is true only when hh is measured in radians; with degrees the limit is π180\frac{\pi}{180}, and every derivative would carry that factor. Calculus assumes radians throughout, so a calculator used for calculus must be in radian mode.

The exponential function exe^x

For any base b>0b > 0, the law of exponents bx+h=bxbhb^{x+h} = b^x b^h lets bxb^x factor out of the difference quotient:

bx+h−bxh=bx⋅bh−1h.\frac{b^{x+h} - b^x}{h} = b^x\cdot\frac{b^h - 1}{h}.

The remaining fraction doesn't involve xx, so its limit is a single number for each base; call it L(b)L(b). Then ddxbx=L(b) bx\frac{d}{dx}b^x = L(b)\,b^x: every exponential function grows at a rate proportional to its own height. Small values of hh estimate L(b)L(b). For b=2b = 2 the fraction is about 0.6930.693, and for b=3b = 3 it is about 1.0991.099. One base between 2 and 3 makes the constant exactly 1, and that base is e≈2.71828e \approx 2.71828. So

lim⁡h→0eh−1h=1,ddxex=ex.\lim_{h \to 0}\frac{e^h - 1}{h} = 1, \qquad \frac{d}{dx}e^x = e^x.

The graph of y=exy = e^x therefore has slope equal to its height at every point: slope 1 at (0,1)(0, 1), slope e2≈7.389e^2 \approx 7.389 at (2,e2)(2, e^2). Since ex>0e^x > 0 everywhere, the slope is always positive and the function is always increasing. (Other bases have L(b)=ln⁡bL(b) = \ln b, so ddxbx=bxln⁡b\frac{d}{dx}b^x = b^x\ln b; topic 3.1 shows why.)

Compare exe^x with xex^e. In xex^e the exponent is the constant ee, so the power rule applies and the derivative is e xe−1e\,x^{e-1}. In exe^x the variable is in the exponent, and the power rule doesn't apply at all.

The natural logarithm ln⁡x\ln x

The natural logarithm ln⁡x\ln x is the logarithm with base ee: ln⁡x=y\ln x = y means ey=xe^y = x. It is defined only for x>0x > 0, and its graph is the graph of y=exy = e^x reflected across the line y=xy = x.

That reflection gives the derivative. Take any point (a,ea)(a, e^a) on the graph of exe^x; its tangent line has slope eae^a, meaning a rise of eae^a for every run of 1. Reflecting across y=xy = x swaps every horizontal distance with a vertical one, so the reflected tangent line, which touches the graph of ln⁡x\ln x at (ea,a)(e^a, a), has a rise of 1 for every run of eae^a, a slope of 1ea\frac{1}{e^a}. At that point the xx-coordinate is eae^a, so the slope there is 1x\frac{1}{x}. Topic 3.3 turns this picture into the general rule for derivatives of inverse functions.

The derivative 1x\frac{1}{x} is positive for every x>0x > 0, so ln⁡x\ln x is always increasing, and it shrinks toward 0 as xx grows, so the graph keeps rising but flattens out. Near x=0x = 0 the slope is huge, matching the graph's steep drop toward its vertical asymptote.

Logarithm properties combine with these rules to handle more forms before you learn the chain rule. Because ln⁡(5x)=ln⁡5+ln⁡x\ln(5x) = \ln 5 + \ln x, its derivative is 0+1x=1x0 + \frac{1}{x} = \frac{1}{x}: scaling the input of ln⁡\ln by 5 shifts its graph up by ln⁡5\ln 5 and changes no slope. Because ln⁡(x3)=3ln⁡x\ln\left(x^3\right) = 3\ln x for x>0x > 0, its derivative is 3x\frac{3}{x}.

Limits that are derivatives in disguise

The definition of the derivative at x=ax = a comes in two forms:

f′(a)=lim⁡h→0f(a+h)−f(a)h=lim⁡x→af(x)−f(a)x−a.f'(a) = \lim_{h\to 0}\frac{f(a+h) - f(a)}{h} = \lim_{x\to a}\frac{f(x) - f(a)}{x - a}.

Read backward, this means some limits are derivatives you already know. Every such limit has the indeterminate form 00\frac{0}{0}, so plugging in fails, but if you recognize the shape you can evaluate it with a derivative rule. To match a limit to the definition:

  1. Find the function ff and the point aa: the expression being evaluated at a+ha + h (or at xx) tells you ff, and the point it approaches tells you aa.
  2. Check that the term being subtracted really is f(a)f(a).
  3. The limit equals f′(a)f'(a). Differentiate ff and evaluate at aa.

For example, lim⁡h→0e2+h−e2h\lim\limits_{h\to 0}\frac{e^{2+h} - e^2}{h} has f(x)=exf(x) = e^x and a=2a = 2, and the subtracted term e2e^2 is f(2)f(2), so the limit is f′(2)=e2f'(2) = e^2. And the limit lim⁡x→0sin⁡xx=1\lim\limits_{x \to 0}\frac{\sin x}{x} = 1 from topic 1.8 is itself one of these: since sin⁡0=0\sin 0 = 0, it is the derivative of sin⁡x\sin x at 0, which is cos⁡0=1\cos 0 = 1.

Worked examples

Worked exampleExample 1: using the rules with rewriting

Find dydx\dfrac{dy}{dx} for each function.

(a) y=4cos⁡x−3ex+6ln⁡xy = 4\cos x - 3e^x + 6\ln x

(b) y=ex+2y = e^{x+2}

(c) y=ln⁡(x3)y = \ln\left(\dfrac{\sqrt{x}}{3}\right)

Show solution

(a) Apply the constant multiple and sum rules (topic 2.6) with the four new derivatives, minding the sign on cosine:

dydx=4(−sin⁡x)−3ex+6x=−4sin⁡x−3ex+6x.\frac{dy}{dx} = 4(-\sin x) - 3e^x + \frac{6}{x} = -4\sin x - 3e^x + \frac{6}{x}.

(b) This is not exe^x, but the law of exponents makes it a constant multiple of exe^x: ex+2=e2⋅exe^{x+2} = e^2\cdot e^x. The factor e2e^2 is a constant, so

dydx=e2⋅ex=ex+2.\frac{dy}{dx} = e^2\cdot e^x = e^{x+2}.

(c) Use logarithm properties to turn the quotient and root into a sum: ln⁡(x3)=12ln⁡x−ln⁡3\ln\left(\frac{\sqrt{x}}{3}\right) = \frac{1}{2}\ln x - \ln 3. The term ln⁡3\ln 3 is a constant, so

dydx=12⋅1x=12x,x>0.\frac{dy}{dx} = \frac{1}{2}\cdot\frac{1}{x} = \frac{1}{2x}, \quad x > 0.

In (b) and (c), rewriting with exponent or logarithm laws reduces each function to the basic forms; topic 3.1's chain rule gives the same answers.

Worked exampleExample 2: horizontal tangents and a tangent line

Let f(x)=3 x+2cos⁡xf(x) = \sqrt{3}\,x + 2\cos x for 0≤x≤2π0 \le x \le 2\pi.

(a) Find the values of xx at which the graph of ff has a horizontal tangent line.

(b) Write an equation for the line tangent to the graph of ff at x=0x = 0.

Show solution

(a) f′(x)=3−2sin⁡xf'(x) = \sqrt{3} - 2\sin x. A horizontal tangent needs f′(x)=0f'(x) = 0, so sin⁡x=32\sin x = \frac{\sqrt{3}}{2}. On [0,2π][0, 2\pi] the sine is 32\frac{\sqrt{3}}{2} at x=π3x = \frac{\pi}{3} and x=2π3x = \frac{2\pi}{3}, the two angles in the first and second quadrants with reference angle π3\frac{\pi}{3}.

(b) The point: f(0)=0+2cos⁡0=2f(0) = 0 + 2\cos 0 = 2. The slope: f′(0)=3−2sin⁡0=3f'(0) = \sqrt{3} - 2\sin 0 = \sqrt{3}. The tangent line is

y=2+3 x.y = 2 + \sqrt{3}\,x.
Worked exampleExample 3: limits as derivatives

Evaluate each limit.

(a) lim⁡h→0sin⁡(π6+h)−12h\lim\limits_{h\to 0}\dfrac{\sin\left(\frac{\pi}{6} + h\right) - \frac{1}{2}}{h}

(b) lim⁡x→eln⁡x−1x−e\lim\limits_{x\to e}\dfrac{\ln x - 1}{x - e}

(c) lim⁡h→0cos⁡(π+h)+1h\lim\limits_{h\to 0}\dfrac{\cos(\pi + h) + 1}{h}

Show solution

Each limit is 00\frac{0}{0} if you plug in, so look for the definition of a derivative.

(a) The function evaluated at π6+h\frac{\pi}{6} + h is sin⁡\sin, so f(x)=sin⁡xf(x) = \sin x and a=π6a = \frac{\pi}{6}. The subtracted term is sin⁡π6=12=f(a)\sin\frac{\pi}{6} = \frac{1}{2} = f(a). The limit is f′(π6)=cos⁡π6=32f'\left(\frac{\pi}{6}\right) = \cos\frac{\pi}{6} = \dfrac{\sqrt{3}}{2}.

(b) This is the x→ax \to a form with f(x)=ln⁡xf(x) = \ln x and a=ea = e, and the subtracted 1 is ln⁡e=f(e)\ln e = f(e). The limit is f′(e)=1ef'(e) = \dfrac{1}{e}.

(c) Here f(x)=cos⁡xf(x) = \cos x and a=πa = \pi. Adding 1 is subtracting cos⁡π=−1\cos \pi = -1, so the numerator is f(π+h)−f(π)f(\pi + h) - f(\pi). The limit is f′(π)=−sin⁡π=0f'(\pi) = -\sin\pi = 0.

Step 2 matters in (c): the "+1+1" looks wrong until you see that it is −f(π)-f(\pi).

Worked exampleExample 4: an exam-style free-response question

Let f(x)=ln⁡xf(x) = \ln x and g(x)=exg(x) = e^x.

(a) The line tangent to the graph of ff at x=ax = a passes through the origin. Find aa and write an equation for this tangent line.

(b) (Calculator) Find the value of xx at which the lines tangent to the graphs of ff and gg are parallel.

Show solution

(a) Write the tangent line at a general point first, then impose the condition. At x=ax = a the point is (a,ln⁡a)(a, \ln a) and the slope is f′(a)=1af'(a) = \frac{1}{a}, so the tangent line is

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

It passes through (0,0)(0, 0) exactly when 0=ln⁡a+1a(0−a)=ln⁡a−10 = \ln a + \frac{1}{a}(0 - a) = \ln a - 1, so ln⁡a=1\ln a = 1 and a=ea = e. The line is y=1+1e(x−e)y = 1 + \frac{1}{e}(x - e), which simplifies to y=xey = \dfrac{x}{e}.

(b) Parallel tangent lines have equal slopes, so solve f′(x)=g′(x)f'(x) = g'(x), that is, 1x=ex\frac{1}{x} = e^x with x>0x > 0. This equation has no algebraic solution, so solve it on a calculator (for example, find where ex−1xe^x - \frac{1}{x} crosses zero): x=0.567x = 0.567.

Part (b) is calculator-active because the equation mixes xx with exe^x. On the exam, set up the equation in writing and then report the calculator's solution to three decimal places.

Where students lose points

On the exam

These four derivatives are expected from memory on both sections; no formula sheet gives them. A limit written as a difference quotient asks for f′(a)f'(a); recognizing the function and the point is the whole task, and no work beyond the derivative rule is needed. On calculator-active questions, the calculator can evaluate a derivative at a point, but any equation like 1x=ex\frac{1}{x} = e^x should be written down before you solve it.

Check yourself

  1. Question 1

    If f(x)=sin⁡x+cos⁡xf(x) = \sin x + \cos x, what is f′(3π4)f'\left(\dfrac{3\pi}{4}\right)?

    1. A

      00

    2. B

      −2-\sqrt{2}

    3. C

      2\sqrt{2}

    4. D

      11

    Show answer

    B

    f′(x)=cos⁡x−sin⁡xf'(x) = \cos x - \sin x, and at 3π4\frac{3\pi}{4} that is −22−22=−2-\frac{\sqrt{2}}{2} - \frac{\sqrt{2}}{2} = -\sqrt{2}. Choice A comes from writing the derivative of cos⁡x\cos x as +sin⁡x+\sin x (it is also the value of ff itself there).

  2. Question 2

    Evaluate lim⁡h→0e3+h−e3h\lim\limits_{h\to 0}\dfrac{e^{3+h} - e^3}{h}.

    Show answer

    e3e^3

    This is the definition of the derivative of f(x)=exf(x) = e^x at a=3a = 3, since e3=f(3)e^3 = f(3). The derivative of exe^x is exe^x, so the limit is f′(3)=e3f'(3) = e^3.

  3. Question 3

    What is lim⁡h→0ln⁡(1+h)h\lim\limits_{h\to 0}\dfrac{\ln(1+h)}{h}?

    1. A

      00

    2. B

      ee

    3. C

      11

    4. D

      The limit does not exist.

    Show answer

    C

    Since ln⁡1=0\ln 1 = 0, the numerator is ln⁡(1+h)−ln⁡1\ln(1+h) - \ln 1, so the limit is the derivative of ln⁡x\ln x at x=1x = 1, which is 11=1\frac{1}{1} = 1. Choice A treats the 00\frac{0}{0} form as if the numerator's 0 settled it.

  4. Question 4

    At what point on the graph of y=ln⁡xy = \ln x is the tangent line's slope equal to 2?

    Show answer

    (12, −ln⁡2)\left(\dfrac{1}{2},\ -\ln 2\right)

    The slope is 1x\frac{1}{x}, and 1x=2\frac{1}{x} = 2 at x=12x = \frac{1}{2}. The yy-coordinate is ln⁡12=−ln⁡2\ln\frac{1}{2} = -\ln 2.

Go deeper