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

Exercise 5.5 · Q13: dydx\frac{dy}{dx} if yx=xyy^x=x^y

Exercise 5.5Logarithmic differentiation · Section 5.5
The question

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

yx=xy.y^x = x^y.
Exam answer

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

xlog⁡y=ylog⁡xx\log y = y\log x

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

log⁡y+xy dydx=dydxlog⁡x+yx⇒(xy−log⁡x)dydx=yx−log⁡y⇒dydx=yx−log⁡yxy−log⁡x =y2−xylog⁡yx2−xylog⁡x\begin{aligned} &\log y + \frac{x}{y}\,\frac{dy}{dx} = \frac{dy}{dx}\log x + \frac{y}{x} \\ &\Rightarrow \left(\frac{x}{y} - \log x\right)\frac{dy}{dx} = \frac{y}{x} - \log y \\ &\Rightarrow \frac{dy}{dx} = \frac{\frac{y}{x} - \log y}{\frac{x}{y} - \log x} \\ &\qquad\ = \frac{y^2 - xy\log y}{x^2 - xy\log x} \end{aligned}

(multiplying numerator and denominator by xyxy⁠)

∴ dydx=yx⋅y−xlog⁡yx−ylog⁡x\therefore\ \dfrac{dy}{dx} = \dfrac{y}{x}\cdot\dfrac{y - x\log y}{x - y\log x}

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

The one idea this problem is built on

Here each side is a single power, so taking logarithms of both sides is allowed and turns the equation into xlog⁡y=ylog⁡xx\log y = y\log x⁠, which has no awkward exponents. Then we differentiate implicitly and solve for dydx\frac{dy}{dx}⁠. The logs need x>0x > 0 and y>0y > 0⁠.

Given, to find, and the plan
Given
yx=xyy^x = x^y⁠, with x>0x > 0⁠, y>0y > 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 and simplify. (5) Find where the denominator vanishes on the curve. (6) Test the formula on the two pieces of the curve.

Basics you need

1Taking logs of an equation

If P=QP = Q with P,Q>0P, Q > 0⁠, then log⁡P=log⁡Q\log P = \log Q⁠; and log⁡pn=nlog⁡p\log p^n = n\log p for p>0p > 0 (Section 5.4). Basics: exponentials and logarithms

2Implicit differentiation

Differentiate both sides with respect to xx⁠, writing dydx\frac{dy}{dx} whenever yy is differentiated; solve for dydx\frac{dy}{dx} (Section 5.3.2). Basics: solving for dy/dx

3Product rule and chain rule

(fg)′=f′g+fg′(fg)' = f'g + fg'⁠; ddxlog⁡y=1ydydx\frac{d}{dx}\log y = \frac1y\frac{dy}{dx}⁠. Basics: derivative rules

