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

Exercise 5.5 · Q14: dydx\frac{dy}{dx} if (cos⁡x)y=(cos⁡y)x(\cos x)^y=(\cos y)^x

Exercise 5.5Logarithmic differentiation · Section 5.5
The question

Find dydx\dfrac{dy}{dx} of the function given by

(cos⁡x)y=(cos⁡y)x.(\cos x)^y = (\cos y)^x.
Exam answer

Taking log on both sides (cos⁡x>0\cos x > 0⁠, cos⁡y>0\cos y > 0⁠),

ylog⁡cos⁡x=xlog⁡cos⁡yy\log\cos x = x\log\cos y

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

dydxlog⁡cos⁡x+y⋅−sin⁡xcos⁡x=log⁡cos⁡y+x⋅−sin⁡ycos⁡y dydx⇒dydxlog⁡cos⁡x−ytan⁡x=log⁡cos⁡y−xtan⁡y dydx⇒(log⁡cos⁡x+xtan⁡y)dydx=log⁡cos⁡y+ytan⁡x\begin{aligned} &\frac{dy}{dx}\log\cos x + y\cdot\frac{-\sin x}{\cos x} \\ &= \log\cos y + x\cdot\frac{-\sin y}{\cos y}\,\frac{dy}{dx} \\ &\Rightarrow \frac{dy}{dx}\log\cos x - y\tan x \\ &\quad = \log\cos y - x\tan y\,\frac{dy}{dx} \\ &\Rightarrow (\log\cos x + x\tan y)\frac{dy}{dx} \\ &\quad = \log\cos y + y\tan x \end{aligned}

∴ dydx=ytan⁡x+log⁡cos⁡yxtan⁡y+log⁡cos⁡x\therefore\ \dfrac{dy}{dx} = \dfrac{y\tan x + \log\cos y}{x\tan y + \log\cos x}

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

The one idea this problem is built on

Each side is a single power with a variable base and a variable exponent. Taking logs of both sides brings the exponents down: ylog⁡cos⁡x=xlog⁡cos⁡yy\log\cos x = x\log\cos y⁠. Then implicit differentiation, with the chain rule for log⁡cos⁡x\log\cos x and log⁡cos⁡y\log\cos y⁠, gives a linear equation for dydx\frac{dy}{dx}⁠. The logs need cos⁡x>0\cos x > 0 and cos⁡y>0\cos y > 0⁠.

Given, to find, and the plan
Given
(cos⁡x)y=(cos⁡y)x(\cos x)^y = (\cos y)^x⁠, with cos⁡x>0\cos x > 0⁠, cos⁡y>0\cos y > 0⁠, and yy a differentiable function of xx⁠.
To find
dydx\frac{dy}{dx}⁠, and where the formula holds.
Plan
(1) Take logs. (2) Differentiate both sides. (3) Collect the dydx\frac{dy}{dx} terms. (4) Solve, with the condition. (5) Test the formula on the simplest pieces of the relation.

Basics you need

1Logs of a power

log⁡pn=nlog⁡p\log p^n = n\log p for p>0p > 0 (Section 5.4). Bases of variable powers must be positive (Section 5.5). Basics: exponentials and logarithms

2Chain rule for log⁡cos⁡\log\cos

ddxlog⁡cos⁡x=1cos⁡x(−sin⁡x)=−tan⁡x\frac{d}{dx}\log\cos x = \frac{1}{\cos x}(-\sin x) = -\tan x⁠; and ddxlog⁡cos⁡y=−tan⁡y dydx\frac{d}{dx}\log\cos y = -\tan y\,\frac{dy}{dx}⁠, because yy depends on xx⁠. Basics: derivative rules

3Implicit differentiation

Differentiate both sides, then solve the linear equation for dydx\frac{dy}{dx} (Section 5.3.2). Basics: solving for dy/dx

