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

Exercise 5.4 · Q9: Differentiate cos⁡xlog⁡x\dfrac{\cos x}{\log x}⁠, x>0x>0

Exercise 5.4Quotient rule with log x · Section 5.4
The question

Differentiate the following w.r.t. xx⁠:

cos⁡xlog⁡x,x>0\frac{\cos x}{\log x}, \qquad x > 0
Exam answer

Let y=cos⁡xlog⁡xy = \frac{\cos x}{\log x}⁠. By the quotient rule,

dydx=log⁡x⋅(−sin⁡x)−cos⁡x⋅1x(log⁡x)2\frac{dy}{dx} = \frac{\log x\cdot(-\sin x) - \cos x\cdot\frac1x}{(\log x)^2}

Multiplying numerator and denominator by xx⁠,

∴ dydx=−xsin⁡xlog⁡x+cos⁡xx(log⁡x)2\therefore\ \dfrac{dy}{dx} = -\dfrac{x\sin x\log x + \cos x}{x(\log x)^2} (x>0, x≠1)(x > 0,\ x \ne 1)⁠.

The answer key, like the question, states only x>0x > 0⁠; at x=1x = 1 neither the function nor the formula is defined, so x≠1x \ne 1 is needed as well.

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

The one idea this problem is built on

One function divided by another: the quotient rule, with ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x from Theorem 5. The domain needs two conditions, not one: log⁡x\log x needs x>0x > 0⁠, and since it is a denominator it must also be non-zero, which excludes x=1x = 1⁠.

Given, to find, and the plan
Given
y=cos⁡xlog⁡xy = \dfrac{\cos x}{\log x}⁠, x>0x > 0 (natural logarithm).
To find
dydx\dfrac{dy}{dx}⁠, and exactly where it is valid.
Plan
(1) Domain, including x≠1x \ne 1⁠. (2) Name u=cos⁡xu = \cos x⁠, v=log⁡xv = \log x and differentiate each. (3) Apply the quotient rule. (4) Clear the fraction inside the numerator.

Basics you need

1The logarithm function

log⁡x\log x is defined for x>0x > 0 only, and log⁡x=0\log x = 0 exactly at x=1x = 1 (it is increasing and passes through (1,0)(1, 0)⁠, Section 5.4). Basics: exponentials and logarithms

2Quotient rule

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

3Two standard derivatives

ddxcos⁡x=−sin⁡x\dfrac{d}{dx}\cos x = -\sin x (Table 5.3) and ddxlog⁡x=1x\dfrac{d}{dx}\log x = \dfrac1x⁠, x>0x > 0 (Theorem 5 (2)). Lesson: exponential and logarithmic functions

Solution

  1. Where is the function defined?

    cos⁡x\cos x is defined everywhere. The denominator log⁡x\log x needs x>0x > 0⁠, and we cannot divide by zero, so also log⁡x≠0\log x \ne 0⁠, that is x≠1x \ne 1⁠. The domain is

    0<x<1orx>1.0 < x < 1 \quad\text{or}\quad x > 1.
    The question writes only "x>0x > 0", which makes log⁡x\log x exist; but at x=1x = 1 the fraction is cos⁡10\frac{\cos 1}{0}⁠, which is undefined. So the condition x≠1x \ne 1 must be added, both for the function and for its derivative. The graph below shows what happens near x=1x = 1⁠.
    log⁡1=0\log 1 = 0⁠: the point (1,0)(1, 0) is on the graph of log⁡\log (Section 5.4, observation (3)). Basics: exponentials and logarithms
    x y 2 3 4 5 3 2 1 −1 −2 −3 1 x = 1 excluded: log 1 = 0 y = cos x / log x
    y=cos⁡xlog⁡xy = \frac{\cos x}{\log x} for 0<x≤50 < x \le 5 (values beyond ±3.5\pm 3.5 not drawn). Near x=1x = 1 the denominator is close to 00 and the graph shoots off to −∞-\infty on the left and +∞+\infty on the right, so x=1x = 1 is not in the domain. The open dot at the origin marks the excluded point x=0x = 0⁠.
  2. Name the top and bottom, and differentiate each

    u=cos⁡x,u′=−sin⁡x,v=log⁡x,v′=1x.\begin{aligned} u &= \cos x, & u' &= -\sin x, \\ v &= \log x, & v' &= \frac{1}{x}. \end{aligned}
    Listing the four ingredients of the quotient rule first prevents mixing them up. u′u' is from Table 5.3; v′v' is Theorem 5 (2), valid since x>0x > 0⁠.
    Table 5.3; Theorem 5 (2), Section 5.4. Basics: derivative rules
  3. Apply the quotient rule

    For x>0x > 0⁠, x≠1x \ne 1 (so that v≠0v \ne 0⁠):

    dydx=u′v−uv′v2=(−sin⁡x)log⁡x−cos⁡x⋅1x(log⁡x)2.\begin{aligned} \frac{dy}{dx} &= \frac{u'v - uv'}{v^2} \\ &= \frac{(-\sin x)\log x - \cos x\cdot\frac{1}{x}}{(\log x)^2}. \end{aligned}
    "Bottom times derivative of top, minus top times derivative of bottom, over bottom squared." The bottom squared, (log⁡x)2(\log x)^2⁠, is positive at every point of the domain.
    Quotient rule, rule (3), Section 5.3. Basics: derivative rules
  4. Clear the small fraction

    Multiply the top and the bottom by xx (which is positive, so nothing changes):

    dydx=−xsin⁡x log⁡x+cos⁡xx(log⁡x)2.\frac{dy}{dx} = -\frac{x\sin x\,\log x + \cos x}{x(\log x)^2}.
    The numerator contained cos⁡xx\frac{\cos x}{x}⁠, a fraction inside a fraction. Multiplying top and bottom by the same non-zero number xx removes it. Both terms of the numerator were negative, so we take the minus sign out in front.
    Multiplying numerator and denominator by the same non-zero quantity leaves a fraction unchanged.
