Navigation

Concept Review

Differential Calculus

The Chain Rule

Almost every function that appears outside a textbook is built by composition — 1+x2\sqrt{1+x^2}, et2/2e^{-t^2/2}, sin(2πft)\sin(2\pi f t) — and none of the rules so far can differentiate a single one of them. The chain rule is the one tool that handles composition, and once you add it to the sum, product and quotient rules you can differentiate every elementary function you are able to write down. It is also the rule that is misapplied most often, and almost always in exactly one way: by forgetting the derivative of the inside.

Statement of the rule

Theorem (Chain Rule). Suppose gg is differentiable at aa, and ff is differentiable at the point g(a)g(a). Then the composite F=fgF=f\circ g, defined by F(x)=f(g(x))F(x)=f(g(x)), is differentiable at aa and

F(a)=f(g(a))g(a).F'(a)=f'\big(g(a)\big)\cdot g'(a).

Read the hypotheses carefully. The outer function ff must be differentiable at g(a)g(a) — the output of the inner function — not at aa. It is not enough for ff to be differentiable at aa, and it is not enough for the composite to be defined. The last row of the "Common mistakes" table below, and the "Restriction" column of the templates table, show what goes wrong when this hypothesis fails: for instance f(u)=uf(u)=\sqrt u with g(x)=x2g(x)=x^2 at a=0a=0, where gg is differentiable, g(0)=0g(0)=0, and u\sqrt u is not differentiable at u=0u=0 — and indeed x2=x\sqrt{x^2}=|x| has no derivative at 00.

Leibniz notation. Introduce an intermediate variable: let u=g(x)u=g(x) and y=f(u)y=f(u). If uu is differentiable at xx and yy is differentiable at uu, then

dydx=dydududx,\frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dx},

where dydu\dfrac{dy}{du} is evaluated at u=g(x)u=g(x). That last clause carries all the content of "f(g(a))f'(g(a))" and is exactly what Leibniz notation hides.

Working form. For any differentiable u=u(x)u=u(x),

ddx[f(u)]=f(u)dudx\frac{d}{dx}\big[f(u)\big]=f'(u)\cdot\frac{du}{dx}

— derivative of the outside, inside left untouched, times the derivative of the inside.

Why "cancelling dudu" is a mnemonic, not a proof

The tempting argument ΔyΔx=ΔyΔuΔuΔx\dfrac{\Delta y}{\Delta x}=\dfrac{\Delta y}{\Delta u}\cdot\dfrac{\Delta u}{\Delta x} needs Δu=g(x)g(a)0\Delta u=g(x)-g(a)\ne 0, and Δu\Delta u can vanish at points arbitrarily close to aa (take g(x)=x2sin(1/x)g(x)=x^2\sin(1/x), g(0)=0g(0)=0). The repair: because ff is differentiable at b=g(a)b=g(a), define

