Class 12 Maths, Worked in Full Past papersGet updates
Chapter 5 · Continuity and Differentiability

Exercise 5.2 · Q2: Differentiate cos⁡(sin⁡x)\cos(\sin x)

Exercise 5.2Chain rule · Section 5.3.1
The question

Differentiate the function with respect to xx⁠:

cos⁡(sin⁡x)\cos\left(\sin x\right)
Exam answer

Let y=cos⁡(sin⁡x)y = \cos(\sin x)⁠. Put t=sin⁡xt = \sin x⁠, so y=cos⁡ty = \cos t⁠.

dydt=−sin⁡t,dtdx=cos⁡x\frac{dy}{dt} = -\sin t, \qquad \frac{dt}{dx} = \cos x

By the chain rule,

dydx=dydt⋅dtdx=−sin⁡t⋅cos⁡x\begin{aligned} \frac{dy}{dx} &= \frac{dy}{dt}\cdot\frac{dt}{dx} \\ &= -\sin t\cdot\cos x \end{aligned}

∴ dydx=−cos⁡xsin⁡(sin⁡x)\therefore\ \dfrac{dy}{dx} = -\cos x\sin(\sin x)⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

The cosine here is applied to sin⁡x\sin x⁠, not to xx⁠. So the function is a composite: first compute sin⁡x\sin x⁠, then take the cosine of that number. The chain rule differentiates it as (derivative of cosine, evaluated at sin⁡x\sin x⁠) times (derivative of sin⁡x\sin x⁠).

Given, to find, and the plan
Given
y=cos⁡(sin⁡x)y = \cos(\sin x)⁠, defined for every real xx⁠.
To find
dydx\dfrac{dy}{dx}⁠.
Plan
Inner function t=sin⁡xt = \sin x⁠, outer function y=cos⁡ty = \cos t⁠. Differentiate both, multiply, and substitute t=sin⁡xt = \sin x back.

Basics you need

1Composite functions

cos⁡(sin⁡x)\cos(\sin x) means: take xx⁠, compute sin⁡x\sin x⁠, then take the cosine of the result. The function applied first is the inner one. Basics: composite functions

2The chain rule

dydx=dydt⋅dtdx\dfrac{dy}{dx} = \dfrac{dy}{dt}\cdot\dfrac{dt}{dx} when yy depends on tt⁠, tt depends on xx⁠, and both derivatives exist (Theorem 4, Section 5.3.1). Lesson: the chain rule

3Derivatives of sine and cosine

ddx(sin⁡x)=cos⁡x\frac{d}{dx}(\sin x) = \cos x and ddx(cos⁡x)=−sin⁡x\frac{d}{dx}(\cos x) = -\sin x (Table 5.3). Note the minus sign for cosine: cosine decreases on (0,π)(0,\pi)⁠, where sine is positive. Basics: derivative rules

