Skip to content
Family Table Math
Auto

Derivatives of Sine, Cosine, eˣ, and ln x

The power rule handles powers of xx, but calculus also needs trig, exponential, and logarithmic functions. Their derivatives turn out to be surprisingly neat: the slope of sin⁡x\sin x is cos⁡x\cos x, the slope of exe^x is exe^x itself, and the slope of ln⁡x\ln x is 1x\dfrac{1}{x}. All trig in calculus is in radians.

In Grade 11 you probably measured angles in degrees. Calculus uses radians, where π\pi radians =180∘= 180^\circ, so π2=90∘\dfrac{\pi}{2} = 90^\circ, π3=60∘\dfrac{\pi}{3} = 60^\circ, and π6=30∘\dfrac{\pi}{6} = 30^\circ. The derivative rules below are only true in radians. If you use a calculator on a test, make sure it is in radian mode.

FunctionDerivative
sin⁡x\sin xcos⁡x\cos x
cos⁡x\cos x−sin⁡x-\sin x
exe^xexe^x
ln⁡x\ln x1x\dfrac{1}{x} (for x>0x \gt 0)

They work with the constant multiple, sum, and difference rules from the power rule page, so, for example, ddx[3sin⁡x−x2]=3cos⁡x−2x\dfrac{d}{dx}\big[3\sin x - x^2\big] = 3\cos x - 2x.

Look at the slopes of y=sin⁡xy = \sin x. At x=0x = 0 the graph climbs with slope 11; at x=π2x = \tfrac{\pi}{2} it’s flat (slope 00); at x=πx = \pi it falls with slope −1-1. Plot those slopes and you get the graph of cos⁡x\cos x.

Top: y = sin x from -π/4 to 9π/4 with short tangent lines at x = 0, π/2, π, 3π/2 and 2π, whose slopes are 1, 0, -1, 0 and 1. Bottom: y = cos x, which passes through the values 1, 0, -1, 0, 1 at those same x-values, so cos x gives the slope of sin x. y = sin x (slopes shown in orange) y = cos x (the slopes of sin x) −1 1 −1 1 π/2 π 3π/2 2π π/2 π 3π/2 2π
The slopes of y=sin⁡xy = \sin x (top) are the values of y=cos⁡xy = \cos x (bottom). The xx-axis is in radians.

The algebra behind this uses the limit lim⁡h→0sin⁡hh=1\displaystyle\lim_{h \to 0} \frac{\sin h}{h} = 1, which is only true when hh is in radians. That’s why radians matter.

The derivative of cos⁡x\cos x works the same way. Its graph falls just after x=0x = 0, which is why its derivative, −sin⁡x-\sin x, has a minus sign.

Every exponential graph y=bxy = b^x has a slope at x=0x = 0. The number e≈2.718e \approx 2.718 is the base where that slope is exactly 11. With that choice, the slope of exe^x at every point equals its height, so ddx[ex]=ex\dfrac{d}{dx}\big[e^x\big] = e^x.

The natural logarithm ln⁡x\ln x is the inverse of exe^x. Its slope is 1x\dfrac{1}{x}: steep near x=0x = 0 and flattening out as xx grows.

The derivatives of tan⁡x\tan x, cot⁡x\cot x, sec⁡x\sec x, and csc⁡x\csc x come from writing them as quotients of sine and cosine. See the quotient rule. Functions like sin⁡(2x)\sin(2x) or e3xe^{3x} need the chain rule, in the next unit.

Differentiate y=3sin⁡x−4cos⁡xy = 3\sin x - 4\cos x.

Solution. Use the constant multiple rule on each term. Careful with the sign on the cosine term:

dydx=3cos⁡x−4(−sin⁡x)=3cos⁡x+4sin⁡x\frac{dy}{dx} = 3\cos x - 4(-\sin x) = 3\cos x + 4\sin x

Find f′(x)f'(x) for f(x)=2ex−5ln⁡x+x2f(x) = 2e^x - 5\ln x + x^2.

Solution.

f′(x)=2ex−5x+2xf'(x) = 2e^x - \frac{5}{x} + 2x

Find the equation of the tangent line to y=sin⁡xy = \sin x at x=π3x = \dfrac{\pi}{3}.

Solution. Point: sin⁡π3=32\sin \dfrac{\pi}{3} = \dfrac{\sqrt{3}}{2}. Slope: y′=cos⁡xy' = \cos x, and cos⁡π3=12\cos \dfrac{\pi}{3} = \dfrac{1}{2}.

y−32=12(x−π3)y - \frac{\sqrt{3}}{2} = \frac{1}{2}\left(x - \frac{\pi}{3}\right)

Point-slope form is the cleanest way to leave this answer.

Example 4: Horizontal tangents on an interval

Section titled “Example 4: Horizontal tangents on an interval”