Solution

  1. Take logarithms of both sides

    Where cos⁡x>0\cos x > 0 and cos⁡y>0\cos y > 0⁠, both sides are positive and

    ylog⁡cos⁡x=xlog⁡cos⁡y.y\log\cos x = x\log\cos y.
    log⁡(cos⁡x)y=ylog⁡cos⁡x\log(\cos x)^y = y\log\cos x and log⁡(cos⁡y)x=xlog⁡cos⁡y\log(\cos y)^x = x\log\cos y⁠. The book does not state the condition, but without cos⁡x>0\cos x > 0 and cos⁡y>0\cos y > 0 the powers with variable exponents (and their logs) are not defined.
    log⁡bpn=nlog⁡bp\log_b p^n = n\log_b p (Section 5.4); positivity requirement (Section 5.5). Basics: exponentials and logarithms
  2. Differentiate both sides with respect to xx

    Left side, product rule on y⋅log⁡cos⁡xy\cdot\log\cos x⁠:

    dydxlog⁡cos⁡x+y⋅−sin⁡xcos⁡x=dydxlog⁡cos⁡x−ytan⁡x.\begin{aligned} &\frac{dy}{dx}\log\cos x + y\cdot\frac{-\sin x}{\cos x} \\ &= \frac{dy}{dx}\log\cos x - y\tan x. \end{aligned}

    Right side, product rule on x⋅log⁡cos⁡yx\cdot\log\cos y⁠:

    log⁡cos⁡y+x⋅−sin⁡ycos⁡ydydx=log⁡cos⁡y−xtan⁡y dydx.\begin{aligned} &\log\cos y + x\cdot\frac{-\sin y}{\cos y}\frac{dy}{dx} \\ &= \log\cos y - x\tan y\,\frac{dy}{dx}. \end{aligned}

    So

    dydxlog⁡cos⁡x−ytan⁡x=log⁡cos⁡y−xtan⁡y dydx.\begin{aligned} &\frac{dy}{dx}\log\cos x - y\tan x \\ &= \log\cos y - x\tan y\,\frac{dy}{dx}. \end{aligned}
    log⁡cos⁡x\log\cos x is a composite: outer log⁡\log⁠, inner cos⁡x\cos x⁠, so its derivative is 1cos⁡x⋅(−sin⁡x)\frac{1}{\cos x}\cdot(-\sin x)⁠. For log⁡cos⁡y\log\cos y there are three layers: log⁡\log⁠, cos⁡\cos⁠, and yy itself, so the chain rule gives 1cos⁡y⋅(−sin⁡y)⋅dydx\frac{1}{\cos y}\cdot(-\sin y)\cdot\frac{dy}{dx}⁠.
    Chain rule (Theorem 4, Section 5.3.1); (cos⁡x)′=−sin⁡x(\cos x)' = -\sin x (Table 5.3); (log⁡x)′=1x(\log x)' = \frac1x (Theorem 5). Lesson: implicit differentiation
  3. Collect the dydx\frac{dy}{dx} terms

    (log⁡cos⁡x+xtan⁡y)dydx=log⁡cos⁡y+ytan⁡x.\left(\log\cos x + x\tan y\right)\frac{dy}{dx} = \log\cos y + y\tan x.
    Move −xtan⁡y dydx-x\tan y\,\frac{dy}{dx} to the left (it becomes ++⁠) and −ytan⁡x-y\tan x to the right (it becomes ++⁠).
    Rearranging a linear equation. Basics: solving for dy/dx
  4. Solve for dydx\frac{dy}{dx}⁠, with the condition

    dydx=ytan⁡x+log⁡cos⁡yxtan⁡y+log⁡cos⁡x,\frac{dy}{dx} = \frac{y\tan x + \log\cos y}{x\tan y + \log\cos x},

    where cos⁡x>0\cos x > 0⁠, cos⁡y>0\cos y > 0 and xtan⁡y+log⁡cos⁡x≠0x\tan y + \log\cos x \ne 0⁠.

    Dividing needs a non-zero divisor. Writing the terms in this order gives exactly the book's form.
    Division by a non-zero quantity. Basics: solving for dy/dx
  5. Test the formula on the simplest pieces of the relation

    • The line y=xy = x (with cos⁡x>0\cos x > 0⁠): (cos⁡x)x=(cos⁡x)x(\cos x)^x = (\cos x)^x holds. The formula gives xtan⁡x+log⁡cos⁡xxtan⁡x+log⁡cos⁡x=1\frac{x\tan x + \log\cos x}{x\tan x + \log\cos x} = 1 wherever this is not 00\frac00⁠, the slope of the line.
    • The axis y=0y = 0: (cos⁡x)0=1=1x(\cos x)^0 = 1 = 1^x holds. The formula gives 0+log⁡10+log⁡cos⁡x=0\frac{0 + \log 1}{0 + \log\cos x} = 0 wherever log⁡cos⁡x≠0\log\cos x \ne 0⁠, the slope of the axis.
    • The axis x=0x = 0: 1y=1=(cos⁡y)01^y = 1 = (\cos y)^0 holds. The denominator is 0+log⁡1=00 + \log 1 = 0⁠, so the formula gives nothing, and rightly so: this line is vertical and has no finite slope.
    These quick cases show that the formula behaves sensibly, including failing exactly where a vertical piece of the relation appears. The relation also has other pieces, away from these lines; the check below tests the formula at a point of one of them.
    The slope of a line y=mx+cy = mx + c is mm⁠; a vertical line has no slope. Basics: slope at a point
