AP · Calculus AB · Basic Differentiation Rules

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

16 min readUpdated November 30, 2026FreeAP Calculus AB, Derivatives: Definition and Basic Rules

The derivative of sin⁡x\sin x is cos⁡x\cos x, the derivative of cos⁡x\cos x is −sin⁡x-\sin x, the derivative of exe^x is exe^x, and the derivative of ln⁡x\ln x is 1x\dfrac{1}{x} for x>0x > 0. The trig results need xx in radians. On the AP® Calculus AB exam you combine these four with the power, sum and constant-multiple rules to find slopes, tangent lines and rates of change in context.

Quick check

  1. Differentiate 4x3−2x4x^3 - \dfrac{2}{x}.Show answerHide answer

    12x2+2x212x^2 + \dfrac{2}{x^2}. Rewrite −2x-\dfrac{2}{x} as −2x−1-2x^{-1}, whose derivative is 2x−22x^{-2}.

  2. What are sin⁡π2\sin \dfrac{\pi}{2}, cos⁡π\cos \pi, e0e^0 and ln⁡1\ln 1?Show answerHide answer

    11, −1-1, 11 and 00. You will need values like these to evaluate derivatives at a point.

  3. The graph of y=sin⁡xy = \sin x has a peak at x=π2x = \dfrac{\pi}{2}. What is its slope there, and what is cos⁡π2\cos \dfrac{\pi}{2}?Show answerHide answer

    Both are 00. The tangent at a peak is horizontal, which hints that the slope of sin⁡x\sin x is given by cos⁡x\cos x.

Know these already? Jump to the practice questions

What you'll be able to do

  • State the derivatives of sin⁡x\sin x, cos⁡x\cos x, exe^x and ln⁡x\ln x.
  • Explain where each derivative comes from, using a limit or the shape of the graph.
  • Calculate derivatives of sums and constant multiples of these functions and powers of xx.
  • Write tangent lines and interpret rates of change, with units, for functions built from them.

Key terms

The number ee

The base e≈2.718e \approx 2.718 is the number for which lim⁡h→0eh−1h=1\displaystyle\lim_{h \to 0} \frac{e^h - 1}{h} = 1, so the graph of y=exy = e^x crosses the yy-axis with slope exactly 11.

In plain English
The one exponential base whose growth rate equals its own height.
Don't write
ddx(ex)=xex−1\dfrac{d}{dx}\left(e^x\right) = xe^{x - 1}; the power rule is for a variable base with a constant exponent.

Natural logarithm

ln⁡x\ln x is the inverse of exe^x: y=ln⁡xy = \ln x means ey=xe^y = x, defined for x>0x > 0.

In plain English
The power you raise ee to in order to get xx.
Don't write
ln⁡(x+3)=ln⁡x+ln⁡3\ln(x + 3) = \ln x + \ln 3; the log laws split products, not sums.

Radian measure

The angle measure in which a full turn is 2π2\pi; the derivative results for sin⁡x\sin x and cos⁡x\cos x hold only in radians.

In plain English
In calculus, angles are in radians unless the question says otherwise.
Don't write
cos⁡60\cos 60 when you mean cos⁡π3\cos \dfrac{\pi}{3}.

What are the four derivatives?

Learn this:

ddx(sin⁡x)=cos⁡xddx(cos⁡x)=−sin⁡x\frac{d}{dx}(\sin x) = \cos x \qquad \frac{d}{dx}(\cos x) = -\sin x
ddx(ex)=exddx(ln⁡x)=1x,x>0\frac{d}{dx}\left(e^x\right) = e^x \qquad \frac{d}{dx}(\ln x) = \frac{1}{x}, \quad x > 0

Only cos⁡x\cos x picks up a minus sign. A quick way to remember it: just after x=0x = 0, cos⁡x\cos x starts to decrease from its peak, so its slope is negative, and −sin⁡x-\sin x is negative there.

These join the power rule and the sum and constant-multiple rules from the note on The Power Rule, Sums and Constant Multiples. The derivatives of tan⁡x\tan x, sec⁡x\sec x and the other trig functions come from the quotient rule, in the note on The Product Rule and the Quotient Rule.

