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

Exercise 5.7 · Q10: Second derivative of sin⁡(log⁡x)\sin(\log x)

Exercise 5.7Second order derivative · Section 5.7
The question

Find the second order derivatives of the functions given in Exercises 1 to 10.

10. sin⁡(log⁡x)\sin(\log x)

Exam answer

Let y=sin⁡(log⁡x)y = \sin(\log x)⁠, x>0x \gt 0⁠. By the chain rule,

dydx=cos⁡(log⁡x)⋅1x=cos⁡(log⁡x)x\begin{aligned} \frac{dy}{dx} &= \cos(\log x)\cdot\frac1x \\ &= \frac{\cos(\log x)}{x} \end{aligned}

Differentiating again by the quotient rule,

d2ydx2=1x2[x⋅(−sin⁡(log⁡x)x)−cos⁡(log⁡x)⋅1]\begin{aligned} \frac{d^2y}{dx^2} &= \frac{1}{x^2}\bigg[x\cdot\Big(-\frac{\sin(\log x)}{x}\Big) \\ &\qquad - \cos(\log x)\cdot 1\bigg] \end{aligned}

∴ d2ydx2=−sin⁡(log⁡x)+cos⁡(log⁡x)x2\therefore\ \dfrac{d^2y}{dx^2} = -\dfrac{\sin(\log x) + \cos(\log x)}{x^2} (x>0)(x \gt 0)

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

The one idea this problem is built on

Differentiate twice, one rule at a time. The first derivative needs the chain rule (sine of something), and it comes out as a fraction,

dydx=cos⁡(log⁡x)x.\frac{dy}{dx} = \frac{\cos(\log x)}{x}.

The second derivative is then a derivative of a fraction, so it needs the quotient rule, with the chain rule once more for the top.

Given, to find, and the plan
Given
y=sin⁡(log⁡x)y = \sin(\log x)⁠. Here log⁡\log is the natural logarithm, defined only for x>0x \gt 0⁠, so the function lives on (0,∞)(0, \infty)⁠.
To find
d2ydx2\dfrac{d^2y}{dx^2} for x>0x \gt 0⁠.
Plan
(1) State the domain. (2) First derivative by the chain rule (this is Example 26(ii) of the book). (3) Second derivative by the quotient rule, with the chain rule for cos⁡(log⁡x)\cos(\log x)⁠. (4) Tidy up and compare with the answer key.

Basics you need

1Derivative of log⁡x\log x

ddxlog⁡x=1x\frac{d}{dx}\log x = \frac{1}{x} for x>0x \gt 0 (Theorem 5, Section 5.4). Basics: exponentials and logarithms

2Chain rule

If y=f(u)y = f(u) and u=g(x)u = g(x)⁠, then dydx=dydu⋅dudx\frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx}⁠: derivative of the outer function at the inner one, times the derivative of the inner function (Theorem 4, Section 5.3.1). Lesson: chain rule

3Quotient rule

(uv)′=u′v−uv′v2\left(\frac{u}{v}\right)' = \frac{u'v - uv'}{v^2} wherever v≠0v \neq 0 (Section 5.3, rule (3)). Basics: derivative rules

4Second order derivative (Section 5.7)

d2ydx2=ddx(dydx)\frac{d^2y}{dx^2} = \frac{d}{dx}\left(\frac{dy}{dx}\right)⁠: differentiate the first derivative once more. Lesson: second order derivative