φ(u)={f(u)f(b)ub,ubf(b),u=b\varphi(u)=\begin{cases}\dfrac{f(u)-f(b)}{u-b}, & u\ne b\\ f'(b), & u=b\end{cases}

Then φ\varphi is continuous at bb and f(u)f(b)=φ(u)(ub)f(u)-f(b)=\varphi(u)(u-b) for every uu, including u=bu=b. So for xax\ne a,

f(g(x))f(g(a))xa=φ(g(x))g(x)g(a)xa,\frac{f(g(x))-f(g(a))}{x-a}=\varphi\big(g(x)\big)\cdot\frac{g(x)-g(a)}{x-a},

an identity that survives g(x)=g(a)g(x)=g(a). Since gg is differentiable at aa it is continuous there, so g(x)bg(x)\to b and φ(g(x))φ(b)=f(g(a))\varphi(g(x))\to\varphi(b)=f'(g(a)), while the second factor tends to g(a)g'(a). That is the theorem.

Identifying the inner and the outer function

Ask: if I evaluated this at x=2x=2 on a calculator, which key would I press last? That last operation is the outer function; everything pressed before it is the inner function.

ExpressionInner uuOuterDerivative
(3x2+1)5(3x^2+1)^53x2+13x^2+1u5u^55(3x2+1)46x5(3x^2+1)^4\cdot 6x
sin(x3)\sin(x^3)x3x^3sinu\sin u3x2cos(x3)3x^2\cos(x^3)
sin3x=(sinx)3\sin^3 x=(\sin x)^3sinx\sin xu3u^33sin2xcosx3\sin^2x\cos x
e5xe^{-5x}5x-5xeue^u5e5x-5e^{-5x}
4x2\sqrt{4-x^2}4x24-x^2u\sqrt ux4x2\dfrac{-x}{\sqrt{4-x^2}}
ln(x2+1)\ln(x^2+1)x2+1x^2+1lnu\ln u2xx2+1\dfrac{2x}{x^2+1}

Rows 2 and 3 are the point of the exercise: sin(x3)\sin(x^3) and sin3x\sin^3x are different functions and the roles of inner and outer are swapped.

Standard templates

Throughout, u=u(x)u=u(x) is differentiable and u=dudxu'=\dfrac{du}{dx}.

FunctionDerivativeRestriction
unu^nnun1unu^{n-1}u'nn a negative integer: need u0u\ne 0; nn not an integer: need u>0u>0
u\sqrt{u}u2u\dfrac{u'}{2\sqrt u}u>0u>0 (not differentiable where u=0u=0)
1u\dfrac{1}{u}uu2-\dfrac{u'}{u^{2}}u0u\ne 0
eue^{u}euue^{u}u'
aua^{u}au(lna)ua^{u}(\ln a)\,u'a>0a>0
lnu\ln uuu\dfrac{u'}{u}u>0u>0
logau\log_a uuulna\dfrac{u'}{u\ln a}u>0u>0, a>0a>0, a1a\ne 1
sinu\sin u(cosu)u(\cos u)\,u'
cosu\cos u(sinu)u-(\sin u)\,u'
tanu\tan u(sec2u)u(\sec^2 u)\,u'uπ2+kπu\ne\frac{\pi}{2}+k\pi
secu\sec u(secutanu)u(\sec u\tan u)\,u'uπ2+kπu\ne\frac{\pi}{2}+k\pi
cotu\cot u(csc2u)u-(\csc^2 u)\,u'ukπu\ne k\pi
cscu\csc u(cscucotu)u-(\csc u\cot u)\,u'ukπu\ne k\pi
f(ax+b)f(ax+b)af(ax+b)a\,f'(ax+b)the workhorse special case

Worked example 1 — plain composition

Differentiate f(x)=(3x2+1)5f(x)=(3x^2+1)^5 and find f(1)f'(1).

Outer: fifth power. Inner: u=3x2+1u=3x^2+1, so u=6xu'=6x.

f(x)=5u4u=5(3x2+1)46x=30x(3x2+1)4.\begin{aligned} f'(x) &= 5u^{4}\cdot u' \\ &= 5(3x^2+1)^4\cdot 6x \\ &= 30x(3x^2+1)^4 . \end{aligned}

At x=1x=1: 3(1)2+1=43(1)^2+1=4 and 44=2564^4=256, so f(1)=30(1)(256)=7680f'(1)=30(1)(256)=7680.

Check. Expanding the fifth power is impractical, so use a centred difference with h=0.001h=0.001: f(1.001)1031.707f(1.001)\approx 1031.707, f(0.999)1016.347f(0.999)\approx 1016.347, and 1031.7071016.3470.0027680\dfrac{1031.707-1016.347}{0.002}\approx 7680. Agreed.

Worked example 2 — product rule and chain rule together

Differentiate y=x214xy=x^2\sqrt{1-4x}. (Defined for x14x\le\frac14; differentiable for x<14x<\frac14, since u\sqrt{u} fails to be differentiable at u=0u=0.)

The outermost operation is a product, so the product rule fires first; the chain rule is then needed inside it.

y=(x2)14x+x2(14x)=2x14x+x24214x=2x14x2x214x=2x(14x)2x214x=2x8x22x214x=2x(15x)14x.\begin{aligned} y' &= (x^2)'\sqrt{1-4x}+x^2\left(\sqrt{1-4x}\right)' \\ &= 2x\sqrt{1-4x}+x^2\cdot\frac{-4}{2\sqrt{1-4x}} \\ &= 2x\sqrt{1-4x}-\frac{2x^2}{\sqrt{1-4x}} \\ &= \frac{2x(1-4x)-2x^2}{\sqrt{1-4x}} \\ &= \frac{2x-8x^2-2x^2}{\sqrt{1-4x}}=\frac{2x(1-5x)}{\sqrt{1-4x}} . \end{aligned}

Check at x=2x=-2. Final formula: 2(2)(15(2))9=(4)(11)3=443\dfrac{2(-2)\big(1-5(-2)\big)}{\sqrt{9}}=\dfrac{(-4)(11)}{3}=-\dfrac{44}{3}. Third line, computed independently: 2(2)(3)2(4)3=1283=4432(-2)(3)-\dfrac{2(4)}{3}=-12-\dfrac{8}{3}=-\dfrac{44}{3}. The two match.

Repeated (nested) application

For three layers, (fgh)(x)=f(g(h(x)))g(h(x))h(x)(f\circ g\circ h)'(x)=f'\big(g(h(x))\big)\cdot g'\big(h(x)\big)\cdot h'(x), or in Leibniz form dydx=dydududvdvdx\dfrac{dy}{dx}=\dfrac{dy}{du}\cdot\dfrac{du}{dv}\cdot\dfrac{dv}{dx}. Peel from the outside in; every layer contributes exactly one factor, and you stop when what remains inside is xx itself.

Take y=sin3(4x)y=\sin^3(4x) — three layers: cube, sine, 4x4x.

y=3[sin(4x)]2ddxsin(4x)=3sin2(4x)cos(4x)ddx(4x)=3sin2(4x)cos(4x)4=12sin2(4x)cos(4x).\begin{aligned} y' &= 3\big[\sin(4x)\big]^{2}\cdot\frac{d}{dx}\sin(4x) \\ &= 3\sin^2(4x)\cdot\cos(4x)\cdot\frac{d}{dx}(4x) \\ &= 3\sin^2(4x)\cos(4x)\cdot 4 \\ &= 12\sin^2(4x)\cos(4x). \end{aligned}

At x=π12x=\frac{\pi}{12} we have 4x=π34x=\frac{\pi}{3}, sinπ3=32\sin\frac{\pi}{3}=\frac{\sqrt3}{2}, cosπ3=12\cos\frac{\pi}{3}=\frac12, so y=123412=92y'=12\cdot\frac34\cdot\frac12=\frac92. A centred difference at x=π12x=\frac{\pi}{12} with h=0.001h=0.001 gives 4.499924.49992, confirming 92\frac92.

Which rule fires first

Look at the outermost operation of the whole expression:

Outermost operationRule that fires first
sum or differencesum rule, then treat each term separately
product of two non-constant factorsproduct rule
a fractionquotient rule, or rewrite as a product with a negative power
a function applied to somethingchain rule

So (3x1x+2)4\left(\dfrac{3x-1}{x+2}\right)^4 is a fourth power on the outside: chain rule first, quotient rule inside. But (3x1)4x+2\dfrac{(3x-1)^4}{x+2} is a fraction on the outside: quotient rule first, chain rule inside.

Common mistakes

WrongRightWhat went missing
ddx(5x+1)4=4(5x+1)3\frac{d}{dx}(5x+1)^4=4(5x+1)^320(5x+1)320(5x+1)^3the inner derivative u=5u'=5
ddxsin(3x)=cos(3x)\frac{d}{dx}\sin(3x)=\cos(3x)3cos(3x)3\cos(3x)the inner derivative u=3u'=3
ddxex2=ex2\frac{d}{dx}e^{x^2}=e^{x^2}2xex22x\,e^{x^2}the inner derivative u=2xu'=2x
ddxx2+1=12x2+1\frac{d}{dx}\sqrt{x^2+1}=\dfrac{1}{2\sqrt{x^2+1}}xx2+1\dfrac{x}{\sqrt{x^2+1}}the inner derivative u=2xu'=2x
ddxln(3x)=13x\frac{d}{dx}\ln(3x)=\dfrac{1}{3x}33x=1x\dfrac{3}{3x}=\dfrac{1}{x}the inner derivative u=3u'=3
ddxsin(x2)=2xcosx\frac{d}{dx}\sin(x^2)=2x\cos x2xcos(x2)2x\cos(x^2)the outer derivative must be evaluated at u=x2u=x^2, not at xx
ddxf(g(x))=f(g(x))\frac{d}{dx}f(g(x))=f'(g'(x))f(g(x))g(x)f'(g(x))\,g'(x)ff' is evaluated at g(x)g(x) and multiplied by g(x)g'(x)
ddx(x2+1)3=3(x2+1)2+2x\frac{d}{dx}(x^2+1)^3=3(x^2+1)^2+2x3(x2+1)2(2x)3(x^2+1)^2(2x)the chain rule multiplies; it never adds
ddxe5x=5xe5x1\frac{d}{dx}e^{5x}=5x\,e^{5x-1}5e5x5e^{5x}the power rule does not apply to a variable exponent
ddxcos2x=sin2x\frac{d}{dx}\cos^2x=-\sin^2x2cosxsinx=sin(2x)-2\cos x\sin x=-\sin(2x)cos2x\cos^2x means (cosx)2(\cos x)^2; the outer function is the square
ddx[xsin(2x)]=sin(2x)+xcos(2x)\frac{d}{dx}\big[x\sin(2x)\big]=\sin(2x)+x\cos(2x)sin(2x)+2xcos(2x)\sin(2x)+2x\cos(2x)chain rule inside the product rule
stopping at dydu\frac{dy}{du}multiply by dudx\frac{du}{dx}, then substitute u=g(x)u=g(x)the answer must be a function of xx
ddx(x21)1/2=xx21\frac{d}{dx}(x^2-1)^{1/2}=\dfrac{x}{\sqrt{x^2-1}} for every xxonly for x>1x>1 or x<1x<-1a non-integer power needs a positive base

One structural error deserves its own line, because it is the single most common: the missing inner derivative. Whenever your answer to ddxf(u)\frac{d}{dx}f(u) contains no factor of uu' at all, and uu is not simply xx, you have made it.

Key terms

  • composite function
  • chain rule
  • inner function
  • outer function
  • intermediate variable
  • Leibniz notation
  • general power rule
  • nested composition
  • outermost operation
  • missing inner derivative
  • product rule
  • quotient rule
  • differentiability at a point
  • Caratheodory factorisation
  • domain restriction
  • horizontal tangent

Practice Problems

Differentiate f(x)=(4x+7)10f(x)=(4x+7)^{10} and evaluate f(1)f'(-1).

Show hint

The outermost operation is "raise to the tenth power". Whatever sits inside the bracket must contribute its own derivative as a separate factor.

Show answer

Set u=4x+7u=4x+7, so that f=u10f=u^{10} and dudx=4\dfrac{du}{dx}=4.

f(x)=10u9dudx=10(4x+7)94=40(4x+7)9.\begin{aligned} f'(x) &= 10u^{9}\cdot\frac{du}{dx} \\ &= 10(4x+7)^{9}\cdot 4 \\ &= 40(4x+7)^{9}. \end{aligned}

This is the workhorse special case ddxf(ax+b)=af(ax+b)\dfrac{d}{dx}f(ax+b)=a\,f'(ax+b) with a=4a=4: the constant 44 simply multiplies through.

Now evaluate at x=1x=-1. The inside is 4(1)+7=34(-1)+7=3, and

39=333333=272727=19683,3^{9}=3^{3}\cdot 3^{3}\cdot 3^{3}=27\cdot 27\cdot 27=19683,

so

f(1)=4019683=787320.f'(-1)=40\cdot 19683=787320.

Check. 4019683=4196830=78732040\cdot 19683 = 4\cdot 196830 = 787320, and 39=196833^9=19683 can be re-derived as 3633=72927=196833^6\cdot 3^3=729\cdot 27=19683. Both agree.

Answer: f(x)=40(4x+7)9f'(x)=40(4x+7)^{9} and f(1)=787320f'(-1)=787320.

For each function, name the inner function uu and the outer function, then differentiate.

(a) y=sin(5x2)y=\sin(5x^2) (b) y=e4xy=e^{-4x} (c) y=7x+2y=\sqrt{7x+2} (d) y=cos4xy=\cos^4 x

Show hint

For (d), rewrite cos4x\cos^4x as (cosx)4(\cos x)^4 before deciding what is on the outside — it is not the same function as cos(x4)\cos(x^4).

Show answer

(a) Inner u=5x2u=5x^2 with u=10xu'=10x; outer sinu\sin u.

y=cos(5x2)10x=10xcos(5x2).y'=\cos(5x^2)\cdot 10x=10x\cos(5x^2).

(b) Inner u=4xu=-4x with u=4u'=-4; outer eue^{u}.

y=e4x(4)=4e4x.y'=e^{-4x}\cdot(-4)=-4e^{-4x}.

(c) Inner u=7x+2u=7x+2 with u=7u'=7; outer u\sqrt{u}.

y=127x+27=727x+2.y'=\frac{1}{2\sqrt{7x+2}}\cdot 7=\frac{7}{2\sqrt{7x+2}} .

Valid for x>27x>-\frac{2}{7} only: the function itself needs 7x+207x+2\ge 0, i.e. x27x\ge-\frac{2}{7}, and the outer function u\sqrt{u} is not differentiable at u=0u=0. At the left endpoint x=27x=-\frac{2}{7} the graph begins with a one-sided vertical tangent, since 727x+2+\dfrac{7}{2\sqrt{7x+2}}\to+\infty as x(27)+x\to\left(-\frac{2}{7}\right)^{+}.

(d) Here cos4x=(cosx)4\cos^4x=(\cos x)^4, so the inner function is u=cosxu=\cos x with u=sinxu'=-\sin x, and the outer function is u4u^4.

y=4cos3x(sinx)=4sinxcos3x.y'=4\cos^{3}x\cdot(-\sin x)=-4\sin x\cos^{3}x .

Check of (d) two ways. Directly at x=π4x=\frac{\pi}{4}, where sinπ4=cosπ4=22\sin\frac{\pi}{4}=\cos\frac{\pi}{4}=\frac{\sqrt2}{2}:

y ⁣(π4)=422(22)3=422228=428=1.y'\!\left(\frac{\pi}{4}\right)=-4\cdot\frac{\sqrt2}{2}\cdot\left(\frac{\sqrt2}{2}\right)^{3}=-4\cdot\frac{\sqrt2}{2}\cdot\frac{2\sqrt2}{8}=-4\cdot\frac{2}{8}=-1 .

Independently, use the identity cos2x=1+cos2x2\cos^2x=\frac{1+\cos 2x}{2}, so y=(1+cos2x2)2y=\left(\frac{1+\cos2x}{2}\right)^{2} and

y=21+cos2x22sin2x2=(1+cos2x)sin2x.y'=2\cdot\frac{1+\cos2x}{2}\cdot\frac{-2\sin 2x}{2}=-(1+\cos 2x)\sin 2x .

At x=π4x=\frac{\pi}{4} this is (1+0)(1)=1-(1+0)(1)=-1, the same value. (In general 1+cos2x=2cos2x1+\cos2x=2\cos^2x and sin2x=2sinxcosx\sin2x=2\sin x\cos x, so the two expressions are identical.)

Answers: (a) 10xcos(5x2)10x\cos(5x^2) (b) 4e4x-4e^{-4x} (c) 727x+2\dfrac{7}{2\sqrt{7x+2}} for x>27x>-\frac{2}{7} (d) 4sinxcos3x-4\sin x\cos^{3}x.

Let y=1(x2+3x)5y=\dfrac{1}{(x^2+3x)^{5}}. Find dydx\dfrac{dy}{dx}, state where the formula is valid, and evaluate the derivative at x=1x=1.

Show hint

A reciprocal is a negative power. Rewriting it that way turns a quotient-rule problem into a one-line chain-rule problem.

Show answer

Rewrite as a power: y=(x2+3x)5y=(x^2+3x)^{-5}. The inner function is u=x2+3xu=x^2+3x with u=2x+3u'=2x+3; the outer function is u5u^{-5}.

dydx=5u6u=5(x2+3x)6(2x+3)=5(2x+3)(x2+3x)6.\begin{aligned} \frac{dy}{dx} &= -5u^{-6}\cdot u' \\ &= -5(x^2+3x)^{-6}(2x+3) \\ &= \frac{-5(2x+3)}{(x^2+3x)^{6}} . \end{aligned}

Validity: we need x2+3x=x(x+3)0x^2+3x=x(x+3)\ne 0, so the formula holds for all xx except x=0x=0 and x=3x=-3 (where yy itself is undefined).

Evaluate at x=1x=1: the inside is 1+3=41+3=4, and 46=40964^{6}=4096, while 2(1)+3=52(1)+3=5. Hence

dydxx=1=5(5)4096=2540960.006104.\left.\frac{dy}{dx}\right|_{x=1}=\frac{-5(5)}{4096}=-\frac{25}{4096}\approx -0.006104 .

Check by a second method (quotient rule). Write y=1vy=\dfrac{1}{v} with v=(x2+3x)5v=(x^2+3x)^{5}, so v=5(x2+3x)4(2x+3)v'=5(x^2+3x)^{4}(2x+3) by the chain rule. Then

y=0v1vv2=5(x2+3x)4(2x+3)(x2+3x)10=5(2x+3)(x2+3x)6,y'=\frac{0\cdot v-1\cdot v'}{v^{2}}=\frac{-5(x^2+3x)^{4}(2x+3)}{(x^2+3x)^{10}}=\frac{-5(2x+3)}{(x^2+3x)^{6}},

the same expression. A centred difference with h=0.001h=0.001 at x=1x=1 also gives 0.006104\approx -0.006104.

Answer: dydx=5(2x+3)(x2+3x)6\dfrac{dy}{dx}=\dfrac{-5(2x+3)}{(x^2+3x)^{6}} for x0,3x\ne 0,-3, and the value at x=1x=1 is 254096-\dfrac{25}{4096}.

Let h(x)=x32x+1h(x)=x^{3}\sqrt{2x+1}. Find h(x)h'(x) as a single fraction, state where it is valid, and compute h(4)h'(4).

Show hint

The outermost operation of the whole expression is a product, so decide which rule fires first before you touch the square root.

Show answer

Domain. We need 2x+102x+1\ge 0, i.e. x12x\ge-\frac12. Since u\sqrt{u} is not differentiable at u=0u=0, hh is differentiable on x>12x>-\frac12 (at x=12x=-\frac12 there is a one-sided vertical tangent).

Set up. The outermost operation is a product, so use the product rule with u=x3u=x^{3} and v=2x+1v=\sqrt{2x+1}. Then u=3x2u'=3x^{2}, and the chain rule gives

v=122x+1ddx(2x+1)=222x+1=12x+1.v'=\frac{1}{2\sqrt{2x+1}}\cdot\frac{d}{dx}(2x+1)=\frac{2}{2\sqrt{2x+1}}=\frac{1}{\sqrt{2x+1}} .

Differentiate and combine.

h(x)=3x22x+1+x312x+1=3x2(2x+1)2x+1+x32x+1=6x3+3x2+x32x+1=7x3+3x22x+1=x2(7x+3)2x+1.\begin{aligned} h'(x) &= 3x^{2}\sqrt{2x+1}+x^{3}\cdot\frac{1}{\sqrt{2x+1}} \\ &= \frac{3x^{2}(2x+1)}{\sqrt{2x+1}}+\frac{x^{3}}{\sqrt{2x+1}} \\ &= \frac{6x^{3}+3x^{2}+x^{3}}{\sqrt{2x+1}} \\ &= \frac{7x^{3}+3x^{2}}{\sqrt{2x+1}}=\frac{x^{2}(7x+3)}{\sqrt{2x+1}} . \end{aligned}

(The first step uses 2x+1=2x+12x+1\sqrt{2x+1}=\dfrac{2x+1}{\sqrt{2x+1}} to put both terms over the same denominator.)

Evaluate at x=4x=4. Here 2(4)+1=92(4)+1=9 and 9=3\sqrt9=3, so

h(4)=16(74+3)3=16313=4963165.33.h'(4)=\frac{16\,(7\cdot 4+3)}{3}=\frac{16\cdot 31}{3}=\frac{496}{3}\approx 165.33 .

Check from the unsimplified line. 3(4)29+439=3(16)(3)+643=144+643=432+643=49633(4)^{2}\sqrt{9}+\dfrac{4^{3}}{\sqrt9}=3(16)(3)+\dfrac{64}{3}=144+\dfrac{64}{3}=\dfrac{432+64}{3}=\dfrac{496}{3}. The two routes agree.

Answer: h(x)=x2(7x+3)2x+1h'(x)=\dfrac{x^{2}(7x+3)}{\sqrt{2x+1}} for x>12x>-\frac12, and h(4)=4963h'(4)=\dfrac{496}{3}.

Let y=sin(2x)x2+1y=\dfrac{\sin(2x)}{x^{2}+1}. Find yy' and evaluate y(0)y'(0).

Show hint

The whole expression is a fraction, so the quotient rule fires first — but the numerator still needs the chain rule on the way.

Show answer

Set up. Quotient rule (uv)=uvuvv2\left(\dfrac{u}{v}\right)'=\dfrac{u'v-uv'}{v^{2}} with u=sin(2x)u=\sin(2x) and v=x2+1v=x^{2}+1. Note v=x2+11>0v=x^2+1\ge 1>0 for every real xx, so there is no domain restriction.

The numerator needs the chain rule (inner 2x2x, inner derivative 22):

u=cos(2x)2=2cos(2x),v=2x.u'=\cos(2x)\cdot 2=2\cos(2x),\qquad v'=2x .

Apply the quotient rule.

y=2cos(2x)(x2+1)sin(2x)(2x)(x2+1)2=2(x2+1)cos(2x)2xsin(2x)(x2+1)2.\begin{aligned} y' &= \frac{2\cos(2x)\,(x^{2}+1)-\sin(2x)\,(2x)}{(x^{2}+1)^{2}} \\ &= \frac{2(x^{2}+1)\cos(2x)-2x\sin(2x)}{(x^{2}+1)^{2}} . \end{aligned}

Evaluate at x=0x=0. With cos0=1\cos 0=1 and sin0=0\sin 0=0,

y(0)=2(0+1)(1)2(0)(0)(0+1)2=21=2.y'(0)=\frac{2(0+1)(1)-2(0)(0)}{(0+1)^{2}}=\frac{2}{1}=2 .

Check. For small xx, sin(2x)2x\sin(2x)\approx 2x and 1x2+11\dfrac{1}{x^{2}+1}\approx 1, so y2xy\approx 2x near the origin; a curve behaving like 2x2x has slope 22 at x=0x=0. A centred difference with h=0.001h=0.001 gives 1.9999971.999997, consistent with 22.

Answer: y=2(x2+1)cos(2x)2xsin(2x)(x2+1)2y'=\dfrac{2(x^{2}+1)\cos(2x)-2x\sin(2x)}{(x^{2}+1)^{2}} and y(0)=2y'(0)=2.

Let y=ex2+1y=e^{\sqrt{x^{2}+1}}. Find dydx\dfrac{dy}{dx}, and give the exact value of y(3)y'(\sqrt3).

Show hint

There are three layers here. Start at the outermost operation — the exponential — and work inwards, picking up one factor per layer.

Show answer

Layers. Outermost: e(    )e^{(\;\cdot\;)}. Middle:     \sqrt{\;\cdot\;}. Innermost: x2+1x^{2}+1.

dydx=ex2+1ddxx2+1=ex2+112x2+1ddx(x2+1)=ex2+112x2+12x=xex2+1x2+1.\begin{aligned} \frac{dy}{dx} &= e^{\sqrt{x^{2}+1}}\cdot\frac{d}{dx}\sqrt{x^{2}+1} \\ &= e^{\sqrt{x^{2}+1}}\cdot\frac{1}{2\sqrt{x^{2}+1}}\cdot\frac{d}{dx}\big(x^{2}+1\big) \\ &= e^{\sqrt{x^{2}+1}}\cdot\frac{1}{2\sqrt{x^{2}+1}}\cdot 2x \\ &= \frac{x\,e^{\sqrt{x^{2}+1}}}{\sqrt{x^{2}+1}} . \end{aligned}

Validity. Since x2+11>0x^{2}+1\ge 1>0, the middle square root is never being differentiated at 00, and the exponential is differentiable everywhere. So the formula holds for every real xx — no restrictions.

Evaluate at x=3x=\sqrt3. Then x2+1=3+1=4x^{2}+1=3+1=4 and 4=2\sqrt4=2, so

y(3)=3e221.732051×7.389056212.7982226.3991.y'(\sqrt3)=\frac{\sqrt3\,e^{2}}{2}\approx\frac{1.732051\times 7.389056}{2}\approx\frac{12.79822}{2}\approx 6.3991 .

Checks. (i) A centred difference with h=0.001h=0.001 gives

y(3+0.001)y(30.001)0.0027.3954587.3826600.0026.39911,\frac{y(\sqrt3+0.001)-y(\sqrt3-0.001)}{0.002}\approx\frac{7.395458-7.382660}{0.002}\approx 6.39911,

matching 32e2\frac{\sqrt3}{2}e^{2}. (ii) Structurally, yy is an even function of xx, so its derivative must be odd and must vanish at x=0x=0 — and the formula does give y(0)=0y'(0)=0.

Answer: dydx=xex2+1x2+1\dfrac{dy}{dx}=\dfrac{x\,e^{\sqrt{x^{2}+1}}}{\sqrt{x^{2}+1}}, and y(3)=32e26.3991y'(\sqrt3)=\dfrac{\sqrt3}{2}e^{2}\approx 6.3991.

Let y=1+tan(2x)y=\sqrt{1+\tan(2x)}. Find yy', state precisely where the formula is valid, and evaluate y ⁣(π8)y'\!\left(\frac{\pi}{8}\right) exactly.

Show hint

Three nested layers again — root, then the tangent expression, then 2x2x. This time the domain deserves a full sentence of its own.

Show answer

Layers. Outermost:     \sqrt{\;\cdot\;}. Middle: 1+tan(    )1+\tan(\;\cdot\;). Innermost: 2x2x.

y=121+tan(2x)ddx(1+tan(2x))=121+tan(2x)sec2(2x)ddx(2x)=121+tan(2x)sec2(2x)2=sec2(2x)1+tan(2x).\begin{aligned} y' &= \frac{1}{2\sqrt{1+\tan(2x)}}\cdot\frac{d}{dx}\big(1+\tan(2x)\big) \\ &= \frac{1}{2\sqrt{1+\tan(2x)}}\cdot\sec^{2}(2x)\cdot\frac{d}{dx}(2x) \\ &= \frac{1}{2\sqrt{1+\tan(2x)}}\cdot\sec^{2}(2x)\cdot 2 \\ &= \frac{\sec^{2}(2x)}{\sqrt{1+\tan(2x)}} . \end{aligned}

Validity. The function itself is defined where cos(2x)0\cos(2x)\ne0 and 1+tan(2x)01+\tan(2x)\ge 0. For the derivative formula there are two separate conditions, one per layer:

  • tan(2x)\tan(2x) must exist and be differentiable, so cos(2x)0\cos(2x)\ne 0, i.e. 2xπ2+kπ2x\ne\frac{\pi}{2}+k\pi, i.e. xπ4+kπ2x\ne\frac{\pi}{4}+\frac{k\pi}{2} for integers kk.
  • The outer u\sqrt{u} must be differentiable at u=1+tan(2x)u=1+\tan(2x), which requires 1+tan(2x)>01+\tan(2x)>0 strictly.

At a point where 1+tan(2x)=01+\tan(2x)=0 — that is, 2x=π4+kπ2x=-\frac{\pi}{4}+k\pi, so x=π8+kπ2x=-\frac{\pi}{8}+\frac{k\pi}{2} — the function is defined and equals 00, but the formula fails. Because tan\tan is increasing, 1+tan(2x)<01+\tan(2x)<0 just to the left of such a point, so the function is not even defined there: the point is a left endpoint of a piece of the domain, and the graph starts with a one-sided vertical tangent (sec2(2x)20\sec^{2}(2x)\to 2\ne0 while 1+tan(2x)0+\sqrt{1+\tan(2x)}\to 0^{+}, so y+y'\to+\infty).

Evaluate at x=π8x=\frac{\pi}{8}. Then 2x=π42x=\frac{\pi}{4}, where tanπ4=1\tan\frac{\pi}{4}=1 and cosπ4=22\cos\frac{\pi}{4}=\frac{\sqrt2}{2}, so

sec2 ⁣(π4)=1cos2(π/4)=11/2=2.\sec^{2}\!\left(\frac{\pi}{4}\right)=\frac{1}{\cos^{2}(\pi/4)}=\frac{1}{1/2}=2 .

Therefore

y ⁣(π8)=21+1=22=21.41421.y'\!\left(\frac{\pi}{8}\right)=\frac{2}{\sqrt{1+1}}=\frac{2}{\sqrt2}=\sqrt2\approx 1.41421 .

Check. A centred difference with h=0.001h=0.001: y ⁣(π8+h)1.41562990y\!\left(\frac{\pi}{8}+h\right)\approx 1.41562990 and y ⁣(π8h)1.41280146y\!\left(\frac{\pi}{8}-h\right)\approx 1.41280146, so the slope is about 0.002828440.0021.41422\frac{0.00282844}{0.002}\approx 1.41422. Compare 21.41421\sqrt2\approx 1.41421: the two agree to four decimal places, the residual gap being the usual O(h2)O(h^{2}) error of a centred difference.

Answer: y=sec2(2x)1+tan(2x)y'=\dfrac{\sec^{2}(2x)}{\sqrt{1+\tan(2x)}} wherever cos(2x)0\cos(2x)\ne 0 and 1+tan(2x)>01+\tan(2x)>0; and y ⁣(π8)=2y'\!\left(\frac{\pi}{8}\right)=\sqrt2.

The table gives values of two differentiable functions ff and gg together with their derivatives.

xxf(x)f(x)f(x)f'(x)g(x)g(x)g(x)g'(x)
1133442255
221166332-2
3322771188

Find each of the following.

(a) (fg)(1)(f\circ g)'(1) (b) (gf)(1)(g\circ f)'(1) (c) (fg)(3)(f\circ g)'(3) (d) (ff)(2)(f\circ f)'(2) (e) p(2)p'(2), where p(x)=f(2x1)p(x)=f(2x-1)

Show hint

Write the formula (fg)(a)=f(g(a))g(a)(f\circ g)'(a)=f'(g(a))\,g'(a) down first, in symbols, and only then look up numbers — the trap is reading ff' from the wrong row.

Show answer

In every part, apply (fg)(a)=f(g(a))g(a)(f\circ g)'(a)=f'\big(g(a)\big)\,g'(a): the outer derivative is evaluated at the output of the inner function.

(a) (fg)(1)=f(g(1))g(1)(f\circ g)'(1)=f'\big(g(1)\big)\,g'(1). From the table, g(1)=2g(1)=2 and g(1)=5g'(1)=5, and then f(2)=6f'(2)=6. So

(fg)(1)=65=30.(f\circ g)'(1)=6\cdot 5=30 .

(b) (gf)(1)=g(f(1))f(1)(g\circ f)'(1)=g'\big(f(1)\big)\,f'(1). Here f(1)=3f(1)=3 and f(1)=4f'(1)=4, and g(3)=8g'(3)=8. So

(gf)(1)=84=32.(g\circ f)'(1)=8\cdot 4=32 .

(c) (fg)(3)=f(g(3))g(3)(f\circ g)'(3)=f'\big(g(3)\big)\,g'(3). Here g(3)=1g(3)=1 and g(3)=8g'(3)=8, and f(1)=4f'(1)=4. So

(fg)(3)=48=32.(f\circ g)'(3)=4\cdot 8=32 .

(d) (ff)(2)=f(f(2))f(2)(f\circ f)'(2)=f'\big(f(2)\big)\,f'(2). Here f(2)=1f(2)=1 and f(2)=6f'(2)=6, and f(1)=4f'(1)=4. So

(ff)(2)=46=24.(f\circ f)'(2)=4\cdot 6=24 .

(e) p(x)=f(2x1)p(x)=f(2x-1) has inner function u=2x1u=2x-1 with u=2u'=2, so p(x)=2f(2x1)p'(x)=2f'(2x-1). At x=2x=2 the inside is 2(2)1=32(2)-1=3, so

p(2)=2f(3)=27=14.p'(2)=2f'(3)=2\cdot 7=14 .

What to notice. In (a) the outer derivative is f(2)=6f'(2)=6, not f(1)=4f'(1)=4: you must feed ff' the value g(1)=2g(1)=2. Compare (a) with (b): reversing the order of composition uses entirely different table entries and gives a different answer (3030 versus 3232). And in (e), even though the inner function is as simple as 2x12x-1, its derivative 22 still appears as a factor.

Answers: (a) 3030 (b) 3232 (c) 3232 (d) 2424 (e) 1414.

A student is asked to differentiate y=(x2+4)3sin(2x)y=(x^{2}+4)^{3}\sin(2x) and writes

y=3(x2+4)2cos(2x).y'=3(x^{2}+4)^{2}\cdot\cos(2x).

Identify every separate error in this line, produce the correct derivative in factored form, and evaluate it at x=0x=0.

Show hint

There are three distinct mistakes: one about which rule applies to a product, and two of exactly the same kind about missing factors.

Show answer

Error 1 — the product rule was never used. The derivative of a product is not the product of the derivatives: in general (uv)uv(uv)'\ne u'v'. The correct opening is (uv)=uv+uv(uv)'=u'v+uv', which produces two terms, not one.

Error 2 — missing inner derivative in the first factor. By the chain rule,

ddx(x2+4)3=3(x2+4)2ddx(x2+4)=3(x2+4)22x=6x(x2+4)2.\frac{d}{dx}(x^{2}+4)^{3}=3(x^{2}+4)^{2}\cdot\frac{d}{dx}(x^{2}+4)=3(x^{2}+4)^{2}\cdot 2x=6x(x^{2}+4)^{2}.

The factor 2x2x was dropped.

Error 3 — missing inner derivative in the second factor. Again by the chain rule,

ddxsin(2x)=cos(2x)ddx(2x)=2cos(2x).\frac{d}{dx}\sin(2x)=\cos(2x)\cdot\frac{d}{dx}(2x)=2\cos(2x).

The factor 22 was dropped.

Correct computation. Product rule with u=(x2+4)3u=(x^{2}+4)^{3} and v=sin(2x)v=\sin(2x):

y=uv+uv=6x(x2+4)2sin(2x)+(x2+4)32cos(2x)=2(x2+4)2[3xsin(2x)+(x2+4)cos(2x)].\begin{aligned} y' &= u'v+uv' \\ &= 6x(x^{2}+4)^{2}\sin(2x)+(x^{2}+4)^{3}\cdot 2\cos(2x) \\ &= 2(x^{2}+4)^{2}\Big[3x\sin(2x)+(x^{2}+4)\cos(2x)\Big]. \end{aligned}

Verify the factoring by expanding back: 2(x2+4)23xsin(2x)=6x(x2+4)2sin(2x)2(x^{2}+4)^{2}\cdot 3x\sin(2x)=6x(x^{2}+4)^{2}\sin(2x), and 2(x2+4)2(x2+4)cos(2x)=2(x2+4)3cos(2x)2(x^{2}+4)^{2}\cdot(x^{2}+4)\cos(2x)=2(x^{2}+4)^{3}\cos(2x). Both terms are recovered.

Value at x=0x=0. With sin0=0\sin 0=0 and cos0=1\cos 0=1,

y(0)=2(0+4)2[0+(0+4)(1)]=2164=128.y'(0)=2(0+4)^{2}\big[0+(0+4)(1)\big]=2\cdot 16\cdot 4=128 .

Check. Near x=0x=0 we have (x2+4)343=64(x^{2}+4)^{3}\approx 4^{3}=64 and sin(2x)2x\sin(2x)\approx 2x, so y128xy\approx 128x and the slope at the origin is 128128. A centred difference with h=0.001h=0.001 gives 128.00001128.00001. By contrast, the student's expression would have produced 3(4)2cos0=483(4)^{2}\cos 0=48 — off by a factor of nearly three.

Answer: y=2(x2+4)2[3xsin(2x)+(x2+4)cos(2x)]y'=2(x^{2}+4)^{2}\big[3x\sin(2x)+(x^{2}+4)\cos(2x)\big], and y(0)=128y'(0)=128.

Let y=x4x2y=x\sqrt{4-x^{2}}. Find dydx\dfrac{dy}{dx}, state the largest set on which the formula is valid and explain what happens at the ends, then find every point on the curve where the tangent line is horizontal.

Show hint

Product rule first, chain rule on the root, then put everything over a single denominator before you set anything equal to zero.

Show answer

Domain of yy. We need 4x204-x^{2}\ge 0, i.e. 2x2-2\le x\le 2.

Differentiate. The outermost operation is a product, so use the product rule with u=xu=x and v=4x2v=\sqrt{4-x^{2}}. For vv the chain rule gives

v=124x2ddx(4x2)=2x24x2=x4x2.v'=\frac{1}{2\sqrt{4-x^{2}}}\cdot\frac{d}{dx}\big(4-x^{2}\big)=\frac{-2x}{2\sqrt{4-x^{2}}}=\frac{-x}{\sqrt{4-x^{2}}} .

Hence

dydx=14x2+xx4x2=(4x2)x24x2=42x24x2.\begin{aligned} \frac{dy}{dx} &= 1\cdot\sqrt{4-x^{2}}+x\cdot\frac{-x}{\sqrt{4-x^{2}}} \\ &= \frac{(4-x^{2})-x^{2}}{\sqrt{4-x^{2}}} \\ &= \frac{4-2x^{2}}{\sqrt{4-x^{2}}} . \end{aligned}

Where the formula is valid. The chain rule requires the outer function u\sqrt{u} to be differentiable at u=4x2u=4-x^{2}, and u\sqrt{u} is not differentiable at u=0u=0. So the formula holds exactly on the open interval 2<x<2-2<x<2. At x=±2x=\pm 2 the denominator vanishes and the derivative does not exist: the numerator there is 42(4)=404-2(4)=-4\ne 0 while the denominator tends to 0+0^{+}, so the one-sided derivative tends to -\infty at each end and the curve meets the xx-axis with a vertical tangent. This is a genuine failure of a hypothesis of the chain rule, not just a bookkeeping nuisance.

Horizontal tangents. A horizontal tangent needs dydx=0\dfrac{dy}{dx}=0, which for a fraction means the numerator vanishes while the denominator is defined and nonzero:

42x2=0    x2=2    x=±2,4-2x^{2}=0\;\Rightarrow\;x^{2}=2\;\Rightarrow\;x=\pm\sqrt2 ,

and both values lie inside (2,2)(-2,2), so both are legitimate. The corresponding yy-values are

y(2)=242=22=2,y(2)=22=2.y(\sqrt2)=\sqrt2\cdot\sqrt{4-2}=\sqrt2\cdot\sqrt2=2,\qquad y(-\sqrt2)=-\sqrt2\cdot\sqrt2=-2 .

Check without calculus. Squaring, y2=x2(4x2)y^{2}=x^{2}\big(4-x^{2}\big). For nonnegative numbers a=x2a=x^{2} and b=4x2b=4-x^{2} with a+b=4a+b=4 fixed, the product abab is largest when a=b=2a=b=2, giving ab=4ab=4. So the largest possible value of y2y^{2} is 44, attained exactly when x2=2x^{2}=2, and there y=±2y=\pm 2. That is precisely the pair of points found above — extreme values, so horizontal tangents. A centred difference at x=1x=1 with h=0.001h=0.001 gives 1.154701.15470, matching 423=231.15470\dfrac{4-2}{\sqrt3}=\dfrac{2}{\sqrt3}\approx 1.15470.

Answer: dydx=42x24x2\dfrac{dy}{dx}=\dfrac{4-2x^{2}}{\sqrt{4-x^{2}}}, valid on (2,2)(-2,2) with vertical tangents at x=±2x=\pm 2; horizontal tangents occur at (2,2)\big(\sqrt2,\,2\big) and (2,2)\big(-\sqrt2,\,-2\big).

Differentiate y=(3x1x+2)4y=\left(\dfrac{3x-1}{x+2}\right)^{4} in two independent ways — (i) chain rule on the outside with the quotient rule inside, and (ii) after rewriting the expression as a product involving a negative power — and confirm the two answers agree. Then evaluate y(1)y'(1).

Show hint

For (i), ask which operation you would perform last when evaluating the expression. For (ii), remember 1(x+2)4=(x+2)4\dfrac{1}{(x+2)^{4}}=(x+2)^{-4}.

Show answer

Throughout, x2x\ne -2.

(i) Chain rule outside, quotient rule inside. The outermost operation is the fourth power, so the inner function is u=3x1x+2u=\dfrac{3x-1}{x+2} and the outer function is u4u^{4}. First differentiate uu by the quotient rule:

u=3(x+2)(3x1)(1)(x+2)2=3x+63x+1(x+2)2=7(x+2)2.u'=\frac{3(x+2)-(3x-1)(1)}{(x+2)^{2}}=\frac{3x+6-3x+1}{(x+2)^{2}}=\frac{7}{(x+2)^{2}} .

Then

y=4u3u=4(3x1x+2)37(x+2)2=28(3x1)3(x+2)3(x+2)2=28(3x1)3(x+2)5.\begin{aligned} y' &= 4u^{3}\cdot u' \\ &= 4\left(\frac{3x-1}{x+2}\right)^{3}\cdot\frac{7}{(x+2)^{2}} \\ &= \frac{28(3x-1)^{3}}{(x+2)^{3}\,(x+2)^{2}} \\ &= \frac{28(3x-1)^{3}}{(x+2)^{5}} . \end{aligned}

(ii) Product rule with a negative power. Write y=(3x1)4(x+2)4y=(3x-1)^{4}(x+2)^{-4}. Each factor needs the chain rule:

ddx(3x1)4=4(3x1)33=12(3x1)3,ddx(x+2)4=4(x+2)51.\frac{d}{dx}(3x-1)^{4}=4(3x-1)^{3}\cdot 3=12(3x-1)^{3},\qquad \frac{d}{dx}(x+2)^{-4}=-4(x+2)^{-5}\cdot 1 .

So

y=12(3x1)3(x+2)4+(3x1)4(4(x+2)5)=4(3x1)3(x+2)5[3(x+2)(3x1)]=4(3x1)3(x+2)5[3x+63x+1]=4(3x1)3(x+2)57=28(3x1)3(x+2)5.\begin{aligned} y' &= 12(3x-1)^{3}(x+2)^{-4}+(3x-1)^{4}\cdot\big(-4(x+2)^{-5}\big) \\ &= 4(3x-1)^{3}(x+2)^{-5}\Big[3(x+2)-(3x-1)\Big] \\ &= 4(3x-1)^{3}(x+2)^{-5}\big[3x+6-3x+1\big] \\ &= 4(3x-1)^{3}(x+2)^{-5}\cdot 7 \\ &= \frac{28(3x-1)^{3}}{(x+2)^{5}} . \end{aligned}

(In the second line the common factor 4(3x1)3(x+2)54(3x-1)^{3}(x+2)^{-5} was pulled out; the first term supplies 3(x+2)3(x+2) because (x+2)4=(x+2)5(x+2)(x+2)^{-4}=(x+2)^{-5}(x+2).)

The two methods give the same expression, as they must.

Evaluate at x=1x=1. Here 3(1)1=23(1)-1=2 and 1+2=31+2=3, so

y(1)=282335=288243=2242430.92181.y'(1)=\frac{28\cdot 2^{3}}{3^{5}}=\frac{28\cdot 8}{243}=\frac{224}{243}\approx 0.92181 .

Numerical check. y(1.001)=(2.0033.001)40.198454y(1.001)=\left(\dfrac{2.003}{3.001}\right)^{4}\approx 0.198454 and y(0.999)=(1.9972.999)40.196610y(0.999)=\left(\dfrac{1.997}{2.999}\right)^{4}\approx 0.196610, so the centred difference is 0.1984540.1966100.0020.922\dfrac{0.198454-0.196610}{0.002}\approx 0.922, agreeing with 224243\dfrac{224}{243}.

Answer: y=28(3x1)3(x+2)5y'=\dfrac{28(3x-1)^{3}}{(x+2)^{5}} for x2x\ne -2, and y(1)=224243y'(1)=\dfrac{224}{243}.

(a) Let ff be differentiable with f(2)=1f(2)=1, f(2)=5f'(2)=5, f(8)=3f(8)=-3 and f(8)=7f'(8)=7. Define F(x)=f(x3)F(x)=f\big(x^{3}\big) and G(x)=[f(x)]3G(x)=\big[f(x)\big]^{3}. Compute F(2)F'(2) and G(2)G'(2), and say why they use completely different pieces of data.

(b) Applying the chain rule mechanically to y=x2y=\sqrt{x^{2}} gives 2x2x2\dfrac{2x}{2\sqrt{x^{2}}}. For which xx is this actually correct, and precisely which hypothesis of the chain rule fails elsewhere?

Show hint

In (a), decide for each function which piece is on the outside. In (b), recall that the theorem asks the outer function to be differentiable at g(a)g(a), not at aa.

Show answer

(a)

For F(x)=f(x3)F(x)=f\big(x^{3}\big) the outer function is ff and the inner function is x3x^{3}, so

F(x)=f(x3)3x2.F'(x)=f'\big(x^{3}\big)\cdot 3x^{2}.

At x=2x=2 the inside is 23=82^{3}=8, hence

F(2)=f(8)3(2)2=712=84.F'(2)=f'(8)\cdot 3(2)^{2}=7\cdot 12=84 .

For G(x)=[f(x)]3G(x)=\big[f(x)\big]^{3} the outer function is the cube and the inner function is ff, so

G(x)=3[f(x)]2f(x).G'(x)=3\big[f(x)\big]^{2}f'(x).

At x=2x=2, using f(2)=1f(2)=1 and f(2)=5f'(2)=5,

G(2)=3(1)2(5)=15.G'(2)=3(1)^{2}(5)=15 .

Why the data differ: in FF, the derivative ff' is evaluated at the output of the inner function, namely 88, so F(2)F'(2) uses f(8)f'(8) and never touches f(2)f(2) or f(2)f'(2). In GG, ff is the inner function, so everything is evaluated at 22 and G(2)G'(2) never touches f(8)f(8) or f(8)f'(8). Swapping which function sits on the outside changes not only the formula but even which table entries are relevant. (Notice also that f(2)=1f(2)=1 is needed for GG but f(8)=3f(8)=-3 is never used at all.)

(b)

First simplify honestly: x2=x\sqrt{x^{2}}=|x| for every real xx, since the square root returns the nonnegative root. The mechanical answer is

2x2x2=xx2=xx={1,x>01,x<0\frac{2x}{2\sqrt{x^{2}}}=\frac{x}{\sqrt{x^{2}}}=\frac{x}{|x|}= \begin{cases} 1, & x>0\\ -1, & x<0 \end{cases}

and it is undefined at x=0x=0.

That is correct for every x0x\ne 0: for x>0x>0 the function is y=xy=x with derivative 11, and for x<0x<0 it is y=xy=-x with derivative 1-1.

At x=0x=0 the chain rule does not apply. Take g(x)=x2g(x)=x^{2} and f(u)=uf(u)=\sqrt{u}. The inner function is fine: gg is differentiable at 00 with g(0)=0g'(0)=0. The hypothesis that fails is "ff is differentiable at g(a)g(a)": here g(0)=0g(0)=0, and u\sqrt{u} is not differentiable at u=0u=0, because

limh0+h0h=limh0+1h=+.\lim_{h\to 0^{+}}\frac{\sqrt{h}-\sqrt{0}}{h}=\lim_{h\to 0^{+}}\frac{1}{\sqrt{h}}=+\infty .

The conclusion fails as well, so nothing is being rescued by luck: x|x| has no derivative at 00, since the difference quotients h0h\dfrac{|h|-0}{h} equal +1+1 for h>0h>0 and 1-1 for h<0h<0, and the two one-sided limits disagree.

Moral: differentiability of the outer function must be checked at the point g(a)g(a), not at aa. This is also the reason the general power rule ddxun=nun1u\dfrac{d}{dx}u^{n}=nu^{n-1}u' carries the restriction u>0u>0 whenever nn is not an integer.

Answers: (a) F(2)=84F'(2)=84 and G(2)=15G'(2)=15. (b) The formula is valid for all x0x\ne 0; at x=0x=0 the hypothesis that the outer function u\sqrt{u} be differentiable at u=g(0)=0u=g(0)=0 fails, and x2=x\sqrt{x^{2}}=|x| is genuinely not differentiable there.