Key idea

Sine goes to cosine, cosine goes to minus sine, exe^x stays exe^x, and ln⁡x\ln x goes to 1x\dfrac{1}{x}.

Check yourself

Find ddx(5cos⁡x)\dfrac{d}{dx}(5\cos x) and ddx(2ex)\dfrac{d}{dx}\left(2e^x\right).
Show answerHide answer

−5sin⁡x-5\sin x and 2ex2e^x. The constants carry through, and only the cosine brings a minus sign.

Where do the sine and cosine results come from?

Start from the definition and the sum formula sin⁡(x+h)=sin⁡xcos⁡h+cos⁡xsin⁡h\sin(x + h) = \sin x \cos h + \cos x \sin h:

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}

You met two special limits when studying limits: sin⁡hh→1\dfrac{\sin h}{h} \to 1 and cos⁡h−1h→0\dfrac{\cos h - 1}{h} \to 0 as h→0h \to 0, with hh in radians. So the quotient tends to sin⁡x⋅0+cos⁡x⋅1=cos⁡x\sin x \cdot 0 + \cos x \cdot 1 = \cos x. The same method with cos⁡(x+h)=cos⁡xcos⁡h−sin⁡xsin⁡h\cos(x + h) = \cos x \cos h - \sin x \sin h gives −sin⁡x-\sin x.

The graphs agree. The slope of y=sin⁡xy = \sin x is 11 at x=0x = 0, 00 at x=π2x = \frac{\pi}{2} and −1-1 at x=πx = \pi, which are exactly the values of cos⁡x\cos x at those inputs. In degrees, sin⁡hh\dfrac{\sin h}{h} does not tend to 11, which is why calculus uses radians.

Check yourself

What is the slope of y=cos⁡xy = \cos x at x=π2x = \dfrac{\pi}{2}?
Show answerHide answer

−1-1. The derivative is −sin⁡x-\sin x, and −sin⁡π2=−1-\sin \dfrac{\pi}{2} = -1.

Where do the exe^x and ln⁡x\ln x results come from?

For exe^x, factor the difference quotient:

ex+h−exh=ex⋅eh−1h→ex⋅1=ex\frac{e^{x + h} - e^x}{h} = e^x \cdot \frac{e^h - 1}{h} \to e^x \cdot 1 = e^x

The limit eh−1h→1\dfrac{e^h - 1}{h} \to 1 is what makes ee special; for any other base the limit is a different constant.

For ln⁡x\ln x, use the fact that its graph is the reflection of y=exy = e^x in the line y=xy = x. Reflecting swaps rise and run, so a slope of mm on one graph becomes 1m\frac{1}{m} on the other. At the point (a,ln⁡a)(a, \ln a) on y=ln⁡xy = \ln x, the matching point on y=exy = e^x is (ln⁡a,a)(\ln a, a), where the slope is eln⁡a=ae^{\ln a} = a. So the slope of ln⁡x\ln x at x=ax = a is 1a\frac{1}{a}.

Check yourself

What is the slope of y=ln⁡xy = \ln x at x=4x = 4?
Show answerHide answer

14\dfrac{1}{4}, since ddx(ln⁡x)=1x\dfrac{d}{dx}(\ln x) = \dfrac{1}{x}.

How do you combine them with the earlier rules?

Differentiate term by term, keeping coefficients:

ddx(3sin⁡x−2ex+5ln⁡x+x2)=3cos⁡x−2ex+5x+2x\frac{d}{dx}\left(3\sin x - 2e^x + 5\ln x + x^2\right) = 3\cos x - 2e^x + \frac{5}{x} + 2x