Solution

  1. The domain

    log⁡x\log x is defined only for x>0x \gt 0⁠, and sin⁡\sin accepts every real number. So y=sin⁡(log⁡x)y = \sin(\log x) is defined exactly for x>0x \gt 0⁠, and every derivative below is for x>0x \gt 0⁠.

    A derivative can only exist where the function exists. Stating the domain first also tells us that dividing by xx later is safe, since x≠0x \neq 0 throughout.
    The natural logarithm is defined on (0,∞)(0, \infty) (Section 5.4). Basics: exponentials and logarithms
  2. First derivative by the chain rule

    Outer function sin⁡u\sin u⁠, inner function u=log⁡xu = \log x⁠. Then dydu=cos⁡u\frac{dy}{du} = \cos u and dudx=1x\frac{du}{dx} = \frac{1}{x}⁠, so

    dydx=cos⁡(log⁡x)⋅1x=cos⁡(log⁡x)x.\frac{dy}{dx} = \cos(\log x)\cdot\frac{1}{x} = \frac{\cos(\log x)}{x}.
    sin⁡(log⁡x)\sin(\log x) is a composite: first take the log, then the sine. The chain rule differentiates the outer layer (sine becomes cosine, with the inside left alone) and multiplies by the derivative of the inner layer. The book works exactly this out in Example 26(ii).
    ddusin⁡u=cos⁡u\frac{d}{du}\sin u = \cos u (Table 5.3); Basics 1 and 2. Lesson: chain rule
  3. Set up the quotient rule

    Write dydx=uv\frac{dy}{dx} = \frac{u}{v} with

    u=cos⁡(log⁡x),v=x.u = \cos(\log x), \qquad v = x.

    Their derivatives: by the chain rule (outer cos⁡\cos⁠, inner log⁡x\log x⁠),

    u′=−sin⁡(log⁡x)⋅1x=−sin⁡(log⁡x)x,u' = -\sin(\log x)\cdot\frac{1}{x} = -\frac{\sin(\log x)}{x},

    and v′=1v' = 1⁠.

    The first derivative is a fraction whose top and bottom both depend on xx⁠, so the quotient rule is the natural tool. Working out u′u' and v′v' separately first keeps the next line clean and makes sign errors easy to spot.
    dducos⁡u=−sin⁡u\frac{d}{du}\cos u = -\sin u (Table 5.3). Basics: derivative rules
  4. Second derivative

    Quotient rule, u′v−uv′v2\frac{u'v - uv'}{v^2}⁠. First the numerator:

    u′v−uv′=−sin⁡(log⁡x)x⋅x−cos⁡(log⁡x)⋅1=−sin⁡(log⁡x)−cos⁡(log⁡x).\begin{aligned} u'v - uv' &= -\frac{\sin(\log x)}{x}\cdot x - \cos(\log x)\cdot 1 \\ &= -\sin(\log x) - \cos(\log x). \end{aligned}

    Dividing by v2=x2v^2 = x^2⁠:

    d2ydx2=−sin⁡(log⁡x)−cos⁡(log⁡x)x2=−sin⁡(log⁡x)+cos⁡(log⁡x)x2.\begin{aligned} \frac{d^2y}{dx^2} &= \frac{-\sin(\log x) - \cos(\log x)}{x^2} \\ &= -\frac{\sin(\log x) + \cos(\log x)}{x^2}. \end{aligned}

    This holds for every x>0x \gt 0 (the denominator x2x^2 is never zero there).

    In u′vu'v the factor 1x\frac{1}{x} cancels against v=xv = x⁠, which is allowed because x≠0x \neq 0⁠. Then the two terms on top both carry a minus sign, so we take −1-1 out as a common factor. This is exactly the form in the answer key.
    Quotient rule, Section 5.3, rule (3). Basics: derivative rules
  5. Another route, as a check: the product rule

    Write dydx=1x⋅cos⁡(log⁡x)\frac{dy}{dx} = \frac{1}{x}\cdot\cos(\log x)⁠, a product. Using ddx1x=−1x2\frac{d}{dx}\frac{1}{x} = -\frac{1}{x^2}⁠:

    d2ydx2=−1x2cos⁡(log⁡x)+1x⋅(−sin⁡(log⁡x)x)=−cos⁡(log⁡x)+sin⁡(log⁡x)x2,\begin{aligned} \frac{d^2y}{dx^2} &= -\frac{1}{x^2}\cos(\log x) \\ &\quad + \frac{1}{x}\cdot\left(-\frac{\sin(\log x)}{x}\right) \\ &= -\frac{\cos(\log x) + \sin(\log x)}{x^2}, \end{aligned}

    the same as Step 4.

    Getting the same answer by a second rule is a cheap and reliable check on signs. Either route is fine in an exam.
    Product rule, Section 5.3, rule (2); ddxx−1=−x−2\frac{d}{dx}x^{-1} = -x^{-2} (Table 5.3).