Solution

  1. Take logarithms of both sides

    For x>0x > 0⁠, y>0y > 0 both sides are positive, so

    log⁡(yx)=log⁡(xy),that isxlog⁡y=ylog⁡x.\begin{gathered} \log(y^x) = \log(x^y), \\ \text{that is}\quad x\log y = y\log x. \end{gathered}
    Unlike Q12, there is no sum here: each side is one power, so the log of each side can be simplified with log⁡pn=nlog⁡p\log p^n = n\log p⁠. The exponents xx and yy come down as ordinary factors.
    log⁡bpn=nlog⁡bp\log_b p^n = n\log_b p for p>0p > 0 (Section 5.4). Basics: exponentials and logarithms
  2. Differentiate both sides with respect to xx

    Each side is a product; use the product rule, and the chain rule for log⁡y\log y⁠:

    log⁡y+x⋅1ydydx=dydxlog⁡x+y⋅1x.\log y + x\cdot\frac1y\frac{dy}{dx} = \frac{dy}{dx}\log x + y\cdot\frac1x.
    Left: xlog⁡yx\log y gives 1⋅log⁡y+x⋅(log⁡y)′1\cdot\log y + x\cdot(\log y)'⁠, and (log⁡y)′=1ydydx(\log y)' = \frac1y\frac{dy}{dx} because yy depends on xx⁠. Right: ylog⁡xy\log x gives dydx⋅log⁡x+y⋅1x\frac{dy}{dx}\cdot\log x + y\cdot\frac1x⁠.
    Product rule; chain rule; (log⁡x)′=1x(\log x)' = \frac1x (Theorem 5). Lesson: implicit differentiation
  3. Collect the dydx\frac{dy}{dx} terms

    (xy−log⁡x)dydx=yx−log⁡y.\left(\frac{x}{y} - \log x\right)\frac{dy}{dx} = \frac{y}{x} - \log y.
    Move dydxlog⁡x\frac{dy}{dx}\log x to the left and log⁡y\log y to the right, changing their signs. The equation is linear in dydx\frac{dy}{dx}⁠.
    Rearranging a linear equation. Basics: solving for dy/dx
  4. Solve and clear the small fractions

    Where xy−log⁡x≠0\frac{x}{y} - \log x \ne 0⁠,

    dydx=yx−log⁡yxy−log⁡x.\frac{dy}{dx} = \frac{\frac{y}{x} - \log y}{\frac{x}{y} - \log x}.

    Multiply numerator and denominator by xyxy (which is positive):

    dydx=y2−xylog⁡yx2−xylog⁡x=yx⋅y−xlog⁡yx−ylog⁡x.\begin{aligned} \frac{dy}{dx} &= \frac{y^2 - xy\log y}{x^2 - xy\log x} \\ &= \frac{y}{x}\cdot\frac{y - x\log y}{x - y\log x}. \end{aligned}
    xy⋅yx=y2xy\cdot\frac{y}{x} = y^2 and xy⋅xy=x2xy\cdot\frac{x}{y} = x^2⁠. Taking out yy from the top and xx from the bottom gives the book's form. The condition xy−log⁡x≠0\frac{x}{y} - \log x \ne 0 is the same as x−ylog⁡x≠0x - y\log x \ne 0⁠.
    Multiplying top and bottom by the same non-zero number leaves a fraction unchanged. Basics: solving for dy/dx
  5. Where on the curve is the denominator zero?

    Suppose x−ylog⁡x=0x - y\log x = 0 at a point of the curve, so ylog⁡x=xy\log x = x⁠. The curve gives xlog⁡y=ylog⁡x=xx\log y = y\log x = x⁠, so log⁡y=1\log y = 1 and y=ey = e⁠. Then elog⁡x=xe\log x = x⁠. Since x>0x > 0⁠, this needs log⁡x>0\log x > 0⁠, so x>1x > 1⁠, and it says xlog⁡x=e\frac{x}{\log x} = e⁠. The function xlog⁡x\frac{x}{\log x} has derivative log⁡x−1(log⁡x)2\frac{\log x - 1}{(\log x)^2}⁠, negative on (1,e)(1, e) and positive for x>ex > e⁠, so its smallest value on x>1x > 1 is e1=e\frac{e}{1} = e⁠, taken only at x=ex = e⁠. Hence the only such point is

    (x,y)=(e,e).(x, y) = (e, e).

    So the formula holds at every point of the curve except (e,e)(e, e)⁠, where it becomes 00\frac00⁠.

    This is sharper than "wherever the denominator is non-zero": we have found exactly where it fails. The point (e,e)(e, e) is where the two pieces of the curve cross (Step 6 and the figure), so no single slope can be expected there.
    Sign of the derivative shows where a function decreases and increases (Theorem 1, Section 6.3, in the later Chapter 6; applied on closed intervals inside (1,e](1, e] and [e,∞)[e, \infty)⁠). Basics: slope at a point
  6. The two pieces of the curve, and the formula on each

    The line y=xy = x⁠. Every point (x,x)(x, x)⁠, x>0x > 0⁠, satisfies xx=xxx^x = x^x⁠. There y−xlog⁡y=x−xlog⁡xy - x\log y = x - x\log x and x−ylog⁡x=x−xlog⁡xx - y\log x = x - x\log x⁠, so for x≠ex \ne e the formula gives xx⋅1=1\frac{x}{x}\cdot 1 = 1⁠, the slope of the line.

    The other piece. If y≠xy \ne x⁠, write y=txy = tx with t>0t > 0⁠, t≠1t \ne 1⁠. Then xlog⁡(tx)=txlog⁡xx\log(tx) = tx\log x gives log⁡t=(t−1)log⁡x\log t = (t - 1)\log x⁠, so

    x=t1t−1,y=ttt−1.x = t^{\frac{1}{t-1}}, \qquad y = t^{\frac{t}{t-1}}.

    For t=2t = 2 this is the point (2,4)(2, 4)⁠: indeed 42=24=164^2 = 2^4 = 16⁠. The formula gives

    dydx=42⋅4−2log⁡42−4log⁡2=4(1−log⁡2)1−2log⁡2=−3.1773989.\begin{aligned} \frac{dy}{dx} &= \frac{4}{2}\cdot\frac{4 - 2\log 4}{2 - 4\log 2} \\ &= \frac{4(1 - \log 2)}{1 - 2\log 2} = -3.1773989. \end{aligned}
    Dividing xlog⁡(tx)=txlog⁡xx\log(tx) = tx\log x by xx gives log⁡t+log⁡x=tlog⁡x\log t + \log x = t\log x⁠. For t=12t = \frac12 the same formulas give (4,2)(4, 2)⁠, the mirror image of (2,4)(2, 4) in the line y=xy = x⁠; there the formula gives −0.3147228-0.3147228⁠, the reciprocal of −3.1773989-3.1773989⁠, as reflection in y=xy = x requires. As t→1t \to 1 the second piece approaches (e,e)(e, e)⁠.
    log⁡(pq)=log⁡p+log⁡q\log(pq) = \log p + \log q (Section 5.4). Lesson: logarithmic differentiation