Log and exponent laws often turn an unfamiliar term into a familiar one before you differentiate:

  • ln⁡(5x)=ln⁡5+ln⁡x\ln(5x) = \ln 5 + \ln x, so its derivative is 0+1x=1x0 + \dfrac{1}{x} = \dfrac{1}{x}.
  • ln⁡(x3)=3ln⁡x\ln\left(x^3\right) = 3\ln x, so its derivative is 3x\dfrac{3}{x}.
  • ex+2=e2⋅exe^{x + 2} = e^2 \cdot e^x, and e2e^2 is a constant, so its derivative is ex+2e^{x + 2}.

Terms such as sin⁡(3x)\sin(3x) or ex2e^{x^2} cannot be rewritten this way. They need the chain rule, which is beyond this note.

Examiner's eye

Marks are lost when ln⁡5\ln 5 or e2e^2 is differentiated as if it were a variable. Numbers like these are constants, so their derivative is 00.

Check yourself

Differentiate y=ln⁡(x2)+π2y = \ln\left(x^2\right) + \pi^2.
Show answerHide answer

dydx=2x\dfrac{dy}{dx} = \dfrac{2}{x}. Write ln⁡(x2)=2ln⁡x\ln\left(x^2\right) = 2\ln x, and π2\pi^2 is a constant.

Which method fits the question?

What the term looks likeWhat to do
sin⁡x\sin x, cos⁡x\cos x, exe^x or ln⁡x\ln x times a constantUse the matching rule and keep the constant
ln⁡\ln of a product or a power, such as ln⁡(4x)\ln(4x) or ln⁡(x5)\ln\left(x^5\right)Split with log laws first
ex+ce^{x + c}Write it as ec⋅exe^c \cdot e^x
sin⁡(kx)\sin(kx), ekxe^{kx} or ln⁡(x2+1)\ln(x^2 + 1)Needs the chain rule, outside this note
A rate "at time tt" in contextDifferentiate, substitute, give units

Worked example 1: Term by term

Question: Let f(x)=4sin⁡x−3cos⁡x+2exf(x) = 4\sin x - 3\cos x + 2e^x. Find f′(x)f'(x) and f′(0)f'(0).

What tells you the method

Each term is a constant times one of the four basic functions, so differentiate term by term.

  1. Step 1: Differentiate each term.

    4cos⁡x−3(−sin⁡x)+2ex4\cos x - 3(-\sin x) + 2e^x.

    Why

    sin⁡x→cos⁡x\sin x \to \cos x, cos⁡x→−sin⁡x\cos x \to -\sin x, and ex→exe^x \to e^x.

  2. Step 2: Tidy the signs.

    f′(x)=4cos⁡x+3sin⁡x+2exf'(x) = 4\cos x + 3\sin x + 2e^x.

    Why

    −3-3 times −sin⁡x-\sin x is +3sin⁡x+3\sin x.

  3. Step 3: Evaluate at x=0x = 0.

    f′(0)=4(1)+3(0)+2(1)=6f'(0) = 4(1) + 3(0) + 2(1) = 6.

    Why

    cos⁡0=1\cos 0 = 1, sin⁡0=0\sin 0 = 0 and e0=1e^0 = 1.

Check it

Near x=0x = 0, 4sin⁡x4\sin x rises with slope 44, −3cos⁡x-3\cos x is flat at its lowest point, and 2ex2e^x rises with slope 22, giving 4+0+2=64 + 0 + 2 = 6.

Answer

f′(x)=4cos⁡x+3sin⁡x+2exf'(x) = 4\cos x + 3\sin x + 2e^x, and f′(0)=6f'(0) = 6.

Worked example 2: A tangent line with ln⁡x\ln x

Question: Write an equation for the line tangent to the graph of y=2ln⁡x+x2y = 2\ln x + x^2 at x=1x = 1.

What tells you the method

A tangent line needs the point and the slope at x=1x = 1.

  1. Step 1: Find the point.

    y(1)=2ln⁡1+1=0+1=1y(1) = 2\ln 1 + 1 = 0 + 1 = 1, so the point is (1,1)(1, 1).

    Why

    ln⁡1=0\ln 1 = 0.

  2. Step 2: Find the slope.

    dydx=2x+2x\dfrac{dy}{dx} = \dfrac{2}{x} + 2x, which is 2+2=42 + 2 = 4 at x=1x = 1.

    Why

    ln⁡x→1x\ln x \to \frac{1}{x}, and the power rule handles x2x^2.

  3. Step 3: Write the line.

    y−1=4(x−1)y - 1 = 4(x - 1), so y=4x−3y = 4x - 3.

    Why

    Point-slope form with the point (1,1)(1, 1) and slope 44.