Result ddx(cos⁡xlog⁡x)=−xsin⁡x log⁡x+cos⁡xx(log⁡x)2,\frac{d}{dx}\left(\frac{\cos x}{\log x}\right) = -\frac{x\sin x\,\log x + \cos x}{x(\log x)^2},

valid for x>0x > 0⁠, x≠1x \ne 1⁠. (Textbook answer: −xsin⁡x⋅log⁡x+cos⁡xx(log⁡x)2-\dfrac{x\sin x\cdot\log x + \cos x}{x(\log x)^2}⁠, x>0x > 0⁠. The same formula. The key states x>0x > 0⁠; at x=1x = 1 neither the function nor the formula is defined, so x≠1x \ne 1 is needed as well.)

Check it with numbers

Take x=2x = 2⁠: sin⁡2≈0.9092974\sin 2 \approx 0.9092974⁠, cos⁡2≈−0.4161468\cos 2 \approx -0.4161468⁠, log⁡2≈0.6931472\log 2 \approx 0.6931472⁠. Then

xsin⁡x log⁡x=2(0.9092974)(0.6931472)≈1.2605539,numerator≈1.2605539−0.4161468=0.8444071,denominator=2(0.6931472)2≈0.9609060.\begin{aligned} x\sin x\,\log x &= 2(0.9092974)(0.6931472) \\ &\approx 1.2605539, \\ \text{numerator} &\approx 1.2605539 - 0.4161468 \\ &= 0.8444071, \\ \text{denominator} &= 2(0.6931472)^2 \\ &\approx 0.9609060. \end{aligned}

The formula gives −0.84440710.9609060≈−0.8787613-\frac{0.8444071}{0.9609060} \approx -0.8787613⁠. A difference quotient of cos⁡xlog⁡x\frac{\cos x}{\log x} with h=0.0001h = 0.0001 on each side of 22 gives −0.87876-0.87876⁠. They agree.

Common mistakes
  1. Forgetting x≠1x \ne 1⁠. "x>0x > 0" makes log⁡x\log x exist, but division by log⁡1=0\log 1 = 0 is still impossible.
  2. A sign slip in the numerator. u′v=−sin⁡xlog⁡xu'v = -\sin x\log x is already negative; subtracting uv′=cos⁡xxuv' = \frac{\cos x}{x} makes the second term negative too.
  3. Writing log⁡x2\log x^2 for (log⁡x)2(\log x)^2⁠. log⁡x2=2log⁡x\log x^2 = 2\log x⁠, a different quantity.
What to take away
  1. When log⁡x\log x is a denominator, the domain is x>0x > 0 and x≠1x \ne 1⁠.
  2. After the quotient rule, clear fractions inside the numerator by multiplying top and bottom by the same non-zero factor.

Every fact used, and where it comes from

FactUsed inSource
log⁡\log defined on R+\R^+⁠; log⁡x=0  ⟺  x=1\log x = 0 \iff x = 1Step 1Observations (1), (3), (4) on the log function, Section 5.4
ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin xStep 2Table 5.3, Section 5.3
ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x⁠, x>0x > 0Step 2Theorem 5 (2), Section 5.4 (Lesson: exponential and logarithmic functions)
Quotient ruleStep 3Rule (3), Section 5.3
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 →