x y 1 2 4 5 6 1 2 4 5 6 e e (2, 4) (4, 2) y = x O
The set yx=xyy^x = x^y for x,y>0x, y > 0⁠: the line y=xy = x (blue) and a second curve (gold) through (2,4)(2, 4) and (4,2)(4, 2)⁠, which far out approaches the lines x=1x = 1 and y=1y = 1⁠. The two cross at (e,e)(e, e) (dashed guides), the one point where the formula gives 00\frac00⁠. Equal scales on both axes.
Result dydx=yx⋅y−xlog⁡yx−ylog⁡x,\frac{dy}{dx} = \frac{y}{x}\cdot\frac{y - x\log y}{x - y\log x},

for x,y>0x, y > 0 on the curve, at every point except (e,e)(e, e)⁠. (Textbook answer: yx(y−xlog⁡yx−ylog⁡x)\frac{y}{x}\left(\frac{y - x\log y}{x - y\log x}\right)⁠, the same.)

Check it with numbers

On the second piece, t=2t = 2 gives (2,4)(2, 4) and the formula gives −3.1773989-3.1773989⁠. Moving along the piece, the parameter values t=2±0.00001t = 2 \pm 0.00001 give points whose change in yy divided by their change in xx is −3.1773989-3.1773989⁠, the same.

At t=3t = 3⁠, that is x=3=1.7320508x = \sqrt3 = 1.7320508⁠, y=33=5.1961524y = 3\sqrt3 = 5.1961524⁠: formula −6.2604249-6.2604249⁠, difference quotient −6.2604249-6.2604249⁠.

On the line y=xy = x⁠, at (2,2)(2, 2)⁠: 22⋅2−2log⁡22−2log⁡2=1\frac{2}{2}\cdot\frac{2 - 2\log 2}{2 - 2\log 2} = 1⁠.

Common mistakes
  1. Using the power rule on yxy^x or xyx^y⁠: both base and exponent vary.
  2. Forgetting dydx\frac{dy}{dx} in (log⁡y)′=1ydydx(\log y)' = \frac1y\frac{dy}{dx} or in (ylog⁡x)′(y\log x)'⁠.
  3. Sign errors when collecting the dydx\frac{dy}{dx} terms.
  4. Assuming the curve is only y=xy = x⁠. There is a second piece, and the formula covers both.
  5. Leaving out the condition. The formula fails at (e,e)(e, e)⁠.
What to take away
  1. When each side of an equation is a single power, take logs of both sides first.
  2. Clearing small fractions (here, multiplying by xyxy⁠) gives the tidy textbook form.
  3. An implicit derivative can fail exactly where curves cross; find those points.

Every fact used, and where it comes from

FactUsed inSource
log⁡pn=nlog⁡p\log p^n = n\log p⁠; log⁡pq=log⁡p+log⁡q\log pq = \log p + \log qSteps 1, 6Section 5.4
Logarithmic differentiation (positive bases)Step 1Section 5.5 (Lesson: logarithmic differentiation)
Implicit differentiationSteps 2–4Section 5.3.2 (Lesson: implicit differentiation)
Product rule; chain rule; (log⁡x)′=1x(\log x)' = \frac1xSteps 2, 5Section 5.3; Theorem 4, Section 5.3.1; Theorem 5
Sign of the derivative and increasing/decreasingStep 5Theorem 1, Section 6.3, Chapter 6 (a later chapter; not proved in Chapter 5)
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 →