Check it

At x=1.01x = 1.01 the curve gives y≈1.0400y \approx 1.0400 and the line gives 4(1.01)−3=1.044(1.01) - 3 = 1.04, so they agree closely.

Answer

y=4x−3y = 4x - 3.

Worked example 3: A rate in context

Question: The volume of water in a tank is W(t)=500+40sin⁡t−10tW(t) = 500 + 40\sin t - 10t liters, where tt is in hours and 0≤t≤60 \le t \le 6. (a) Find W′(1)W'(1) and W′(3)W'(3). (b) Is the volume increasing or decreasing at t=3t = 3? Indicate units of measure. You may use a graphing calculator.

What tells you the method

"find W′(1)W'(1)" asks for the instantaneous rate; units of W′W' are liters per hour.

  1. Step 1: Differentiate.

    W′(t)=40cos⁡t−10W'(t) = 40\cos t - 10.

    Why

    The constant 500500 gives 00, 40sin⁡t40\sin t gives 40cos⁡t40\cos t, and −10t-10t gives −10-10.

  2. Step 2: Evaluate, in radians.

    W′(1)=40cos⁡1−10≈11.612W'(1) = 40\cos 1 - 10 \approx 11.612 and W′(3)=40cos⁡3−10≈−49.600W'(3) = 40\cos 3 - 10 \approx -49.600.

    Why

    tt is a number of hours, so cos⁡1\cos 1 and cos⁡3\cos 3 are taken in radian mode.

  3. Step 3: Interpret the sign.

    W′(3)<0W'(3) < 0, so at t=3t = 3 hours the volume is decreasing at about 49.60049.600 liters per hour.

    Why

    A negative rate of change means the quantity is going down.

Check it

cos⁡3≈−0.990\cos 3 \approx -0.990, close to −1-1, so W′(3)W'(3) should be close to −40−10=−50-40 - 10 = -50, which it is.

Answer

(a) W′(1)≈11.612W'(1) \approx 11.612 liters per hour and W′(3)≈−49.600W'(3) \approx -49.600 liters per hour. (b) Decreasing, at about 49.60049.600 liters per hour, because W′(3)<0W'(3) < 0.

Your turn

Question: Let g(x)=6ln⁡x−x3g(x) = 6\ln x - x^3. Find g′(x)g'(x) and g′(2)g'(2).

  1. Step 1:

    The first term gives 6⋅1x=6x6 \cdot \dfrac{1}{x} = \dfrac{6}{x}.

  2. Step 2: Your go: finish it.

    Differentiate −x3-x^3, write g′(x)g'(x), then substitute x=2x = 2 before you open the solution.

Show the full solutionHide the solution

g′(x)=6x−3x2g'(x) = \dfrac{6}{x} - 3x^2, so g′(2)=3−12=−9g'(2) = 3 - 12 = -9.

Answer: g′(x)=6x−3x2g'(x) = \dfrac{6}{x} - 3x^2, and g′(2)=−9g'(2) = -9.

Traps

Trap

Writing the derivative of cos⁡x\cos x as sin⁡x\sin x.

It seems right because sine and cosine swap when you differentiate. But the cosine graph falls just after x=0x = 0, so its slope there is negative: the derivative is −sin⁡x-\sin x.

Check yourself

Is ddx(cos⁡x)\dfrac{d}{dx}(\cos x) at x=π6x = \dfrac{\pi}{6} equal to 12\dfrac{1}{2} or −12-\dfrac{1}{2}?
Show answerHide answer

−12-\dfrac{1}{2}. The derivative is −sin⁡x-\sin x, and sin⁡π6=12\sin \dfrac{\pi}{6} = \dfrac{1}{2}.

