Chain, Implicit and Inverse Differentiation

Study Sheet

Chain, Implicit and Inverse Differentiation

The chain rule, implicit differentiation, inverse and inverse-trig derivatives, and logarithmic differentiation

The Chain Rule

Concept
The idea

If y=f(g(x))y=f(g(x)) is a composition (an “outside” function of an “inside” function), then

ddx f(g(x))=f′(g(x))⋅g′(x).\frac{d}{dx}\,f(g(x)) = f'(g(x))\cdot g'(x).

Differentiate the outside function, leaving the inside alone, then multiply by the derivative of the inside. In Leibniz notation with y=f(u)y=f(u) and u=g(x)u=g(x):

dydx=dydu⋅dudx.\dfrac{dy}{dx}=\dfrac{dy}{du}\cdot\dfrac{du}{dx}.

Rates multiply through a chain. If uu changes 33 times as fast as xx, and yy changes 55 times as fast as uu, then yy changes 1515 times as fast as xx. In symbols dydx=dydu⋅dudx\dfrac{dy}{dx}=\dfrac{dy}{du}\cdot\dfrac{du}{dx}: the outside derivative, evaluated at the inside, times the inside derivative.

Example
Basic composition: y=(3x2+1)5y=(3x^2+1)^5

Outside is u5u^5, inside is u=3x2+1u=3x^2+1.

dydx=5(3x2+1)4⋅ddx(3x2+1)=5(3x2+1)4⋅6x=30x (3x2+1)4.\begin{aligned} \frac{dy}{dx} &= 5(3x^2+1)^4\cdot\frac{d}{dx}(3x^2+1)\\ &= 5(3x^2+1)^4\cdot 6x = 30x\,(3x^2+1)^4. \end{aligned}
Side note
Where it goes wrong

Forgetting the inner derivative: ddxsin⁡(3x)=3cos⁡(3x)\tfrac{d}{dx}\sin(3x) = 3\cos(3x), not cos⁡(3x)\cos(3x). Every layer contributes a factor.

Example
Chain with a trig outside: y=sin⁡(x2+1 )y=\sin(\sqrt{x^2+1}\,)

Two layers: sin⁡( ⋅ )\sin(\,\cdot\,) around  ⋅ \sqrt{\,\cdot\,} around x2+1x^2+1.

dydx=cos⁡ ⁣(x2+1)⋅12x2+1⋅2x=xcos⁡ ⁣(x2+1)x2+1.\begin{aligned} \frac{dy}{dx} &= \cos\!\big(\sqrt{x^2+1}\big)\cdot\frac{1}{2\sqrt{x^2+1}}\cdot 2x\\[2pt] &= \frac{x\cos\!\big(\sqrt{x^2+1}\big)}{\sqrt{x^2+1}}. \end{aligned}
Tip

Tip: Work from the outermost layer inward and multiply a new factor for each layer. You are never “done” until you have taken the derivative of the innermost expression.

Combining the chain rule with product and quotient rules

Reminder — The differentiation rules:  (xn)′=nxn−1,(fg)′=f′g+fg′,(fg)′=f′g−fg′g2,(f(g(x)))′=f′(g(x))g′(x)(x^{n})'=nx^{n-1},\quad (fg)'=f'g+fg',\quad \left(\tfrac{f}{g}\right)'=\frac{f'g-fg'}{g^{2}},\quad \big(f(g(x))\big)'=f'(g(x))g'(x)
Concept
Mixing rules

Real problems layer rules together. Identify the top-level structure first (is it a product? a quotient? a composition?), apply that rule, and use the chain rule wherever a composition appears inside.

Example
Product ×\times chain: y=x2sin⁡(3x)y=x^2\sin(3x)

Top level is a product x2⋅sin⁡(3x)x^2\cdot\sin(3x).

dydx=(2x)sin⁡(3x)+x2⋅3cos⁡(3x)⏟chain=2xsin⁡(3x)+3x2cos⁡(3x).\begin{aligned} \frac{dy}{dx} &= (2x)\sin(3x) + x^2\cdot\underbrace{3\cos(3x)}_{\text{chain}}\\ &= 2x\sin(3x)+3x^2\cos(3x). \end{aligned}
Example
Quotient ×\times chain: y=e2xxy=\dfrac{e^{2x}}{x}
dydx=(2e2x)⋅x−e2x⋅1x2=e2x(2x−1)x2.\begin{aligned} \frac{dy}{dx} &= \frac{(2e^{2x})\cdot x - e^{2x}\cdot 1}{x^2} = \frac{e^{2x}(2x-1)}{x^2}. \end{aligned}
Try it
Quick check

