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

Exercise 5.5 · Q15: dydx\frac{dy}{dx} if xy=ex−yxy=e^{x-y}

Exercise 5.5Logarithmic differentiation · Section 5.5
The question

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

xy=e(x−y).xy = e^{(x-y)}.
Exam answer

Taking log on both sides (xy>0xy > 0⁠),

log⁡(xy)=x−y\log(xy) = x - y

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

1xy(y+xdydx)=1−dydx⇒y+xdydx=xy−xydydx⇒(x+xy)dydx=xy−y⇒x(1+y)dydx=y(x−1)\begin{aligned} &\frac{1}{xy}\left(y + x\frac{dy}{dx}\right) = 1 - \frac{dy}{dx} \\ &\Rightarrow y + x\frac{dy}{dx} = xy - xy\frac{dy}{dx} \\ &\Rightarrow (x + xy)\frac{dy}{dx} = xy - y \\ &\Rightarrow x(1 + y)\frac{dy}{dx} = y(x - 1) \end{aligned}

∴ dydx=y(x−1)x(y+1)\therefore\ \dfrac{dy}{dx} = \dfrac{y(x - 1)}{x(y + 1)} (y≠−1)(y \ne -1)

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

The one idea this problem is built on

The exponential ex−ye^{x-y} is awkward to differentiate implicitly, but its logarithm is simply x−yx - y⁠. Because ex−ye^{x-y} is always positive, xyxy is positive too, so we may take logs of both sides: log⁡(xy)=x−y\log(xy) = x - y⁠. Implicit differentiation then gives a linear equation for dydx\frac{dy}{dx}⁠.

Given, to find, and the plan
Given
xy=ex−yxy = e^{x-y}⁠, with yy a differentiable function of xx⁠.
To find
dydx\frac{dy}{dx}⁠, and where the formula holds.
Plan
(1) See which points can lie on the curve. (2) Take logs. (3) Differentiate both sides. (4) Clear fractions and collect. (5) Solve, and find where the formula fails. (6) Confirm by a route without logs.

Basics you need

1Exponentials and logs

et>0e^t > 0 for every real tt⁠, and log⁡(et)=t\log(e^t) = t (Section 5.4). Basics: exponentials and logarithms

2Derivative of the log of a function