Trap

Using the power rule on exe^x to get xex−1xe^{x - 1}.

It seems right because exe^x looks like a power. But the power rule needs a variable base and a constant exponent; in exe^x the base is constant and the exponent varies. The derivative of exe^x is exe^x.

Check yourself

Which is the derivative of xex^e, and which is the derivative of exe^x: exe−1ex^{e - 1} or exe^x?
Show answerHide answer

xex^e has derivative exe−1ex^{e - 1} by the power rule, since ee is a constant exponent. exe^x has derivative exe^x.

Trap

Differentiating ln⁡(3x)\ln(3x) as 3x\dfrac{3}{x} or 13x\dfrac{1}{3x}.

It seems right because the 33 looks as if it must go somewhere. But ln⁡(3x)=ln⁡3+ln⁡x\ln(3x) = \ln 3 + \ln x, and ln⁡3\ln 3 is a constant, so the derivative is just 1x\dfrac{1}{x}.

Check yourself

What is ddx(ln⁡(7x))\dfrac{d}{dx}\left(\ln(7x)\right)?
Show answerHide answer

1x\dfrac{1}{x}, because ln⁡(7x)=ln⁡7+ln⁡x\ln(7x) = \ln 7 + \ln x.

What's examined

These derivatives belong to Unit 2 (Derivatives: Definition and Basic Rules) of the AP® Calculus AB exam, and they reappear throughout the rest of the course. Expect them in both sections: multiple-choice items that ask for a derivative or a slope, and free-response parts that ask you to find a rate, interpret it with units, or write a tangent line. When a question needs a value such as cos⁡3\cos 3, a graphing calculator is the expected tool: work in radians and give answers correct to three decimal places.

Practice questions

  1. Recall What is ddx(cos⁡x)\dfrac{d}{dx}(\cos x)?
    • A) sin⁡x\sin x
    • B) −sin⁡x-\sin x
    • C) −cos⁡x-\cos x
    • D) 1cos⁡x\dfrac{1}{\cos x}
Show answer

Answer: B) −sin⁡x-\sin x.

Marking points:

  • Cosine differentiates to minus sine.
  • A drops the minus sign.
  • C confuses the derivative with the second derivative of cos⁡x\cos x.
  • D confuses the derivative with the reciprocal.
  1. Recall Let f(x)=3ex−ln⁡xf(x) = 3e^x - \ln x. What is f′(x)f'(x)?
    • A) 3xex−1−1x3xe^{x - 1} - \dfrac{1}{x}
    • B) 3ex−ex3e^x - e^x
    • C) 3ex+1x3e^x + \dfrac{1}{x}
    • D) 3ex−1x3e^x - \dfrac{1}{x}
Show answer

Answer: D) 3ex−1x3e^x - \dfrac{1}{x}.

Marking points:

  • 3ex→3ex3e^x \to 3e^x and −ln⁡x→−1x-\ln x \to -\dfrac{1}{x}.
  • A uses the power rule on exe^x.
  • B confuses ln⁡x\ln x with exe^x, its inverse.
  • C loses the minus sign in front of ln⁡x\ln x.
  1. Apply What is the slope of the graph of y=2sin⁡x+cos⁡xy = 2\sin x + \cos x at x=π2x = \dfrac{\pi}{2}?
    • A) −1-1
    • B) 00
    • C) 11
    • D) 22
Show answer

Answer: A) −1-1.

Marking points:

  • dydx=2cos⁡x−sin⁡x\dfrac{dy}{dx} = 2\cos x - \sin x, which is 0−1=−10 - 1 = -1 at x=π2x = \dfrac{\pi}{2}.
  • B evaluates 2cos⁡x2\cos x and drops the −sin⁡x-\sin x term.
  • C uses +sin⁡x+\sin x as the derivative of cos⁡x\cos x.
  • D gives the yy-value 2(1)+0=22(1) + 0 = 2 instead of the slope.
  1. Apply Which is an equation of the line tangent to y=exy = e^x at x=0x = 0?
    • A) y=xy = x
    • B) y=exy = ex
    • C) y=x+1y = x + 1
    • D) y=ex+1y = ex + 1
