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

Exercise 5.2 · Q8: Differentiate cos⁡x\cos\sqrt x

Exercise 5.2Chain rule · Section 5.3.1
The question

Differentiate the function with respect to xx⁠:

cos⁡(x)\cos\left(\sqrt{x}\right)
Exam answer

Let y=cos⁡xy = \cos\sqrt x⁠, x>0x > 0⁠. Put t=xt = \sqrt x⁠, so y=cos⁡ty = \cos t⁠.

dydt=−sin⁡t,dtdx=12x\frac{dy}{dt} = -\sin t, \qquad \frac{dt}{dx} = \frac{1}{2\sqrt x}

By the chain rule,

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

∴ dydx=−sin⁡x2x\therefore\ \dfrac{dy}{dx} = -\dfrac{\sin\sqrt x}{2\sqrt x} (for x>0x > 0⁠).

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

The one idea this problem is built on

The cosine is applied not to xx but to x\sqrt x⁠. By the chain rule, the rate of change is the rate of the outer function (cosine), taken at x\sqrt x⁠, times the rate of the inner function x\sqrt x⁠.

Given, to find, and the plan
Given
y=cos⁡xy = \cos\sqrt{x}⁠, defined for x≥0x \ge 0⁠.
To find
dydx\dfrac{dy}{dx}⁠, and where the formula is valid.
Plan
Put t=xt = \sqrt x⁠, so y=cos⁡ty = \cos t⁠. Find dydt\frac{dy}{dt} and dtdx\frac{dt}{dx}⁠, multiply, and write the answer in terms of xx⁠.

Basics you need

1Chain rule

If y=v(t)y = v(t) and t=u(x)t = u(x)⁠, and both dvdt\frac{dv}{dt} and dtdx\frac{dt}{dx} exist, then dydx=dvdt⋅dtdx\dfrac{dy}{dx} = \dfrac{dv}{dt}\cdot\dfrac{dt}{dx} (Theorem 4, Section 5.3.1). Lesson: the chain rule

2Derivative of x\sqrt x

x=x1/2\sqrt x = x^{1/2}⁠, so (x)′=12x−1/2=12x(\sqrt x)' = \frac12 x^{-1/2} = \frac{1}{2\sqrt x}⁠, for x>0x > 0 only. Basics: derivative rules

3Derivative of cosine

(cos⁡t)′=−sin⁡t(\cos t)' = -\sin t (Table 5.3). Basics: derivative rules