For g>0g > 0⁠: ddxlog⁡g=g′g\frac{d}{dx}\log g = \frac{g'}{g} (Theorem 5 with the chain rule). Basics: derivative rules

3Implicit differentiation

Differentiate both sides with respect to xx⁠, then solve for dydx\frac{dy}{dx} (Section 5.3.2). Basics: solving for dy/dx

Solution

  1. Which points can lie on the curve?

    The right side ex−ye^{x-y} is positive for all x,yx, y⁠. So on the curve

    xy>0:xy > 0:

    xx and yy are both non-zero and have the same sign. The curve has a piece with x,y>0x, y > 0 (for example (1,1)(1, 1)⁠, since 1=e01 = e^0⁠) and a piece with x,y<0x, y < 0 (for example (−1,−1)(-1, -1)⁠, since 1=e01 = e^0⁠).

    This tells us the logarithm of xyxy always exists on the curve, even on the negative piece, where neither log⁡x\log x nor log⁡y\log y exists. It also tells us x≠0x \ne 0⁠, which we use when we divide later.
    et>0e^t > 0 for every real tt (range of the exponential function, Section 5.4). Basics: exponentials and logarithms
  2. Take logarithms of both sides

    Both sides are positive, so

    log⁡(xy)=log⁡ex−y=x−y.\log(xy) = \log e^{x-y} = x - y.
    The log undoes the exponential: log⁡et=t\log e^t = t⁠. We keep log⁡(xy)\log(xy) as the log of one positive number. On the positive piece one may write it as log⁡x+log⁡y\log x + \log y (that is what most solutions do), but on the negative piece that split is not allowed; keeping log⁡(xy)\log(xy) works on both pieces.
    log⁡et=t\log e^t = t (Section 5.4). Lesson: logarithmic differentiation
  3. Differentiate both sides with respect to xx

    Left: with g=xyg = xy⁠, the product rule gives g′=y+xdydxg' = y + x\frac{dy}{dx}⁠, so

    ddxlog⁡(xy)=y+xdydxxy.\frac{d}{dx}\log(xy) = \frac{y + x\frac{dy}{dx}}{xy}.

    Right: ddx(x−y)=1−dydx\frac{d}{dx}(x - y) = 1 - \frac{dy}{dx}⁠. Hence

    y+xdydxxy=1−dydx.\frac{y + x\frac{dy}{dx}}{xy} = 1 - \frac{dy}{dx}.
    log⁡(xy)\log(xy) is a composite: outer log⁡\log⁠, inner xyxy⁠. Its derivative is 1xy\frac{1}{xy} times the derivative of xyxy⁠, and xyxy is a product of xx and yy⁠, both depending on xx⁠.
    Chain rule (Theorem 4, Section 5.3.1); product rule (Section 5.3). Lesson: implicit differentiation
  4. Clear the fraction and collect the dydx\frac{dy}{dx} terms

    Multiply both sides by xyxy (non-zero):

    y+xdydx=xy−xydydx.y + x\frac{dy}{dx} = xy - xy\frac{dy}{dx}.

    Collect:

    (x+xy)dydx=xy−y,x(1+y)dydx=y(x−1).\begin{aligned} (x + xy)\frac{dy}{dx} &= xy - y, \\ x(1 + y)\frac{dy}{dx} &= y(x - 1). \end{aligned}
    Moving −xydydx-xy\frac{dy}{dx} to the left and yy to the right; then take out the common factors xx on the left and yy on the right.
    Rearranging a linear equation; factorising. Basics: solving for dy/dx
  5. Solve for dydx\frac{dy}{dx}⁠, and find where it fails

    dydx=y(x−1)x(y+1),\frac{dy}{dx} = \frac{y(x - 1)}{x(y + 1)},

    valid where x(y+1)≠0x(y + 1) \ne 0⁠. We know x≠0x \ne 0 on the curve, so the only problem is y=−1y = -1⁠. On the curve, y=−1y = -1 means −x=ex+1-x = e^{x+1}⁠. The function h(x)=−x−ex+1h(x) = -x - e^{x+1} has h′(x)=−1−ex+1<0h'(x) = -1 - e^{x+1} < 0⁠, so it is decreasing and has at most one zero; h(−1)=1−1=0h(-1) = 1 - 1 = 0⁠. So the only point of the curve with y=−1y = -1 is

    (−1,−1).(-1, -1).

    There Step 4 reads 0⋅dydx=−1⋅(−2)=20\cdot\frac{dy}{dx} = -1\cdot(-2) = 2⁠, which no number can satisfy: the curve has a vertical tangent at (−1,−1)(-1, -1) (see the figure).

    The formula holds at every point of the curve except (−1,−1)(-1, -1)⁠. Turning it upside down, dxdy=x(y+1)y(x−1)\frac{dx}{dy} = \frac{x(y+1)}{y(x-1)} is 00 at (−1,−1)(-1, -1)⁠, which is what a vertical tangent means. At (1,1)(1, 1) the formula gives 1⋅01⋅2=0\frac{1\cdot 0}{1\cdot 2} = 0⁠: a horizontal tangent. On the positive piece xx⁠, yy and y+1y + 1 are positive, so dydx\frac{dy}{dx} has the sign of x−1x - 1⁠: yy falls for x<1x < 1 and rises for x>1x > 1 (Theorem 1 of Chapter 6 again), which makes (1,1)(1, 1) the lowest point of that piece.
    A function with negative derivative is decreasing (Theorem 1, Section 6.3, in the later Chapter 6); division needs a non-zero divisor. Basics: slope at a point
  6. A second route, without logs

    Differentiate xy=ex−yxy = e^{x-y} directly. Left: product rule, y+xdydxy + x\frac{dy}{dx}⁠. Right: chain rule with inner function x−yx - y⁠:

    y+xdydx=ex−y(1−dydx).y + x\frac{dy}{dx} = e^{x-y}\left(1 - \frac{dy}{dx}\right).

    Replace ex−ye^{x-y} by xyxy (they are equal on the curve):

    y+xdydx=xy−xydydx,y + x\frac{dy}{dx} = xy - xy\frac{dy}{dx},

    which is exactly the equation of Step 4. So both routes give the same dydx\frac{dy}{dx}⁠.

    This confirms the answer, and shows what the logs did: they turned ex−ye^{x-y} into x−yx - y before differentiating, instead of replacing it by xyxy afterwards.
    ddxeu=eududx\frac{d}{dx}e^{u} = e^{u}\frac{du}{dx} (Theorem 5 with the chain rule). Basics: exponentials and logarithms
x y −4 −2 2 4 −4 −2 2 4 (1, 1) (−1, −1) O
The curve xy=ex−yxy = e^{x-y} (blue). The positive piece has its lowest point at (1,1)(1, 1)⁠, where dydx=0\frac{dy}{dx} = 0⁠. The negative piece exists only for x≤−1x \le -1⁠; its upper and lower parts meet at (−1,−1)(-1, -1)⁠, where the tangent (dashed) is vertical and the formula fails. The gold dot is the check point (2,1.159)(2, 1.159)⁠. Equal scales on both axes.
Result dydx=y(x−1)x(y+1),\frac{dy}{dx} = \frac{y(x - 1)}{x(y + 1)},

at every point of the curve except (−1,−1)(-1, -1)⁠, where the tangent is vertical. (Textbook answer: y(x−1)x(y+1)\frac{y(x-1)}{x(y+1)}⁠, the same.)

Check it with numbers

At x=2x = 2⁠, solving 2y=e2−y2y = e^{2-y} numerically gives y=1.1591585y = 1.1591585 (check: 2y=2.31831702y = 2.3183170 and e0.8408415=2.3183170e^{0.8408415} = 2.3183170⁠). The formula gives

dydx=1.1591585×12×2.1591585=0.2684283.\frac{dy}{dx} = \frac{1.1591585\times 1}{2\times 2.1591585} = 0.2684283.

Solving for yy at x=2±0.00001x = 2 \pm 0.00001 and dividing the change by 0.000020.00002 gives 0.26842830.2684283⁠.

On the negative piece at x=−2x = -2 there are two points: y=−0.0727758y = -0.0727758 with slope −0.1177318-0.1177318⁠, and y=−4.1054666y = -4.1054666 with slope 1.98301921.9830192⁠. The difference quotients give the same two values.

Common mistakes
  1. Writing log⁡x+log⁡y\log x + \log y without noticing that it needs x,y>0x, y > 0⁠; on the negative piece use log⁡(xy)\log(xy)⁠.
  2. Forgetting the inner derivative 1−dydx1 - \frac{dy}{dx} of x−yx - y in the direct route.
  3. Dropping dydx\frac{dy}{dx} from the product rule: (xy)′=y+xdydx(xy)' = y + x\frac{dy}{dx}⁠.
  4. Not stating where the formula fails: y=−1y = -1⁠, which happens only at (−1,−1)(-1, -1)⁠.
What to take away
  1. Logs turn esomethinge^{\text{something}} into "something", which simplifies implicit differentiation.
  2. Before taking logs, check positivity: here xy=ex−y>0xy = e^{x-y} > 0 automatically.
  3. Where the coefficient of dydx\frac{dy}{dx} vanishes, look for a vertical tangent.

Every fact used, and where it comes from

FactUsed inSource
et>0e^t > 0⁠; log⁡et=t\log e^t = tSteps 1, 2Section 5.4
Logarithmic differentiation (positive quantities only)Step 2Section 5.5 (Lesson: logarithmic differentiation)
(log⁡x)′=1x(\log x)' = \frac1x⁠; (ex)′=ex(e^x)' = e^xSteps 3, 6Theorem 5, Section 5.4
Product rule; chain ruleSteps 3, 6Section 5.3; Theorem 4, Section 5.3.1
Implicit differentiationSteps 3–6Section 5.3.2 (Lesson: implicit differentiation)
Negative derivative means 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 →