Lesson 2 of 7 · 18 min

The chain rule with sine, cosine, e and ln

Differentiate sin⁡(f(x))\sin(f(x)), cos⁡(f(x))\cos(f(x)), powers of sine and cosine, and composites that mix exponential, logarithmic and trigonometric functions, using the chain rule.

What you will be able to do

  • Use ddxsin⁡(f(x))=f′(x)cos⁡(f(x))\frac{d}{dx}\sin(f(x)) = f'(x)\cos(f(x)) and ddxcos⁡(f(x))=−f′(x)sin⁡(f(x))\frac{d}{dx}\cos(f(x)) = -f'(x)\sin(f(x)).
  • Differentiate powers of trigonometric functions, such as sin⁡3(x)\sin^3(x), and tell sin⁡2(x)\sin^2(x) apart from sin⁡(x2)\sin(x^2).
  • Use the chain rule on composites of exponential, logarithmic and trigonometric functions, such as esin⁡(x)e^{\sin(x)} and ln⁡(cos⁡(x))\ln(\cos(x)).

The graph of y=sin⁡(2x)y = \sin(2x) fits two complete waves into the space where y=sin⁡(x)y = \sin(x) fits one. It climbs to the same height in half the horizontal distance, so it must be twice as steep. You would expect its gradient function to be 2cos⁡(2x)2\cos(2x), and it is.

Interactive

Squash the wave and watch the gradient

The solid curve is y=sin⁡(bx)y = \sin(bx); the dashed curve is its derivative. As bb grows, the wave is squashed horizontally, every slope is multiplied by bb, and so is the height of the derivative graph.

The factor bb comes from the chain rule. Write y=sin⁡(u)y = \sin(u) with u=bxu = bx. Then dydu=cos⁡(u)\frac{dy}{du} = \cos(u) and dudx=b\frac{du}{dx} = b, so

dydx=dydu×dudx=cos⁡(u)×b=bcos⁡(bx)\frac{dy}{dx} = \frac{dy}{du} \times \frac{du}{dx} = \cos(u) \times b = b\cos(bx)

The same argument works for any inside function f(x)f(x).

Key idea

Sine and cosine of a function

ddxsin⁡(f(x))=f′(x)cos⁡(f(x))ddxcos⁡(f(x))=−f′(x)sin⁡(f(x))\frac{d}{dx}\sin(f(x)) = f'(x)\cos(f(x)) \qquad \frac{d}{dx}\cos(f(x)) = -f'(x)\sin(f(x))

Differentiate the outside (sine or cosine), keep the inside exactly as it is, then multiply by the derivative of the inside. Both rules are on the QCAA formula sheet. For a linear inside, ddxsin⁡(ax+b)=acos⁡(ax+b)\frac{d}{dx}\sin(ax + b) = a\cos(ax + b) and ddxcos⁡(ax+b)=−asin⁡(ax+b)\frac{d}{dx}\cos(ax + b) = -a\sin(ax + b).

Differentiate y=cos⁡(5x)y = \cos(5x).

fracdydx =
Reads asYour answer shows here as maths.

Worked example

Sine and cosine of a function

  • Simple familiar
  • Technology free

Differentiate:

(a) y=sin⁡(4x−π3)y = \sin\left(4x - \frac{\pi}{3}\right)

(b) y=cos⁡(x2+1)y = \cos\left(x^2 + 1\right)

(c) y=6cos⁡(x3)y = 6\cos\left(\frac{x}{3}\right)

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Identify the inside function and differentiate it.

  2. Differentiate the outside: sin⁡→cos⁡\sin \to \cos, cos⁡→−sin⁡\cos \to -\sin, with the inside unchanged.

  3. Multiply by the derivative of the inside, and tidy constants.

Watch out for

  • Writing −sin⁡(2x)-\sin(2x) in (b): the inside stays x2+1x^2 + 1; only its derivative 2x2x goes in front.

  • In (c), x3\frac{x}{3} differentiates to 13\frac{1}{3}, so the coefficient is divided by 3, not multiplied.

Powers of sine and cosine. sin⁡2(x)\sin^2(x) is shorthand for (sin⁡(x))2(\sin(x))^2. Here the outside function is the square and the inside is sin⁡(x)\sin(x), so the chain rule gives

ddxsin⁡2(x)=2sin⁡(x)×cos⁡(x)=2sin⁡(x)cos⁡(x)\frac{d}{dx}\sin^2(x) = 2\sin(x) \times \cos(x) = 2\sin(x)\cos(x)

That is very different from sin⁡(x2)\sin(x^2), where sine is on the outside.

y=sin⁡2(x)=(sin⁡(x))2y = \sin^2(x) = (\sin(x))^2

Outside: squaring. Inside: u=sin⁡(x)u = \sin(x).

dydx=2u×dudx=2sin⁡(x)cos⁡(x)\frac{dy}{dx} = 2u \times \frac{du}{dx} = 2\sin(x)\cos(x)

y=sin⁡(x2)y = \sin(x^2)

Outside: sine. Inside: u=x2u = x^2.

dydx=cos⁡(u)×dudx=2xcos⁡(x2)\frac{dy}{dx} = \cos(u) \times \frac{du}{dx} = 2x\cos(x^2)

Differentiate y=sin⁡2(x)y = \sin^2(x).

fracdydx =
Reads asYour answer shows here as maths.

Worked example

Differentiate y=sin⁡3(2x)y = \sin^3(2x)

  • Complex familiar
  • Technology free

Differentiate y=sin⁡3(2x)y = \sin^3(2x).

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Rewrite sin⁡n(f(x))\sin^n(f(x)) as (sin⁡(f(x)))n\left(\sin(f(x))\right)^n.

  2. Differentiate from the outside in: the power, then the sine, then the inside.

  3. Multiply all the derivatives together.