Find dydx\dfrac{dy}{dx} if y=(2x+1)4y=(2x+1)^4.

Work it on paper before revealing the answer.

Show the answer

Answer: 8(2x+1)38(2x+1)^3

Implicit Differentiation

Concept
When yy is not solved for

When a curve is defined by an equation like x2+y2=25x^2+y^2=25 (you cannot easily write y=f(x)y=f(x)), treat yy as a function of xx and differentiate both sides with respect to xx. Every time you differentiate a yy, the chain rule forces an extra factor of dydx\dfrac{dy}{dx}. Then solve algebraically for dydx\dfrac{dy}{dx}.

Implicit differentiation is the chain rule in disguise. Treat yy as some unknown function of xx; then y2y^2 is a composition, and its derivative is 2y⋅dydx2y\cdot\frac{dy}{dx}. Every yy-term produces one factor of dydx\frac{dy}{dx}, so the differentiated equation is linear in dydx\frac{dy}{dx} and can always be solved for it.

Example
Circle: x2+y2=25x^2+y^2=25
(3, 4)
The tangent at (3,4)(3,4) has slope −34-\tfrac34, perpendicular to the radius of slope 43\tfrac43.

Differentiate both sides with respect to xx:

2x+2y dydx=0dydx=−xy.\begin{aligned} 2x + 2y\,\frac{dy}{dx} &= 0 \\ \frac{dy}{dx} &= -\frac{x}{y}. \end{aligned}

At the point (3,4)(3,4) the slope is −34-\tfrac34, so the tangent line is

y−4=−34 (x−3).y-4=-\tfrac34\,(x-3).
Example
Folium: x3+y3=6xyx^3+y^3=6xy

Differentiate; the right side needs the product rule.

3x2+3y2 dydx=6y+6x dydx3y2dydx−6xdydx=6y−3x2dydx=6y−3x23y2−6x=2y−x2y2−2x.\begin{aligned} 3x^2 + 3y^2\,\frac{dy}{dx} &= 6y + 6x\,\frac{dy}{dx}\\ 3y^2\frac{dy}{dx} - 6x\frac{dy}{dx} &= 6y - 3x^2\\ \frac{dy}{dx} &= \frac{6y-3x^2}{3y^2-6x}=\frac{2y-x^2}{y^2-2x}. \end{aligned}
Tip

Tip: A tangent line is horizontal where dydx=0\dfrac{dy}{dx}=0 (numerator =0=0) and vertical where dydx\dfrac{dy}{dx} is undefined (denominator =0=0).

Try it
Quick check

Find dydx\dfrac{dy}{dx} for x3+y3=9x^3+y^3=9, and its value at (1,2)(1,2).

Show the answer

Answer: dydx=−x2y2\dfrac{dy}{dx}=-\dfrac{x^2}{y^2}; at (1,2)(1,2) it is −14-\tfrac14. Differentiate: 3x2+3y2dydx=03x^2+3y^2\dfrac{dy}{dx}=0. The point is on the curve: 1+8=91+8=9.

Derivatives of Inverse Functions

Concept
The reciprocal-slope rule

If ff is one-to-one and differentiable, its inverse satisfies

(f−1)′(a)=1f′ ⁣(f−1(a)).(f^{-1})'(a)=\frac{1}{f'\!\big(f^{-1}(a)\big)}.

The slope of f−1f^{-1} at x=ax=a is the reciprocal of the slope of ff at the corresponding point f−1(a)f^{-1}(a). To use it: find the input bb with f(b)=af(b)=a (so f−1(a)=bf^{-1}(a)=b), then compute 1/f′(b)1/f'(b).

The graph of f−1f^{-1} is the graph of ff reflected in y=xy=x, and reflection swaps rise and run. A tangent line with slope ΔyΔx\frac{\Delta y}{\Delta x} at (a,b)(a,b) becomes a tangent with slope ΔxΔy\frac{\Delta x}{\Delta y} at (b,a)(b,a), which is why (f−1)′(b)=1f′(a)(f^{-1})'(b)=\dfrac{1}{f'(a)}.