Result

For x>0x \gt 0⁠,

d2ydx2=−sin⁡(log⁡x)+cos⁡(log⁡x)x2.\frac{d^2y}{dx^2} = -\frac{\sin(\log x) + \cos(\log x)}{x^2}.

(Textbook answer: −sin⁡(log⁡x)+cos⁡(log⁡x)x2-\dfrac{\sin(\log x) + \cos(\log x)}{x^2}⁠, the same.)

Check it with numbers

Take x=2x = 2⁠. Then log⁡2≈0.6931472\log 2 \approx 0.6931472⁠, sin⁡(log⁡2)≈0.6389613\sin(\log 2) \approx 0.6389613 and cos⁡(log⁡2)≈0.7692389\cos(\log 2) \approx 0.7692389⁠, so

dydx≈0.76923892≈0.3846195,d2ydx2≈−1.40820024≈−0.3520500.\begin{aligned} \frac{dy}{dx} &\approx \frac{0.7692389}{2} \approx 0.3846195, \\ \frac{d^2y}{dx^2} &\approx -\frac{1.4082002}{4} \approx -0.3520500. \end{aligned}

From values of y=sin⁡(log⁡x)y = \sin(\log x) alone, with h=0.001h = 0.001⁠, the second difference y(2.001)−2y(2)+y(1.999)h2\frac{y(2.001) - 2y(2) + y(1.999)}{h^2} is about −0.352050-0.352050⁠, matching.

Common mistakes
  1. Forgetting the inner derivative. ddxsin⁡(log⁡x)\frac{d}{dx}\sin(\log x) is cos⁡(log⁡x)⋅1x\cos(\log x)\cdot\frac{1}{x}⁠, not just cos⁡(log⁡x)\cos(\log x)⁠. The same factor 1x\frac{1}{x} appears again when differentiating cos⁡(log⁡x)\cos(\log x)⁠.
  2. Sign of cos⁡\cos's derivative. dducos⁡u=−sin⁡u\frac{d}{du}\cos u = -\sin u⁠. Losing this minus gives sin⁡(log⁡x)−cos⁡(log⁡x)x2\frac{\sin(\log x) - \cos(\log x)}{x^2}⁠, which is wrong.
  3. Treating xx in the denominator as a constant. cos⁡(log⁡x)x\frac{\cos(\log x)}{x} has xx on top and bottom, so it needs the quotient (or product) rule.
  4. Leaving out the domain. The answer is only meaningful for x>0x \gt 0⁠.
What to take away
  1. For a second derivative, first get a clean first derivative, then decide which rule its shape needs (here a quotient).
  2. Every time log⁡x\log x sits inside another function, the chain rule brings out a factor 1x\frac{1}{x}⁠.
  3. Functions of log⁡x\log x lead to second derivatives with x2x^2 underneath; that is why Question 13 multiplies by x2x^2 and xx⁠.

Every fact used, and where it comes from

FactUsed inSource
log⁡x\log x is defined for x>0x \gt 0⁠; ddxlog⁡x=1x\frac{d}{dx}\log x = \frac{1}{x}Steps 1, 2, 3Section 5.4, Theorem 5 (Lesson: exponential and logarithmic functions)
ddxsin⁡x=cos⁡x\frac{d}{dx}\sin x = \cos x⁠, ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x⁠, ddxxn=nxn−1\frac{d}{dx}x^n = nx^{n-1}Steps 2, 3, 5Table 5.3, Section 5.3
Chain rule; ddxsin⁡(log⁡x)=cos⁡(log⁡x)x\frac{d}{dx}\sin(\log x) = \frac{\cos(\log x)}{x}Steps 2, 3Theorem 4, Section 5.3.1; Example 26(ii) (Lesson: chain rule)
Product and quotient rulesSteps 4, 5Section 5.3, rules (2) and (3) (Basics: derivative rules)
d2ydx2=ddx(dydx)\frac{d^2y}{dx^2} = \frac{d}{dx}\left(\frac{dy}{dx}\right)Steps 4, 5Section 5.7 (Lesson: second order derivative)
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 →