Find the xx-values in [0,2π][0, 2\pi] where f(x)=x+2cos⁡xf(x) = x + 2\cos x has a horizontal tangent.

Solution. f′(x)=1−2sin⁡xf'(x) = 1 - 2\sin x. Set it equal to 00:

1−2sin⁡x=0⇒sin⁡x=121 - 2\sin x = 0 \quad\Rightarrow\quad \sin x = \frac{1}{2}

In [0,2π][0, 2\pi], sin⁡x=12\sin x = \tfrac{1}{2} at x=π6x = \dfrac{\pi}{6} and x=5π6x = \dfrac{5\pi}{6} (the special angles 30∘30^\circ and 150∘150^\circ, in radians).

Getting the sign of the cosine derivative wrong. ddx[cos⁡x]=−sin⁡x\dfrac{d}{dx}[\cos x] = -\sin x, but ddx[sin⁡x]=+cos⁡x\dfrac{d}{dx}[\sin x] = +\cos x. A quick check: cos⁡x\cos x is decreasing just after x=0x = 0, so its derivative must be negative there.

Working in degrees. ddx[sin⁡x]=cos⁡x\dfrac{d}{dx}[\sin x] = \cos x is only true in radians. Answers like x=30x = 30 instead of x=π6x = \dfrac{\pi}{6} lose marks, and a calculator in degree mode gives wrong slopes.

Using the power rule on exe^x. ddx[ex]\dfrac{d}{dx}\big[e^x\big] is exe^x, not xex−1xe^{x - 1}. The power rule only applies when the exponent is a constant.

Treating constants like functions. e2e^2, ln⁡5\ln 5, and sin⁡π4\sin \tfrac{\pi}{4} are numbers, so their derivatives are 00. Only expressions containing xx change.

Thinking ddx[sin⁡2x]=cos⁡2x\dfrac{d}{dx}[\sin 2x] = \cos 2x. When the inside is more than just xx, you need the chain rule (next unit). For now, stick to sin⁡x\sin x, cos⁡x\cos x, exe^x, and ln⁡x\ln x exactly.

1. (Warm-up) Differentiate each.

  • (a) 5cos⁡x5\cos x
  • (b) ex+4e^x + 4
  • (c) ln⁡x−x\ln x - x
Solution

(a) −5sin⁡x-5\sin x

(b) exe^x

(c) 1x−1\dfrac{1}{x} - 1

2. (Warm-up) Let f(x)=sin⁡x+cos⁡xf(x) = \sin x + \cos x. Find f′(π4)f'\left(\dfrac{\pi}{4}\right).

Solution

f′(x)=cos⁡x−sin⁡xf'(x) = \cos x - \sin x, so

f′(π4)=22−22=0f'\left(\frac{\pi}{4}\right) = \frac{\sqrt{2}}{2} - \frac{\sqrt{2}}{2} = 0

The graph has a horizontal tangent at x=π4x = \dfrac{\pi}{4}.

3. (Warm-up) Find the slope of y=4ln⁡xy = 4\ln x at x=2x = 2.

Solution

y′=4xy' = \dfrac{4}{x}, so the slope at x=2x = 2 is 42=2\dfrac{4}{2} = 2.

4. (Core) Find dydx\dfrac{dy}{dx} for y=3ex−2x+ln⁡(x4)y = 3e^x - 2\sqrt{x} + \ln\big(x^4\big), for x>0x \gt 0. (Hint: use a log law first.)

Solution

By the power law of logarithms, ln⁡(x4)=4ln⁡x\ln\big(x^4\big) = 4\ln x. Also 2x=2x1/22\sqrt{x} = 2x^{1/2}.

dydx=3ex−x−1/2+4x=3ex−1x+4x\frac{dy}{dx} = 3e^x - x^{-1/2} + \frac{4}{x} = 3e^x - \frac{1}{\sqrt{x}} + \frac{4}{x}

5. (Core) Find the tangent line to y=exy = e^x at x=0x = 0, and the tangent line to y=ln⁡xy = \ln x at x=1x = 1.

Solution

For y=exy = e^x: the point is (0,1)(0, 1) and the slope is e0=1e^0 = 1, so y=x+1y = x + 1.

For y=ln⁡xy = \ln x: the point is (1,0)(1, 0) and the slope is 11=1\dfrac{1}{1} = 1, so y=x−1y = x - 1.

(The two graphs are reflections of each other in y=xy = x, and so are these two tangent lines.)

6. (Core) Find all xx in [0,2π][0, 2\pi] where f(x)=2sin⁡x+xf(x) = 2\sin x + x has a horizontal tangent.

Solution

f′(x)=2cos⁡x+1=0f'(x) = 2\cos x + 1 = 0, so cos⁡x=−12\cos x = -\dfrac{1}{2}.