Example
f(x)=x3+2x+1f(x)=x^3+2x+1, find (f−1)′(1)(f^{-1})'(1)
xy−112−112slope 2slope 1/2
Reflecting in y=xy=x sends (0,1)(0,1) to (1,0)(1,0) and turns a slope of 22 into 12\tfrac12.

First find bb with f(b)=1f(b)=1: testing b=0b=0 gives f(0)=1f(0)=1, so f−1(1)=0f^{-1}(1)=0. Then

f′(x)=3x2+2,f′(0)=2,f'(x)=3x^2+2,\qquad f'(0)=2,

so (f−1)′(1)=1f′(0)=12.(f^{-1})'(1)=\dfrac{1}{f'(0)}=\dfrac12.

Tip

Tip: You never need a formula for f−1f^{-1} itself. You only need one matched pair (b,a)(b,a) with f(b)=af(b)=a and the value f′(b)f'(b).

Try it
Quick check

For f(x)=x5+2x−1f(x)=x^5+2x-1, find (f−1)′(2)(f^{-1})'(2).

Show the answer

Answer: 17\dfrac17. First find the input: f(1)=1+2−1=2f(1)=1+2-1=2, so f−1(2)=1f^{-1}(2)=1. Then f′(x)=5x4+2f'(x)=5x^4+2 gives f′(1)=7f'(1)=7, and (f−1)′(2)=17(f^{-1})'(2)=\dfrac{1}{7}.

Derivatives of the Inverse Trig Functions

Concept
The six formulas
ddxarcsin⁡x=11−x2,ddxarccos⁡x=−11−x2,ddxarctan⁡x=11+x2,ddxarccot⁡x=−11+x2,ddxarcsec⁡x=1∣x∣x2−1,ddxarccsc⁡x=−1∣x∣x2−1.\begin{aligned} \frac{d}{dx}\arcsin x &= \frac{1}{\sqrt{1-x^2}}, & \frac{d}{dx}\arccos x &= -\frac{1}{\sqrt{1-x^2}},\\[3pt] \frac{d}{dx}\arctan x &= \frac{1}{1+x^2}, & \frac{d}{dx}\operatorname{arccot} x &= -\frac{1}{1+x^2},\\[3pt] \frac{d}{dx}\operatorname{arcsec} x &= \frac{1}{|x|\sqrt{x^2-1}}, & \frac{d}{dx}\operatorname{arccsc} x &= -\frac{1}{|x|\sqrt{x^2-1}}. \end{aligned}

The “co-” partners just carry a minus sign. Combine each with the chain rule for a composite argument.

Example
y=arctan⁡(x2)y=\arctan(x^2)

Argument u=x2u=x^2:

dydx=11+(x2)2⋅2x=2x1+x4.\frac{dy}{dx}=\frac{1}{1+(x^2)^2}\cdot 2x=\frac{2x}{1+x^4}.
Example
y=arcsin⁡(3x)y=\arcsin(3x)
dydx=11−(3x)2⋅3=31−9x2.\frac{dy}{dx}=\frac{1}{\sqrt{1-(3x)^2}}\cdot 3=\frac{3}{\sqrt{1-9x^2}}.
Tip

Tip: arcsin⁡\arcsin and arccos⁡\arccos share the radical 1−x2\sqrt{1-x^2}; arctan⁡\arctan and arccot⁡\operatorname{arccot} share 1+x21+x^2; the “sec/csc” pair share ∣x∣x2−1|x|\sqrt{x^2-1}.

Try it
Quick check

Differentiate (a) arctan⁡(3x)\arctan(3x) and (b) arcsin⁡(x2)\arcsin(x^2).

Show the answer

(a) 31+9x2\dfrac{3}{1+9x^2}. (b) 2x1−x4\dfrac{2x}{\sqrt{1-x^4}}. Each is the basic formula at the inside, times the inside's derivative.

Logarithmic Differentiation

Concept
Take a log first

For messy products, quotients, and powers—especially a variable base raised to a variable power like xxx^x—take the natural log of both sides, use log laws to break it apart, then differentiate implicitly:

