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

Exercise 5.5 · Q3: Differentiate (log⁡x)cos⁡x(\log x)^{\cos x}⁠, x>1x>1

Exercise 5.5Logarithmic differentiation · Section 5.5
The question

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

(log⁡x)cos⁡x(\log x)^{\cos x}
Exam answer

Let y=(log⁡x)cos⁡xy = (\log x)^{\cos x}⁠, where x>1x > 1⁠. Taking log on both sides,

log⁡y=cos⁡x⋅log⁡(log⁡x)\log y = \cos x\cdot\log(\log x)

Differentiating both sides w.r.t. xx⁠,

1y⋅dydx=−sin⁡x⋅log⁡(log⁡x)+cos⁡x⋅1log⁡x⋅1x\begin{aligned} \frac1y\cdot\frac{dy}{dx} &= -\sin x\cdot\log(\log x) \\ &\quad + \cos x\cdot\frac{1}{\log x}\cdot\frac1x \end{aligned}

Multiplying by yy⁠,

∴ dydx=(log⁡x)cos⁡x×[cos⁡xxlog⁡x−sin⁡xlog⁡(log⁡x)]\begin{aligned} \therefore\ \dfrac{dy}{dx} &= (\log x)^{\cos x} \\ &\quad\times\bigg[\dfrac{\cos x}{x\log x} \\ &\qquad - \sin x\log(\log x)\bigg] \end{aligned}

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

The one idea this problem is built on

Both the base log⁡x\log x and the exponent cos⁡x\cos x change with xx⁠, so neither the power rule nor the rule for axa^x applies. Taking logarithms brings the exponent down: log⁡y=cos⁡x⋅log⁡(log⁡x)\log y = \cos x\cdot\log(\log x)⁠, a product we can differentiate. The base must be positive for this (and for the power to make sense), which means log⁡x>0\log x > 0⁠, that is, x>1x > 1⁠.

Given, to find, and the plan
Given
y=(log⁡x)cos⁡xy = (\log x)^{\cos x}⁠.
To find
dydx\frac{dy}{dx}⁠, and where it holds.
Plan
(1) Find where the base is positive. (2) Take logs. (3) Differentiate: chain rule on the left, product rule and chain rule on the right. (4) Multiply by yy⁠.

Basics you need

1Variable powers need a positive base

For u>0u > 0⁠, uv=evlog⁡uu^v = e^{v\log u} (from u=elog⁡uu = e^{\log u}⁠, Example 25), so uv>0u^v > 0 and log⁡(uv)=vlog⁡u\log(u^v) = v\log u⁠. Basics: exponentials and logarithms

2Sign of log⁡x\log x

log⁡\log is increasing with log⁡1=0\log 1 = 0 (Section 5.4), so log⁡x>0\log x > 0 exactly when x>1x > 1⁠. Basics: exponentials and logarithms

3Product rule and chain rule

(uv)′=u′v+uv′(uv)' = u'v + uv' (Section 5.3); ddxlog⁡g(x)=g′(x)g(x)\frac{d}{dx}\log g(x) = \frac{g'(x)}{g(x)} for g(x)>0g(x) > 0 (Theorems 4 and 5). Basics: derivative rules

Solution

  1. Where is the function defined? (x>1x > 1⁠)

    Let y=(log⁡x)cos⁡xy = (\log x)^{\cos x}⁠. First, log⁡x\log x needs x>0x > 0⁠. For a power whose exponent varies, the base must be positive, so we also need log⁡x>0\log x > 0⁠, that is, x>1x > 1⁠. Then y=ecos⁡x log⁡(log⁡x)>0y = e^{\cos x\,\log(\log x)} > 0⁠.

    For 0<x<10 < x < 1 the base is negative: at x=12x = \frac12⁠, log⁡12≈−0.693\log\frac12 \approx -0.693 and cos⁡12≈0.878\cos\frac12 \approx 0.878⁠, and (−0.693)0.878(-0.693)^{0.878} is not a real number. At x=1x = 1 the base is 00 and log⁡0\log 0 does not exist. The book's condition for logarithmic differentiation, that u(x)u(x) and f(x)f(x) be positive, holds exactly for x>1x > 1⁠; the answer key does not state it.
    log⁡x>0  ⟺  x>1\log x > 0 \iff x > 1 (Basic 2). Basics: exponentials and logarithms
  2. Take logarithms

    For x>1x > 1⁠, by the power law for logs,

    log⁡y=cos⁡x⋅log⁡(log⁡x).\log y = \cos x\cdot\log(\log x).
    log⁡(uv)=vlog⁡u\log(u^v) = v\log u with u=log⁡x>0u = \log x > 0 and v=cos⁡xv = \cos x⁠. The exponent has come down as a factor, so the right side is a product of two functions of xx⁠.
    log⁡pn=nlog⁡p\log p^n = n\log p for p>0p > 0 and real nn (Section 5.4). Basics: exponentials and logarithms
  3. The derivative of log⁡(log⁡x)\log(\log x)

    Chain rule with outer function log⁡t\log t and inner function t=log⁡xt = \log x (positive for x>1x > 1⁠):

    ddxlog⁡(log⁡x)=1log⁡x⋅ddxlog⁡x=1xlog⁡x.\frac{d}{dx}\log(\log x) = \frac{1}{\log x}\cdot\frac{d}{dx}\log x = \frac{1}{x\log x}.
    Outer derivative: ddtlog⁡t=1t\frac{d}{dt}\log t = \frac1t⁠, evaluated at t=log⁡xt = \log x⁠. Inner derivative: ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x⁠. Their product is the chain rule.
    Chain rule (Theorem 4); ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x (Theorem 5). Lesson: the chain rule
  4. Differentiate both sides

    Left (chain rule, outer log⁡\log⁠, inner yy⁠): 1ydydx\frac1y\frac{dy}{dx}⁠. Right: product rule with u=cos⁡xu = \cos x (u′=−sin⁡xu' = -\sin x⁠) and v=log⁡(log⁡x)v = \log(\log x) (v′=1xlog⁡xv' = \frac{1}{x\log x}⁠, Step 3):

    1y⋅dydx=−sin⁡x⋅log⁡(log⁡x)+cos⁡x⋅1xlog⁡x.\begin{aligned} \frac1y\cdot\frac{dy}{dx} &= -\sin x\cdot\log(\log x) \\ &\quad + \cos x\cdot\frac{1}{x\log x}. \end{aligned}
    Both factors vary with xx⁠, so the product rule is needed: differentiate one factor at a time, keeping the other, and add.
    Product rule (Section 5.3); ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x (Table 5.3). Lesson: logarithmic differentiation
  5. Multiply by yy

    For x>1x > 1⁠,

    dydx=y[cos⁡xxlog⁡x−sin⁡xlog⁡(log⁡x)]=(log⁡x)cos⁡x×[cos⁡xxlog⁡x−sin⁡xlog⁡(log⁡x)].\begin{aligned} \frac{dy}{dx} &= y\left[\frac{\cos x}{x\log x} - \sin x\log(\log x)\right] \\ &= (\log x)^{\cos x} \\ &\quad\times\left[\frac{\cos x}{x\log x} - \sin x\log(\log x)\right]. \end{aligned}
    Multiplying by yy (positive) isolates dydx\frac{dy}{dx}⁠; then yy is replaced by its formula. The terms are reordered to match the textbook's answer.
    Rearranging: 1yY=R\frac1y Y = R with y≠0y \ne 0 gives Y=yRY = yR⁠. Basics: solving for dy/dx