Watch out for

  • Stopping after two layers: 3sin⁡2(2x)cos⁡(2x)3\sin^2(2x)\cos(2x) is missing the factor of 2.

  • Writing 3cos⁡2(2x)3\cos^2(2x): the outside power is differentiated first and its inside, sin⁡(2x)\sin(2x), stays unchanged.

Mixing in ee and ln⁡\ln. You already know ddxef(x)=f′(x)ef(x)\frac{d}{dx}e^{f(x)} = f'(x)e^{f(x)} and ddxln⁡(f(x))=f′(x)f(x)\frac{d}{dx}\ln(f(x)) = \frac{f'(x)}{f(x)} from Topic 1. They are the chain rule too, so they combine with sine and cosine in any order. Find the outside function, differentiate it with the inside left alone, and multiply by the derivative of the inside.

Composites mixing exponential, logarithmic and trigonometric functions.
yyOutsideInside uudydx\frac{dy}{dx}
esin⁡(x)e^{\sin(x)}eue^usin⁡(x)\sin(x)cos⁡(x) esin⁡(x)\cos(x)\,e^{\sin(x)}
sin⁡(ex)\sin(e^x)sin⁡(u)\sin(u)exe^xexcos⁡(ex)e^x\cos(e^x)
ln⁡(cos⁡(x))\ln(\cos(x))ln⁡(u)\ln(u)cos⁡(x)\cos(x)−sin⁡(x)cos⁡(x)=−tan⁡(x)\frac{-\sin(x)}{\cos(x)} = -\tan(x)
cos⁡(ln⁡(x))\cos(\ln(x))cos⁡(u)\cos(u)ln⁡(x)\ln(x)−sin⁡(ln⁡(x))x-\frac{\sin(\ln(x))}{x}
sin⁡(x)\sqrt{\sin(x)}u12u^{\frac{1}{2}}sin⁡(x)\sin(x)cos⁡(x)2sin⁡(x)\frac{\cos(x)}{2\sqrt{\sin(x)}}

Differentiate y=ecos⁡(x)y = e^{\cos(x)}.

fracdydx =
Reads asYour answer shows here as maths.

Worked example

Composites of ee, ln⁡\ln and trigonometric functions

  • Complex familiar
  • Technology free

(a) Differentiate y=esin⁡(2x)y = e^{\sin(2x)}.

(b) Differentiate y=ln⁡(2+cos⁡(x))y = \ln\left(2 + \cos(x)\right), and hence find the gradient of its graph at x=π2x = \frac{\pi}{2}.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Find the outside function: eue^u, ln⁡(u)\ln(u), sin⁡(u)\sin(u), cos⁡(u)\cos(u) or unu^n.

  2. Differentiate the inside, using the chain rule again if it is a composite.

  3. Apply the matching rule from the formula sheet.

Watch out for

  • Changing the exponent: esin⁡(2x)e^{\sin(2x)} differentiates to 2cos⁡(2x)esin⁡(2x)2\cos(2x)e^{\sin(2x)}, not e2cos⁡(2x)e^{2\cos(2x)}.

  • Writing 12+cos⁡(x)\frac{1}{2 + \cos(x)}: the derivative of the inside goes on top.

Differentiate y=ln⁡(sin⁡(x))y = \ln(\sin(x)), for 0<x<π0 < x < \pi.

fracdydx =
Reads asYour answer shows here as maths.

Common mistake

Three chain-rule slips

  • Forgetting the inside's derivative. ddxsin⁡(3x)=3cos⁡(3x)\frac{d}{dx}\sin(3x) = 3\cos(3x), not cos⁡(3x)\cos(3x).
  • Changing the inside. ddxcos⁡(x2)=−2xsin⁡(x2)\frac{d}{dx}\cos(x^2) = -2x\sin(x^2). The bracket still holds x2x^2, not 2x2x.
  • Mixing up sin⁡2(x)\sin^2(x) and sin⁡(x2)\sin(x^2). Ask "what did I do last?" For sin⁡2(x)\sin^2(x) you squared last, so the square is the outside.

Exam tip

Showing the chain rule

For anything more than a linear inside, write the substitution: "Let u=x2+1u = x^2 + 1, so dudx=2x\frac{du}{dx} = 2x." It shows the marker your method, and it stops you from dropping the inside's derivative.

Summary

  • ddxsin⁡(f(x))=f′(x)cos⁡(f(x))\frac{d}{dx}\sin(f(x)) = f'(x)\cos(f(x)) and ddxcos⁡(f(x))=−f′(x)sin⁡(f(x))\frac{d}{dx}\cos(f(x)) = -f'(x)\sin(f(x)).

  • For a linear inside: ddxsin⁡(ax+b)=acos⁡(ax+b)\frac{d}{dx}\sin(ax + b) = a\cos(ax + b) and ddxcos⁡(ax+b)=−asin⁡(ax+b)\frac{d}{dx}\cos(ax + b) = -a\sin(ax + b).

  • sin⁡n(x)=(sin⁡(x))n\sin^n(x) = (\sin(x))^n, so ddxsin⁡n(x)=nsin⁡n−1(x)cos⁡(x)\frac{d}{dx}\sin^n(x) = n\sin^{n-1}(x)\cos(x).

  • The same chain rule handles ef(x)e^{f(x)} and ln⁡(f(x))\ln(f(x)), so composites like esin⁡(x)e^{\sin(x)} and ln⁡(cos⁡(x))\ln(\cos(x)) need no new rules.

  • Outside first, inside unchanged, then multiply by the derivative of the inside. Use more than one layer when needed.

Finished the lesson?

Try the 4 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 2 of 70% read

Save your progress with a free account