ln⁡y=(simpler expression) ⟹ y′y=(⋯ ) ⟹ y′=y⋅(⋯ ).\ln y = (\text{simpler expression})\ \Longrightarrow\ \frac{y'}{y}=(\cdots)\ \Longrightarrow\ y'=y\cdot(\cdots).

Remember ln⁡(ab)=ln⁡a+ln⁡b\ln(ab)=\ln a+\ln b,  ln⁡ab=ln⁡a−ln⁡b\ \ln\frac{a}{b}=\ln a-\ln b,  ln⁡(ap)=pln⁡a\ \ln(a^p)=p\ln a.

Example
Product/quotient: y=x2x+1(2x−3)4y=\dfrac{x^2\sqrt{x+1}}{(2x-3)^4}
ln⁡y=2ln⁡x+12ln⁡(x+1)−4ln⁡(2x−3)y′y=2x+12(x+1)−82x−3y′=x2x+1(2x−3)4(2x+12(x+1)−82x−3).\begin{aligned} \ln y &= 2\ln x + \tfrac12\ln(x+1) - 4\ln(2x-3)\\ \frac{y'}{y} &= \frac{2}{x}+\frac{1}{2(x+1)}-\frac{8}{2x-3}\\ y' &= \frac{x^2\sqrt{x+1}}{(2x-3)^4}\left(\frac{2}{x}+\frac{1}{2(x+1)}-\frac{8}{2x-3}\right). \end{aligned}
Example
Variable base and exponent: y=xxy=x^x

The ordinary power rule and exponential rule both fail here—the base and exponent vary.

ln⁡y=xln⁡xy′y=1⋅ln⁡x+x⋅1x=ln⁡x+1y′=xx(ln⁡x+1).\begin{aligned} \ln y &= x\ln x\\ \frac{y'}{y} &= 1\cdot\ln x + x\cdot\frac1x = \ln x + 1\\ y' &= x^x(\ln x+1). \end{aligned}
Tip

Tip: Any expression of the form (function)(function)^{\text{(function)}} must be handled with logarithms (or by rewriting as e gln⁡fe^{\,g\ln f}). You cannot use the power rule when the exponent contains xx.

Try it
Quick check

Differentiate y=xxy=x^{\sqrt x} for x>0x>0.

Show the answer

Answer: y′=xx⋅ln⁡x+22xy'=x^{\sqrt x}\cdot\dfrac{\ln x+2}{2\sqrt x}. ln⁡y=xln⁡x\ln y=\sqrt x\ln x. Differentiate: y′y=ln⁡x2x+xx=ln⁡x+22x\dfrac{y'}{y}=\dfrac{\ln x}{2\sqrt x}+\dfrac{\sqrt x}{x}=\dfrac{\ln x+2}{2\sqrt x}.

Second Derivatives via Implicit Differentiation

Concept
Differentiate twice

To get d2ydx2\dfrac{d^2y}{dx^2} implicitly: first find dydx\dfrac{dy}{dx}, then differentiate that expression again with respect to xx (using the quotient/product/chain rules), and substitute your formula for dydx\dfrac{dy}{dx} wherever it appears. Finally simplify using the original equation.

Example
x2+y2=1x^2+y^2=1

From 2x+2yy′=02x+2yy'=0 we get y′=−xyy'=-\dfrac{x}{y}. Differentiate again with the quotient rule:

y′′=−(1) y−x y′y2=−y−x ⁣(−xy)y2=−y+x2yy2=−y2+x2y3=−1y3,\begin{aligned} y'' &= -\frac{(1)\,y - x\,y'}{y^2} = -\frac{y - x\!\left(-\dfrac{x}{y}\right)}{y^2}\\ &= -\frac{y + \dfrac{x^2}{y}}{y^2} = -\frac{y^2+x^2}{y^3} = -\frac{1}{y^3}, \end{aligned}

using x2+y2=1x^2+y^2=1 in the last step.

Tip

Tip: Your y′′y'' formula may legally contain y′y'; always substitute the earlier y′y' result so the final answer is in terms of xx and yy only.

Try it
Quick check

For y2=x3y^2=x^3 with y>0y>0, find y′y' and y′′y'' at (1,1)(1,1).

Show the answer

Answer: y′=32y'=\tfrac32, y′′=34y''=\tfrac34. 2yy′=3x22yy'=3x^2 gives y′=3x22y=32y'=\dfrac{3x^2}{2y}=\tfrac32 at (1,1)(1,1). Differentiate y′=3x22yy'=\dfrac{3x^2}{2y} by the quotient rule: y′′=6x⋅2y−3x2⋅2y′4y2=12−94=34y''=\dfrac{6x\cdot2y-3x^2\cdot2y'}{4y^2}=\dfrac{12-9}{4}=\tfrac34. (Check: y=x3/2y=x^{3/2} has y′′=34x−1/2y''=\tfrac34x^{-1/2}.)

Going Deeper: Advanced Techniques

Concept
1. Three-layer nested chain rule

For a triple composition, multiply one derivative factor per layer, outside to inside. For y=(tan⁡(3x2))4y=\big(\tan(3x^2)\big)^4:

dydx=4tan⁡3(3x2)⋅sec⁡2(3x2)⋅6x=24xtan⁡3(3x2)sec⁡2(3x2).\frac{dy}{dx}=4\tan^3(3x^2)\cdot\sec^2(3x^2)\cdot 6x=24x\tan^3(3x^2)\sec^2(3x^2).

And for y=sin⁡ ⁣(cos⁡(tan⁡x))y=\sin\!\big(\cos(\tan x)\big):

dydx=cos⁡ ⁣(cos⁡(tan⁡x))⋅(−sin⁡(tan⁡x))⋅sec⁡2x.\frac{dy}{dx}=\cos\!\big(\cos(\tan x)\big)\cdot\big(-\sin(\tan x)\big)\cdot\sec^2 x.
Example
2. Deriving an inverse-trig derivative

Let y=arctan⁡xy=\arctan x, so tan⁡y=x\tan y=x on (−π2,π2)\left(-\tfrac{\pi}{2},\tfrac{\pi}{2}\right). Differentiate implicitly:

sec⁡2y⋅dydx=1dydx=1sec⁡2y=11+tan⁡2y=11+x2.\begin{aligned} \sec^2 y\cdot\frac{dy}{dx} &= 1\\ \frac{dy}{dx} &= \frac{1}{\sec^2 y}=\frac{1}{1+\tan^2 y}=\frac{1}{1+x^2}. \end{aligned}

The same trick gives arcsin⁡\arcsin: from sin⁡y=x\sin y=x,  cos⁡y y′=1\ \cos y\,y'=1, so y′=1cos⁡y=11−x2y'=\dfrac{1}{\cos y}=\dfrac{1}{\sqrt{1-x^2}}.

Example
3. Implicit second derivative (harder)

For x2−y2=1x^2-y^2=1: differentiate to get 2x−2yy′=02x-2yy'=0, so y′=xyy'=\dfrac{x}{y}. Then

y′′=(1)y−x y′y2=y−x⋅xyy2=y2−x2y3=−1y3,\begin{aligned} y'' &= \frac{(1)y - x\,y'}{y^2}=\frac{y-x\cdot\dfrac{x}{y}}{y^2} = \frac{y^2-x^2}{y^3}=-\frac{1}{y^3}, \end{aligned}

since x2−y2=1⇒y2−x2=−1x^2-y^2=1\Rightarrow y^2-x^2=-1.

Example
4. Logarithmic differentiation of xsin⁡xx^{\sin x}

Variable base and variable exponent:

ln⁡y=sin⁡x ln⁡xy′y=cos⁡x ln⁡x+sin⁡x⋅1xy′=xsin⁡x ⁣(cos⁡x ln⁡x+sin⁡xx).\begin{aligned} \ln y &= \sin x\,\ln x\\ \frac{y'}{y} &= \cos x\,\ln x + \sin x\cdot\frac1x\\ y' &= x^{\sin x}\!\left(\cos x\,\ln x + \frac{\sin x}{x}\right). \end{aligned}
Concept
5. A related-rates preview

Implicit differentiation with respect to time tt is exactly the engine behind related rates. A sphere with V=43πr3V=\tfrac43\pi r^3 gives, differentiating both sides in tt,

dVdt=4πr2 drdt.\frac{dV}{dt}=4\pi r^2\,\frac{dr}{dt}.

Every quantity that changes gets its own “d(⋅)dt\dfrac{d(\cdot)}{dt}” factor by the chain rule—the same bookkeeping as putting dydx\dfrac{dy}{dx} on each yy.

Example
6. Inverse function derivative from a graph/pair

If f(2)=5f(2)=5 and f′(2)=13f'(2)=\tfrac13, then the point (2,5)(2,5) on ff becomes (5,2)(5,2) on f−1f^{-1}, and

(f−1)′(5)=1f′(2)=11/3=3.(f^{-1})'(5)=\frac{1}{f'(2)}=\frac{1}{1/3}=3.

Geometrically, reflecting the graph across y=xy=x reflects each tangent line, inverting its slope.

Concept
7. Generalized power rule and egln⁡fe^{g\ln f}

Any power with a constant exponent still uses the chain rule: ddx[g(x)]n=n[g(x)]n−1g′(x)\dfrac{d}{dx}[g(x)]^n=n[g(x)]^{n-1}g'(x). Any power with a variable exponent can be rewritten to avoid logarithmic differentiation:

f(x)g(x)=e g(x)ln⁡f(x),ddxfg=fg ⁣(g′ln⁡f+g⋅f′f).f(x)^{g(x)}=e^{\,g(x)\ln f(x)},\qquad \frac{d}{dx}f^{g}=f^{g}\!\left(g'\ln f + g\cdot\frac{f'}{f}\right).

This matches the log-differentiation result and is a useful check.

Example
8. Tangent-line practice on an implicit curve

For x2+xy+y2=7x^2+xy+y^2=7 find the tangent at (1,2)(1,2). Differentiating,

2x+y+xy′+2yy′=0 ⇒ y′=−2x+yx+2y.2x+y+xy'+2yy'=0\ \Rightarrow\ y'=-\frac{2x+y}{x+2y}.

At (1,2)(1,2): y′=−2+21+4=−45y'=-\dfrac{2+2}{1+4}=-\dfrac45, so the tangent line is y−2=−45(x−1)y-2=-\dfrac45(x-1).

Try it
Quick check

Differentiate y=sin⁡2 ⁣(e3x)y=\sin^2\!\left(e^{3x}\right).

Show the answer

Answer: y′=3e3xsin⁡ ⁣(2e3x)y'=3e^{3x}\sin\!\left(2e^{3x}\right). Three layers: square, sine, exponential. y′=2sin⁡(e3x)⋅cos⁡(e3x)⋅3e3xy'=2\sin(e^{3x})\cdot\cos(e^{3x})\cdot3e^{3x}, and 2sin⁡ucos⁡u=sin⁡2u2\sin u\cos u=\sin2u.

Why It Works

Chain rule intuition: if yy changes 33 times as fast as uu, and uu changes 22 times as fast as xx, then yy changes 66 times as fast as xx — rates multiply. Formally, ΔyΔx=ΔyΔu⋅ΔuΔx\tfrac{\Delta y}{\Delta x} = \tfrac{\Delta y}{\Delta u}\cdot\tfrac{\Delta u}{\Delta x} and both factors have limits. For an inverse, f(f−1(x))=xf(f^{-1}(x)) = x; differentiate both sides with the chain rule: f′(f−1(x))⋅(f−1)′(x)=1f'(f^{-1}(x))\cdot(f^{-1})'(x) = 1, so (f−1)′(x)=1f′(f−1(x))(f^{-1})'(x) = \tfrac{1}{f'(f^{-1}(x))}. With f=exf = e^x this gives ddxln⁡x=1eln⁡x=1x\tfrac{d}{dx}\ln x = \tfrac{1}{e^{\ln x}} = \tfrac1x.

Tip
Reading a proof

Do not read a proof the way you read a rule. Cover the last line, ask what the previous line forces, and only then uncover it. If a step feels like magic, that is the step to work by hand with a concrete number.

Formulas, Proofs & Tips

Tip
Implicit and inverse differentiation
ddx(yn)=ny n−1dydx,(f−1)′(b)=1f′(a)  where f(a)=b\frac{d}{dx}\big(y^{n}\big)=n y^{\,n-1}\frac{dy}{dx},\qquad \left(f^{-1}\right)'(b)=\frac{1}{f'(a)} \ \text{ where } f(a)=b

What it means. Differentiate yy terms with the chain rule, then solve for dydx\tfrac{dy}{dx}. An inverse's slope is the reciprocal.

Example. x2+y2=1x^2+y^2=1: differentiating, 2x+2yy′=02x+2yy'=0, so y′=−xyy'=-\tfrac{x}{y}.

Why it works. yy is a function of xx, so every yy term carries a dydx\tfrac{dy}{dx} factor. For inverses, differentiating f(f−1(x))=xf\big(f^{-1}(x)\big)=x gives f′(f−1(x))⋅(f−1)′(x)=1f'\big(f^{-1}(x)\big)\cdot\left(f^{-1}\right)'(x)=1.

Tip. Reflecting a graph across y=xy=x swaps rise and run, which is exactly why the slope inverts.