In [0,2π][0, 2\pi]: x=2π3x = \dfrac{2\pi}{3} or x=4π3x = \dfrac{4\pi}{3}.

7. (Core) (Calculator allowed.) Let f(x)=ex−4cos⁡xf(x) = e^x - 4\cos x. Find f′(1)f'(1), correct to three decimal places.

Solution

f′(x)=ex+4sin⁡xf'(x) = e^x + 4\sin x. In radian mode:

f′(1)=e+4sin⁡1≈2.71828+3.36588≈6.084f'(1) = e + 4\sin 1 \approx 2.71828 + 3.36588 \approx 6.084

8. (Challenge) Find the tangent line to y=ln⁡xy = \ln x that passes through the origin.

Solution

The tangent line at x=ax = a goes through (a,ln⁡a)(a, \ln a) with slope 1a\dfrac{1}{a}:

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

For it to pass through (0,0)(0, 0):

0−ln⁡a=1a(0−a)=−1⇒ln⁡a=1⇒a=e0 - \ln a = \frac{1}{a}(0 - a) = -1 \quad\Rightarrow\quad \ln a = 1 \quad\Rightarrow\quad a = e

The tangent line is y−1=1e(x−e)y - 1 = \dfrac{1}{e}(x - e), which simplifies to y=xey = \dfrac{x}{e}.

9. (Challenge) Find all xx in [0,2π)[0, 2\pi) where the tangent lines to y=sin⁡xy = \sin x and y=cos⁡xy = \cos x are parallel.

Solution

Parallel means equal slopes:

cos⁡x=−sin⁡x⇒tan⁡x=−1(cos⁡x≠0)\cos x = -\sin x \quad\Rightarrow\quad \tan x = -1 \quad (\cos x \ne 0)

(If cos⁡x=0\cos x = 0 then sin⁡x=±1\sin x = \pm 1, so the equation can’t hold. Dividing by cos⁡x\cos x is safe.)

In [0,2π)[0, 2\pi): x=3π4x = \dfrac{3\pi}{4} or x=7π4x = \dfrac{7\pi}{4}.

Try these independently after the practice questions. Show your setup and explain your reasoning. Use exact answers where possible, and check that your answers fit the question. Homework solutions are not provided on the published site. All trigonometric angles are in radians. Use the four derivative formulas in this lesson with the basic rules; no chain rule is needed.

H1. (Foundations) Differentiate f(x)=2sin⁡x+3cos⁡xf(x)=2\sin x+3\cos x and find f′(0)f'(0). Explain the sign of the cosine contribution.

H2. (Foundations) For x>0x\gt0, differentiate g(x)=4ex−2ln⁡x+ln⁡7+e3+sin⁡(π/6)g(x)=4e^x-2\ln x+\ln7+e^3+\sin(\pi/6). Identify every constant term.

H3. (Core) Find the tangent line to y=ex−3xy=e^x-3x at x=0x=0. Check the contact point and slope separately.

H4. (Core) Find the tangent line to y=2ln⁡x+3x−4/xy=2\ln x+3\sqrt{x}-4/x at x=1x=1, and state the function’s real domain.

H5. (Core) Find all horizontal-tangent points of F(x)=3sin⁡x+cos⁡xF(x)=\sqrt3\sin x+\cos x for 0≤x≤2π0\le x\le2\pi. Check both endpoints as well as the interior solutions.

H6. (Core) For P(x)=2ex−5cos⁡xP(x)=2e^x-5\cos x, calculate P′(0.5)P'(0.5) to three decimal places in radian mode. Explain what this number measures rather than confusing it with P(0.5)P(0.5).

H7. (Challenge) Find the tangent line to y=ln⁡xy=\ln x that passes through (0,2)(0,2). Determine the contact input and point, and explain why there is exactly one such tangent.

H8. (Challenge) Find all inputs with 0≤x<2π0\le x\lt2\pi where the tangents to y=sin⁡xy=\sin x and y=−3cos⁡xy=-\sqrt3\cos x have equal slopes. Check any division by a trigonometric expression so no cases are lost.

H9. (Challenge) Determine a,b,ca,b,c in f(x)=aex+bsin⁡x+cf(x)=ae^x+b\sin x+c given f(0)=1f(0)=1, f′(0)=4f'(0)=4, and f′(π/2)=2eπ/2f'(\pi/2)=2e^{\pi/2}. Verify all three conditions.

H10. (Challenge) A student claims that exe^x and x2x^2 have parallel tangents whenever their heights are equal. Compare the two tangents at x=0x=0. Use IVT to show that their heights agree somewhere between −1-1 and 00, then prove that there is no real input where their tangent slopes agree. For x>0x\gt0, you may study the smallest value of ex/xe^x/x using its derivative, supplied here as ex(x−1)/x2e^x(x-1)/x^2.