Show answer

Answer: C) y=x+1y = x + 1.

Marking points:

  • The point is (0,e0)=(0,1)(0, e^0) = (0, 1), and the slope is e0=1e^0 = 1, so y−1=1(x−0)y - 1 = 1(x - 0).
  • A uses the slope 11 but passes through the origin instead of (0,1)(0, 1).
  • B uses slope ee, which is e1e^1, and the wrong point.
  • D uses the slope ee instead of e0=1e^0 = 1.
  1. Apply Let h(x)=ln⁡(x5)+ex+3h(x) = \ln\left(x^5\right) + e^{x + 3} for x>0x > 0. Find h′(x)h'(x).
Show answer

Answer: h′(x)=5x+ex+3h'(x) = \dfrac{5}{x} + e^{x + 3}.

Marking points:

  • ln⁡(x5)=5ln⁡x\ln\left(x^5\right) = 5\ln x, whose derivative is 5x\dfrac{5}{x}.
  • ex+3=e3⋅exe^{x + 3} = e^3 \cdot e^x, whose derivative is e3⋅ex=ex+3e^3 \cdot e^x = e^{x + 3}.
  • Add the two derivatives.
  1. Exam-style Let f(x)=x2−4sin⁡xf(x) = x^2 - 4\sin x. (a) Write an equation for the line tangent to the graph of ff at x=0x = 0. (b) Use a graphing calculator to find the value of xx in (0,π)(0, \pi) at which the graph of ff has a horizontal tangent line. Give your answer correct to three decimal places.
Show answer

Answer: (a) y=−4xy = -4x. (b) x≈1.030x \approx 1.030.

Marking points:

  • f′(x)=2x−4cos⁡xf'(x) = 2x - 4\cos x.
  • f(0)=0f(0) = 0 and f′(0)=0−4=−4f'(0) = 0 - 4 = -4, so the tangent line is y=−4xy = -4x.
  • A horizontal tangent needs f′(x)=0f'(x) = 0: solving 2x−4cos⁡x=02x - 4\cos x = 0 on (0,π)(0, \pi) with a graphing calculator gives x≈1.030x \approx 1.030.
  1. Exam-style The height of a plant is H(t)=12+5ln⁡tH(t) = 12 + 5\ln t centimeters, where tt is the time in weeks and t≥1t \ge 1. Find H′(4)H'(4) and, using correct units, explain its meaning.
Show answer

Answer: H′(4)=1.25H'(4) = 1.25 centimeters per week: at t=4t = 4 weeks, the plant's height is increasing at 1.251.25 centimeters per week.

Marking points:

  • H′(t)=5tH'(t) = \dfrac{5}{t}.
  • H′(4)=54=1.25H'(4) = \dfrac{5}{4} = 1.25.
  • The interpretation names the time, the rate and the units, centimeters per week.

Key points

Recall, then reveal

Say the main points from memory first, then check them.

Show key pointsHide key points
  • sin⁡x→cos⁡x\sin x \to \cos x and cos⁡x→−sin⁡x\cos x \to -\sin x, with xx in radians; only cosine brings a minus sign.
  • exe^x is its own derivative because eh−1h→1\frac{e^h - 1}{h} \to 1; ln⁡x→1x\ln x \to \frac{1}{x} for x>0x > 0.
  • Combine them with the power, sum and constant-multiple rules term by term.
  • Use log and exponent laws to rewrite ln⁡(kx)\ln(kx), ln⁡(xn)\ln\left(x^n\right) and ex+ce^{x + c} first; constants such as ln⁡5\ln 5 differentiate to 00.
  • In context, a derivative is a rate: give its units and say whether the quantity is increasing or decreasing.

Keep learning

Explore AP Calculus AB tutoring →

View the full Calculus AB syllabus →

More in this unit

Derivatives: Definition and Basic Rules

All Basic Differentiation Rules notes

Part of Novark's AP Calculus AB notes