Solution

  1. Name the inner and the outer function

    Let y=cos⁡(sin⁡x)y = \cos(\sin x) and put

    t=sin⁡x(inner),y=cos⁡t(outer).\begin{aligned} t &= \sin x &&(\text{inner}), \\ y &= \cos t &&(\text{outer}). \end{aligned}
    Table 5.3 gives the derivative of cos⁡x\cos x only when cosine is applied directly to the variable. Here it is applied to sin⁡x\sin x⁠. Naming t=sin⁡xt = \sin x splits the problem into two derivatives we know.
    "What is computed first?" On a calculator you press sin first and cos last, so sine is inner and cosine is outer. Reversing the order would describe a different function, sin⁡(cos⁡x)\sin(\cos x)⁠. Basics: composite functions
  2. Differentiate each link

    dydt=ddt(cos⁡t)=−sin⁡t,dtdx=ddx(sin⁡x)=cos⁡x.\begin{aligned} \frac{dy}{dt} &= \frac{d}{dt}(\cos t) = -\sin t, \\ \frac{dt}{dx} &= \frac{d}{dx}(\sin x) = \cos x. \end{aligned}
    Each link is now a standard function of its own variable, so Table 5.3 applies directly. Both derivatives exist for every real number, so the chain rule can be used at every xx⁠.
    Table 5.3 (Section 5.3): (sin⁡x)′=cos⁡x(\sin x)' = \cos x⁠, (cos⁡x)′=−sin⁡x(\cos x)' = -\sin x⁠. Basics: derivative rules
  3. Multiply (chain rule) and return to xx

    dydx=dydt⋅dtdx=(−sin⁡t)⋅cos⁡x=−cos⁡x sin⁡(sin⁡x).\begin{aligned} \frac{dy}{dx} &= \frac{dy}{dt}\cdot\frac{dt}{dx} \\ &= (-\sin t)\cdot\cos x \\ &= -\cos x\,\sin(\sin x). \end{aligned}

    In the last line tt was replaced by sin⁡x\sin x⁠, and the factors were reordered so the expression reads clearly.

    The outer derivative −sin⁡t-\sin t must be evaluated at the inner function's value, t=sin⁡xt = \sin x⁠. That is why the answer contains sin⁡(sin⁡x)\sin(\sin x)⁠, a sine of a sine, and not sin⁡x\sin x alone. Writing cos⁡x\cos x in front avoids the ambiguous "sin⁡(sin⁡x)cos⁡x\sin(\sin x)\cos x", which some readers take as sin⁡(sin⁡xcos⁡x)\sin(\sin x\cos x)⁠.
    Chain rule, Theorem 4, Section 5.3.1. Lesson: the chain rule
Result

For every real xx⁠,

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

(Textbook answer: −cos⁡x sin⁡(sin⁡x)-\cos x\,\sin(\sin x)⁠.)

Check it with numbers

Take x=0.7x = 0.7 (radians). Then sin⁡0.7≈0.6442177\sin 0.7 \approx 0.6442177⁠, cos⁡0.7≈0.7648422\cos 0.7 \approx 0.7648422⁠, and sin⁡(0.6442177)≈0.6005731\sin(0.6442177) \approx 0.6005731⁠. The formula gives

−0.7648422×0.6005731≈−0.4593437.-0.7648422 \times 0.6005731 \approx -0.4593437.

A difference quotient of cos⁡(sin⁡x)\cos(\sin x) with h=0.0001h = 0.0001 on each side of 0.70.7 also gives −0.45934-0.45934⁠.

A second check: at x=0x = 0 the formula gives −1⋅sin⁡0=0-1\cdot\sin 0 = 0⁠. This makes sense, because sin⁡x\sin x is near 00 there and cos⁡t\cos t is flat (at its maximum) near t=0t = 0⁠.

Common mistakes
  1. Losing the minus sign. The derivative of cosine is −sin⁡-\sin⁠, so the answer is negative wherever cos⁡x\cos x and sin⁡(sin⁡x)\sin(\sin x) are both positive (for example near x=0.7x = 0.7⁠).
  2. Evaluating the outer derivative at xx⁠. −sin⁡xcos⁡x-\sin x\cos x is wrong: the outer derivative must be evaluated at sin⁡x\sin x⁠, giving −sin⁡(sin⁡x)-\sin(\sin x)⁠.
  3. Forgetting the inner factor. −sin⁡(sin⁡x)-\sin(\sin x) alone is missing cos⁡x\cos x⁠, the derivative of the inner function.
What to take away
  1. For cos⁡(u(x))\cos(u(x))⁠: the derivative is −sin⁡(u(x))⋅u′(x)-\sin(u(x))\cdot u'(x)⁠.
  2. The outer derivative keeps the inner function inside it unchanged; only one extra factor, the inner derivative, appears.

Every fact used, and where it comes from

FactUsed inSource
(sin⁡x)′=cos⁡x(\sin x)' = \cos x⁠, (cos⁡x)′=−sin⁡x(\cos x)' = -\sin xStep 2Table 5.3, Section 5.3
Chain ruleStep 3Theorem 4, Section 5.3.1 (Lesson: the chain rule)
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →