Unit 3 · Topic 3.1 Beta

The Chain Rule

4 min read · freeNot practiced

Most functions you meet in calculus are built in layers: sin⁡(x2)\sin(x^2), e−3xe^{-3x}, (4x+1)10(4x + 1)^{10}, 1+cos⁡x\sqrt{1 + \cos x}. None of them is a plain power, sine or exponential, so the rules you know so far cannot finish the job alone. The chain rule handles every one of them, and the idea behind it fits in one sentence: when one function feeds another, their rates of change multiply.

Layers: the inside and the outside function

A composite function h(x)=f(g(x))h(x) = f(g(x)) works like an assembly line. First the inside function gg acts on xx. Then the outside function ff acts on whatever gg produced. To see the layers, ask how you would compute the value with a calculator. For sin⁡(x2)\sin(x^2) you square first, then take the sine: the inside is x2x^2 and the outside is sin⁡u\sin u.

FunctionInside u=g(x)u = g(x)Outside f(u)f(u)
sin⁡(x2)\sin(x^2)x2x^2sin⁡u\sin u
e−3xe^{-3x}−3x-3xeue^u
(4x+1)10(4x + 1)^{10}4x+14x + 1u10u^{10}
ln⁡(cos⁡x)\ln(\cos x)cos⁡x\cos xln⁡u\ln u
1+x3\sqrt{1 + x^3}1+x31 + x^3u\sqrt{u}

Why the rates multiply

Think of two gears. If the small gear turns 3 times for every turn of the pedal, and the wheel turns 2 times for every turn of the small gear, the wheel turns 3⋅2=63 \cdot 2 = 6 times per pedal turn. Rates of change pass through a chain in the same way. Suppose xx changes by a tiny amount. The inside function changes about g′(x)g'(x) times as much. The outside function then changes about f′(u)f'(u) times as much as its own input u=g(x)u = g(x) did. So hh changes about f′(g(x))⋅g′(x)f'(g(x)) \cdot g'(x) times as much as xx:

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

In Leibniz notation, with y=f(u)y = f(u) and u=g(x)u = g(x), the same rule reads dydx=dydu⋅dudx\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}. It looks like fractions cancelling. They are not really fractions, but the picture is a good memory aid.

Graphs of y = sin x (blue, dashed) and y = sin(2x) (crimson) from x = −π to π. Both pass through the origin; the tangent line to sin x there has slope 1 and the tangent line to sin(2x) has slope 2.
Figure 1. The inside function 2x2x squeezes sin⁡x\sin x sideways by a factor of 2, so the slope at the origin doubles from 1 to 2. LevlPrep original diagram.

The figure shows the rule at work. The graph of sin⁡(2x)\sin(2x) is the graph of sin⁡x\sin x squeezed sideways by a factor of 2, so every slope is twice as steep. The chain rule says the same thing: ddxsin⁡(2x)\frac{d}{dx}\sin(2x)=cos⁡(2x)⋅2= \cos(2x) \cdot 2.

The two-step routine

  1. Differentiate the outside function and leave the inside alone. Write f′f' with the original inside function still in it: f′(g(x))f'(g(x)).
  2. Multiply by the derivative of the inside function, g′(x)g'(x).

Worked example 1. Differentiate y=(4x+1)10y = (4x + 1)^{10}.

Outside: u10u^{10}, whose derivative is 10u910u^9. Keep the inside: 10(4x+1)910(4x + 1)^9.

Inside: 4x+14x + 1, whose derivative is 44.

So dydx\frac{dy}{dx}=10(4x+1)9⋅4= 10(4x + 1)^9 \cdot 4=40(4x+1)9= 40(4x + 1)^9. Expanding (4x+1)10(4x + 1)^{10} first would take pages; the chain rule takes one line.

Worked example 2. Differentiate y=e−3xy = e^{-3x} and y=ln⁡(cos⁡x)y = \ln(\cos x).

For e−3xe^{-3x}: the outside eue^u is its own derivative, so we keep e−3xe^{-3x}, then multiply by the inside derivative −3-3: dydx=−3e−3x\frac{dy}{dx} = -3e^{-3x}. The power rule does not apply here, because the variable is in the exponent.

For ln⁡(cos⁡x)\ln(\cos x): the outside derivative is 1u\frac{1}{u}, giving 1cos⁡x\frac{1}{\cos x}; the inside derivative is −sin⁡x-\sin x. So dydx\frac{dy}{dx}=−sin⁡xcos⁡x= \frac{-\sin x}{\cos x}=−tan⁡x= -\tan x.

More than two layers

Some functions have three layers, such as sin3⁡(2x)=(sin⁡(2x))3\sin^3(2x) = \left(\sin(2x)\right)^3. Peel them from the outside in, multiplying one derivative for each layer: the cube, then the sine, then 2x2x.

Worked example 3. Differentiate y=sin3⁡(2x)y = \sin^3(2x).

Layer 1, the cube: 3sin2⁡(2x)3\sin^2(2x). Layer 2, the sine: cos⁡(2x)\cos(2x). Layer 3, the inside 2x2x: 22.

So dydx\frac{dy}{dx}=3sin2⁡(2x)⋅cos⁡(2x)⋅2= 3\sin^2(2x) \cdot \cos(2x) \cdot 2=6sin2⁡(2x)cos⁡(2x)= 6\sin^2(2x)\cos(2x).

The chain rule from a table

The exam often gives values of ff, gg and their derivatives in a table instead of formulas. The rule is the same, but you must read each value at the right input. Suppose g(1)=2g(1) = 2, g′(1)=5g'(1) = 5 and f′(2)=6f'(2) = 6. For h(x)=f(g(x))h(x) = f(g(x)):

h′(1)=f′(g(1))⋅g′(1)=f′(2)⋅5=30h'(1) = f'(g(1)) \cdot g'(1) = f'(2) \cdot 5 = 30

The outside derivative is read at the inside value g(1)=2g(1) = 2, not at x=1x = 1. Write the middle step, f′(g(1))f'(g(1)), every time; it keeps you from grabbing f′(1)f'(1) by mistake.

The slips that cost points

SlipWrongRight
Dropping the inside derivativeddxsin⁡(x2)=cos⁡(x2)\frac{d}{dx}\sin(x^2) = \cos(x^2)cos⁡(x2)⋅2x\cos(x^2) \cdot 2x
Changing the inside functionddxsin⁡(x2)=cos⁡(2x)\frac{d}{dx}\sin(x^2) = \cos(2x)cos⁡(x2)⋅2x\cos(x^2) \cdot 2x
Power rule on eue^uddxex2=x2ex2−1\frac{d}{dx}e^{x^2} = x^2 e^{x^2 - 1}ex2⋅2xe^{x^2} \cdot 2x
Wrong input in a tablef′(1)⋅g′(1)f'(1) \cdot g'(1)f′(g(1))⋅g′(1)f'(g(1)) \cdot g'(1)

A quick check catches most of them: count the layers, and make sure your answer has one factor for each.

Spot a mistake on this page?