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

ddxf(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=dydududx.\dfrac{dy}{dx}=\dfrac{dy}{du}\cdot\dfrac{du}{dx}.
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)4ddx(3x2+1)=5(3x2+1)46x=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}
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+12x=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)=nxn1,(fg)=fg+fg,(fg)=fgfgg2,(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 x2sin(3x)x^2\cdot\sin(3x).

dydx=(2x)sin(3x)+x23cos(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)xe2x1x2=e2x(2x1)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}

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}.

Example
Circle: x2+y2=25x^2+y^2=25

Differentiate both sides with respect to xx:

2x+2ydydx=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

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

Differentiate; the right side needs the product rule.

3x2+3y2dydx=6y+6xdydx3y2dydx6xdydx=6y3x2dydx=6y3x23y26x=2yx2y22x.\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).

Derivatives of Inverse Functions

Concept
The reciprocal-slope rule

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

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

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

Example
f(x)=x3+2x+1f(x)=x^3+2x+1, find (f1)(1)(f^{-1})'(1)

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

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

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

Tip

Tip: You never need a formula for f1f^{-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).

Derivatives of the Inverse Trig Functions

Concept
The six formulas
ddxarcsinx=11x2,ddxarccosx=11x2,ddxarctanx=11+x2,ddxarccotx=11+x2,ddxarcsecx=1xx21,ddxarccscx=1xx21.\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)22x=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)23=319x2.\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 1x2\sqrt{1-x^2}; arctan\arctan and arccot\operatorname{arccot} share 1+x21+x^2; the “sec/csc” pair share xx21|x|\sqrt{x^2-1}.

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:

lny=(simpler expression)  yy=()  y=y().\ln y = (\text{simpler expression})\ \Longrightarrow\ \frac{y'}{y}=(\cdots)\ \Longrightarrow\ y'=y\cdot(\cdots).

Remember ln(ab)=lna+lnb\ln(ab)=\ln a+\ln b,  lnab=lnalnb\ \ln\frac{a}{b}=\ln a-\ln b,  ln(ap)=plna\ \ln(a^p)=p\ln a.

Example
Product/quotient: y=x2x+1(2x3)4y=\dfrac{x^2\sqrt{x+1}}{(2x-3)^4}
lny=2lnx+12ln(x+1)4ln(2x3)yy=2x+12(x+1)82x3y=x2x+1(2x3)4(2x+12(x+1)82x3).\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.

lny=xlnxyy=1lnx+x1x=lnx+1y=xx(lnx+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 eglnfe^{\,g\ln f}). You cannot use the power rule when the exponent contains xx.

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)yxyy2=yx ⁣(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 yy'' formula may legally contain yy'; always substitute the earlier yy' result so the final answer is in terms of xx and yy only.

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=4tan3(3x2)sec2(3x2)6x=24xtan3(3x2)sec2(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(tanx))y=\sin\!\big(\cos(\tan x)\big):

dydx=cos ⁣(cos(tanx))(sin(tanx))sec2x.\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=arctanxy=\arctan x, so tany=x\tan y=x on (π2,π2)\left(-\tfrac{\pi}{2},\tfrac{\pi}{2}\right). Differentiate implicitly:

sec2ydydx=1dydx=1sec2y=11+tan2y=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 siny=x\sin y=x,  cosyy=1\ \cos y\,y'=1, so y=1cosy=11x2y'=\dfrac{1}{\cos y}=\dfrac{1}{\sqrt{1-x^2}}.

Example
3. Implicit second derivative (harder)

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

y=(1)yxyy2=yxxyy2=y2x2y3=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 x2y2=1y2x2=1x^2-y^2=1\Rightarrow y^2-x^2=-1.

Example
4. Logarithmic differentiation of xsinxx^{\sin x}

Variable base and variable exponent:

lny=sinxlnxyy=cosxlnx+sinx1xy=xsinx ⁣(cosxlnx+sinxx).\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πr2drdt.\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 f1f^{-1}, and

(f1)(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 eglnfe^{g\ln f}

Any power with a constant exponent still uses the chain rule: ddx[g(x)]n=n[g(x)]n1g(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)=eg(x)lnf(x),ddxfg=fg ⁣(glnf+gff).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 y2=45(x1)y-2=-\dfrac45(x-1).

Formulas, Proofs & Tips

Tip
Implicit and inverse differentiation
ddx(yn)=nyn1dydx,(f1)(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(f1(x))=xf\big(f^{-1}(x)\big)=x gives f(f1(x))(f1)(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.