Result dydx=ytan⁡x+log⁡cos⁡yxtan⁡y+log⁡cos⁡x,\frac{dy}{dx} = \frac{y\tan x + \log\cos y}{x\tan y + \log\cos x},

valid where cos⁡x>0\cos x > 0⁠, cos⁡y>0\cos y > 0 and the denominator is not zero. (Textbook answer: the same expression.)

Check it with numbers

Take x=0.5x = 0.5 and look for yy between 2π2\pi and 2π+π22\pi + \frac{\pi}{2} (where cos⁡y>0\cos y > 0⁠) with ylog⁡cos⁡0.5=0.5log⁡cos⁡yy\log\cos 0.5 = 0.5\log\cos y⁠. Solving numerically gives y=7.7204427y = 7.7204427⁠, with cos⁡y=0.1331424\cos y = 0.1331424⁠. At this point:

  • numerator ytan⁡0.5+log⁡cos⁡y=2.2013608y\tan 0.5 + \log\cos y = 2.2013608⁠,
  • denominator 0.5tan⁡y+log⁡cos⁡0.5=3.59136000.5\tan y + \log\cos 0.5 = 3.5913600⁠,
  • so the formula gives dydx=0.6129602\frac{dy}{dx} = 0.6129602⁠.

Solving the relation for yy again at x=0.5±0.00001x = 0.5 \pm 0.00001 and dividing the change in yy by 0.000020.00002 gives 0.61296020.6129602⁠, the same.

Common mistakes
  1. Dropping the inner derivative: ddxlog⁡cos⁡x=−tan⁡x\frac{d}{dx}\log\cos x = -\tan x⁠, not 1cos⁡x\frac{1}{\cos x}⁠.
  2. Forgetting dydx\frac{dy}{dx} in ddxlog⁡cos⁡y=−tan⁡y dydx\frac{d}{dx}\log\cos y = -\tan y\,\frac{dy}{dx}⁠.
  3. Sign errors: both tan⁡\tan terms come with a minus sign before rearranging.
  4. Ignoring the conditions cos⁡x>0\cos x > 0⁠, cos⁡y>0\cos y > 0⁠.
What to take away
  1. Single power on each side: take logs of both sides, then differentiate implicitly.
  2. ddxlog⁡cos⁡u=−tan⁡u⋅dudx\frac{d}{dx}\log\cos u = -\tan u\cdot\frac{du}{dx}⁠.
  3. Testing a formula on the obvious solutions (here y=xy = x⁠, y=0y = 0⁠, x=0x = 0⁠) is a quick way to catch errors.

Every fact used, and where it comes from

FactUsed inSource
log⁡pn=nlog⁡p\log p^n = n\log pStep 1Section 5.4
Positivity requirement for logarithmic differentiationStep 1Section 5.5 (Lesson: logarithmic differentiation)
Product rule; chain ruleStep 2Section 5.3; Theorem 4, Section 5.3.1
(cos⁡x)′=−sin⁡x(\cos x)' = -\sin x⁠; (log⁡x)′=1x(\log x)' = \frac1xStep 2Table 5.3; Theorem 5, Section 5.4
Implicit differentiationSteps 2–4Section 5.3.2 (Lesson: implicit differentiation)
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 →