Solution

  1. Domain, and name the inner and outer functions

    x\sqrt x is real only for x≥0x \ge 0⁠, and cosine accepts every real number, so yy is defined for x≥0x \ge 0⁠. Put

    t=x,y=cos⁡t.t = \sqrt{x}, \qquad y = \cos t.
    The inner function is the one applied first: you take the square root of xx⁠, then the cosine of the result. Naming it tt turns one complicated function into two simple ones.
    Composite function y=(v∘u)(x)y = (v\circ u)(x) with u(x)=xu(x) = \sqrt x⁠, v(t)=cos⁡tv(t) = \cos t⁠. Basics: composite functions
  2. Differentiate each link

    dydt=−sin⁡t,dtdx=12x(x>0).\frac{dy}{dt} = -\sin t, \qquad \frac{dt}{dx} = \frac{1}{2\sqrt{x}} \quad (x > 0).
    The first is straight from Table 5.3. The second is the power rule with n=12n = \frac12⁠: 12x−1/2\frac12 x^{-1/2}⁠, and x−1/2=1xx^{-1/2} = \frac{1}{\sqrt x}⁠. At x=0x = 0 this would need division by 00⁠, so the inner link has no derivative there and the chain rule (which needs dtdx\frac{dt}{dx} to exist) applies only for x>0x > 0⁠.
    Power rule (xn)′=nxn−1(x^n)' = nx^{n-1}⁠, here n=12n = \frac12⁠. Basics: derivative rules
  3. Multiply and substitute back

    dydx=dydt⋅dtdx=(−sin⁡t)⋅12x=−sin⁡x2x.\begin{aligned} \frac{dy}{dx} &= \frac{dy}{dt}\cdot\frac{dt}{dx} = (-\sin t)\cdot\frac{1}{2\sqrt x} \\ &= -\frac{\sin\sqrt{x}}{2\sqrt{x}}. \end{aligned}
    The book's practice is to give the final answer in terms of xx only (as in Example 21), so we replace tt by x\sqrt x⁠. The sine is evaluated at x\sqrt x⁠, the value that entered the cosine.
    Chain rule, Theorem 4, Section 5.3.1. Lesson: the chain rule
  4. What about x=0x = 0⁠?

    The formula is meaningless at x=0x = 0⁠, but the function has a right-hand derivative there. Using 1−cos⁡θ=2sin⁡2θ21 - \cos\theta = 2\sin^2\frac{\theta}{2} with θ=h\theta = \sqrt h⁠, for h>0h > 0⁠:

    cos⁡h−cos⁡0h=−2sin⁡2(h/2)h=−12(sin⁡(h/2)h/2)2,\begin{aligned} \frac{\cos\sqrt h - \cos 0}{h} &= -\frac{2\sin^2(\sqrt h/2)}{h} \\ &= -\frac12\left(\frac{\sin(\sqrt h/2)}{\sqrt h/2}\right)^2, \end{aligned}

    which tends to −12⋅12=−12-\frac12\cdot 1^2 = -\frac12 as h→0+h \to 0^+⁠.

    This step goes beyond the question, which (like the textbook's answer) concerns x>0x > 0⁠. It shows that "the chain rule does not apply" is not the same as "there is no derivative": the chain rule is a sufficient method, not the definition. Only the right-hand derivative makes sense at 00⁠, because yy is not defined for x<0x < 0⁠.
    lim⁡θ→0sin⁡θθ=1\lim_{\theta\to 0}\frac{\sin\theta}{\theta} = 1 (Class XI, Limits and Derivatives). Basics: left-hand and right-hand limits
Result

For x>0x > 0⁠,

ddxcos⁡x=−sin⁡x2x.\frac{d}{dx}\cos\sqrt{x} = -\frac{\sin\sqrt{x}}{2\sqrt{x}}.

(Textbook answer: −sin⁡x2x-\dfrac{\sin\sqrt x}{2\sqrt x}⁠, the same.) At x=0x = 0 only a right-hand derivative exists, equal to −12-\frac12 (Step 4).

Check it with numbers

Take x=π24≈2.4674011x = \frac{\pi^2}{4} \approx 2.4674011⁠, so x=π2\sqrt x = \frac{\pi}{2} and sin⁡x=1\sin\sqrt x = 1⁠. The formula gives −12⋅π/2=−1π≈−0.3183099-\dfrac{1}{2\cdot\pi/2} = -\dfrac1\pi \approx -0.3183099⁠. A difference quotient of cos⁡x\cos\sqrt x with h=0.0001h = 0.0001 on each side gives −0.3183099-0.3183099⁠. At x=1x = 1⁠: formula −sin⁡12≈−0.4207355-\frac{\sin 1}{2} \approx -0.4207355⁠, difference quotient −0.4207355-0.4207355⁠. Near 00⁠: cos⁡0.0001−10.0001≈−0.4999958\frac{\cos\sqrt{0.0001} - 1}{0.0001} \approx -0.4999958⁠, close to −12-\frac12⁠.

Common mistakes
  1. Writing −sin⁡x-\sin\sqrt x and stopping. That is only the outer rate; the inner rate 12x\frac{1}{2\sqrt x} must multiply it.
  2. Writing −sin⁡x⋅12x-\sin x\cdot\frac{1}{2\sqrt x}⁠. The sine must be evaluated at x\sqrt x⁠, the value fed into the cosine.
  3. Claiming the formula at x=0x = 0⁠. It divides by zero there; the derivative at 00 needs a separate one-sided limit.
What to take away
  1. ddxcos⁡(u(x))=−sin⁡(u(x))⋅u′(x)\frac{d}{dx}\cos(u(x)) = -\sin(u(x))\cdot u'(x)⁠: outer derivative at the inner function, times the inner derivative.
  2. (x)′=12x(\sqrt x)' = \frac{1}{2\sqrt x} holds for x>0x > 0 only, so any answer containing it is stated for x>0x > 0⁠.

Every fact used, and where it comes from

FactUsed inSource
(cos⁡t)′=−sin⁡t(\cos t)' = -\sin t⁠, (xn)′=nxn−1(x^n)' = nx^{n-1}Step 2Table 5.3, Section 5.3
Chain ruleStep 3Theorem 4, Section 5.3.1 (Lesson: the chain rule)
Final answer written in terms of xxStep 3Example 21, Section 5.3.1
Derivative as a limit; one-sided derivativesStep 4Section 5.3 (Lesson: differentiability)
1−cos⁡θ=2sin⁡2θ21 - \cos\theta = 2\sin^2\frac{\theta}{2}⁠; sin⁡θθ→1\frac{\sin\theta}{\theta} \to 1Step 4Class XI, Trigonometric Functions; Limits and Derivatives
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 →