Result

For x>1x > 1 (where the base log⁡x\log x is positive),

dydx= (log⁡x)cos⁡x×[cos⁡xxlog⁡x−sin⁡xlog⁡(log⁡x)].\begin{aligned} \frac{dy}{dx} = \ &(\log x)^{\cos x} \\ &\times\left[\frac{\cos x}{x\log x} - \sin x\log(\log x)\right]. \end{aligned}

(Textbook answer: the same; the key does not state x>1x > 1⁠.)

Check it with numbers

At x=ex = e⁠: log⁡e=1\log e = 1⁠, so y=1cos⁡e=1y = 1^{\cos e} = 1 and log⁡(log⁡e)=log⁡1=0\log(\log e) = \log 1 = 0⁠. The formula gives dydx=cos⁡ee\frac{dy}{dx} = \frac{\cos e}{e} =−0.91173392.7182818=−0.3354082= \frac{-0.9117339}{2.7182818} = -0.3354082⁠. The central difference quotient with h=0.0001h = 0.0001 gives −0.3354082-0.3354082⁠.

At x=3x = 3⁠: log⁡3=1.0986123\log 3 = 1.0986123⁠, cos⁡3=−0.9899925\cos 3 = -0.9899925⁠, sin⁡3=0.1411200\sin 3 = 0.1411200⁠, log⁡(log⁡3)=0.0940478\log(\log 3) = 0.0940478⁠, y=0.9110963y = 0.9110963⁠. The bracket is −0.3003767−0.0132720-0.3003767 - 0.0132720 =−0.3136487= -0.3136487⁠, so dydx=−0.2857642\frac{dy}{dx} = -0.2857642⁠; the difference quotient gives −0.2857642-0.2857642⁠.

Common mistakes
  1. Power rule: cos⁡x (log⁡x)cos⁡x−1\cos x\,(\log x)^{\cos x - 1} times 1x\frac1x treats the exponent as constant and misses the log⁡(log⁡x)\log(\log x) term.
  2. ddxlog⁡(log⁡x)=1log⁡x\frac{d}{dx}\log(\log x) = \frac{1}{\log x}: the inner derivative 1x\frac1x is missing.
  3. Sign of the sin⁡x\sin x term: it comes from ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x⁠.
  4. No domain: the function and the formula need x>1x > 1⁠.
What to take away
  1. For y=uvy = u^v with u>0u > 0⁠: log⁡y=vlog⁡u\log y = v\log u⁠, and dydx=uv[v′log⁡u+vuu′]\frac{dy}{dx} = u^v\left[v'\log u + \frac{v}{u}u'\right] (Section 5.5).
  2. Here u=log⁡xu = \log x⁠, v=cos⁡xv = \cos x⁠: v′log⁡u=−sin⁡xlog⁡(log⁡x)v'\log u = -\sin x\log(\log x) and vuu′=cos⁡xxlog⁡x\frac{v}{u}u' = \frac{\cos x}{x\log x}⁠.
  3. Always find where the base is positive first; here that is x>1x > 1⁠, not x>0x > 0⁠.

Every fact used, and where it comes from

FactUsed inSource
u(x)u(x) and f(x)f(x) must be positive in logarithmic differentiationStep 1Section 5.5 (Lesson: logarithmic differentiation)
x=elog⁡xx = e^{\log x} for x>0x > 0Step 1Example 25
log⁡\log is increasing, log⁡1=0\log 1 = 0⁠, domain R+\mathbf{R}^+Step 1Section 5.4
log⁡pn=nlog⁡p\log p^n = n\log pStep 2Section 5.4
ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x⁠; chain ruleSteps 3, 4Theorem 5, Section 5.4; Theorem 4, Section 5.3.1
Product rule; ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin xStep 4Algebra of derivatives (2), Section 5.3; Table 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 →