MATH 140 Calculus 1 • McGill University, Montreal

Revision sheet: the chain rule (MATH 140)

This sheet is not a summary of section 3.4 of Stewart: you already have the course notes. It answers one question only, what makes students lose marks on the chain rule in MATH 140 at McGill University, and which precise gesture avoids each loss.

The chain rule is short to state and it is used in every chapter that follows, so its errors are paid again and again, on implicit differentiation, related rates and optimization. Every value below is exact and done by hand, as on the exam, and every trap comes with the sentence that earns the method mark.

Mark this sheet as read or add it to your favourites: a free account, no password, keeps your read sheets and favourites from one visit to the next and tells you which chapter to tackle next. Create your space, an email is enough.

The thread of the chapter

Name the inner function uu before writing anything: the outer function is differentiated AT uu, left untouched, and multiplied by u′u', one factor per layer. The marks of the chapter are lost in two ways only, a missing factor and an outer derivative read at xx instead of at g(x)g(x).

This chapter is part of MATH 140, Calculus 1 (McGill)

The essentials

One factor per layer: name u, differentiate the outer function at u, multiply by u'

  • • (f∘g)′(x)=f′(g(x)) g′(x)(f \circ g)'(x) = f'(g(x))\,g'(x). In Leibniz notation, with u=g(x)u = g(x): dydx=dydu⋅dudx\frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx}.
  • • Hypotheses: gg differentiable at xx AND ff differentiable at g(x)g(x), not at xx. At a corner of ff reached by gg, the rule gives nothing.
  • • The outer derivative is evaluated at g(x)g(x), with the inside UNTOUCHED: (sin⁡(x2))′=cos⁡(x2)⋅2x(\sin(x^2))' = \cos(x^2) \cdot 2x, never cos⁡(2x)\cos(2x).
  • • Three layers, three factors: (sin⁡3(4x))′=3sin⁡2(4x)⋅cos⁡(4x)⋅4(\sin^3(4x))' = 3\sin^2(4x) \cdot \cos(4x) \cdot 4. Count the factors against the layers before moving on.
  • • The inner derivative is a SPEED factor: ddxf(kx)=k f′(kx)\frac{d}{dx}f(kx) = k\,f'(kx). The graph of f(kx)f(kx) is the graph of ff squeezed by kk, so every slope is multiplied by kk.
-3-2-1123-2-1.5-1-0.50.511.52y = sin x, slope 1 at 0y = sin 2x, slope 2 at 0
sin⁡2x\sin 2x runs through the same values twice as fast as sin⁡x\sin x, so its tangent at 00 has slope 22, not 11: the inner factor 22 is visible on the graph.

The first line of the write-up names the inner function: “let u=3x2−5u = 3x^2 - 5, so y=u7y = u^7”. Markers give the method mark for that sentence, and it prevents the missing factor.

Composite, product or power: the LAST operation decides

  • • sin⁡(x2)\sin(x^2): square first, sine last, so the outer function is sin⁡\sin. sin⁡2x=(sin⁡x)2\sin^2 x = (\sin x)^2: sine first, square last, so the outer function is the square.
  • • x2sin⁡xx^2\sin x: the last operation is a product, so the product rule comes first, and the chain rule only inside the factors that need it.
  • • ex2e^{x^2} is an exponential of x2x^2; (ex)2=e2x(e^x)^2 = e^{2x} is another function. Rewrite before differentiating.
  • • Variable in the base: (xb)′=bxb−1(x^b)' = bx^{b-1}. Variable in the exponent: bx=exln⁡bb^x = e^{x\ln b} and (bx)′=bxln⁡b(b^x)' = b^x\ln b, where ln⁡b\ln b is a constant. Neither: (ππ)′=0(\pi^\pi)' = 0.
  • • A power or a root of a quotient is a composition: x−1x+1\sqrt{\frac{x-1}{x+1}} has outer function u\sqrt u and inner function the quotient.

Read the expression the way a calculator would evaluate it: the operation performed last is the outer layer, and it picks the first rule.

The rules in table form

Each row reads from left to right: the assumptions, then the result. A red cell is not an answer, it is the finding that the form settles nothing and the instruction to rewrite it. Every case is followed by a worked example.

The outer layer picks the formula

Read a line as: when the last operation is the one of the first column, its derivative is the one of the last column, always with the factor u′u'. The red lines are rules that do not exist, copied from real papers.

Outer layerFunctionDerivative
power unu^n nun−1u′nu^{n-1}u'

Example: ((3x2−5)7)′=42x(3x2−5)6\left((3x^2 - 5)^7\right)' = 42x(3x^2 - 5)^6, which is 26882688 at x=1x = 1.

root u\sqrt u u′2u\frac{u'}{2\sqrt u}

Example: (x2+9)′=xx2+9\left(\sqrt{x^2 + 9}\right)' = \frac{x}{\sqrt{x^2 + 9}}, which is 45\frac{4}{5} at x=4x = 4.

exponential eue^u euu′e^u u'

Example: (e−x2/2)′=−xe−x2/2\left(e^{-x^2/2}\right)' = -xe^{-x^2/2}, which is −2e2-\frac{2}{e^2} at x=2x = 2.

exponential, base bb bub^u buln⁡b⋅u′b^u \ln b \cdot u'

Example: (3x2)′=2xln⁡3⋅3x2\left(3^{x^2}\right)' = 2x\ln 3 \cdot 3^{x^2}, which is 6ln⁡36\ln 3 at x=1x = 1.

sine sin⁡u\sin u cos⁡u⋅u′\cos u \cdot u'

Example: (sin⁡πx6)′=π6cos⁡πx6\left(\sin\frac{\pi x}{6}\right)' = \frac{\pi}{6}\cos\frac{\pi x}{6}, which is 3 π12\frac{\sqrt 3\,\pi}{12} at x=1x = 1.

tangent tan⁡u\tan u sec⁡2u⋅u′\sec^2 u \cdot u'

Example: (tan⁡πx4)′=π4sec⁡2πx4\left(\tan\frac{\pi x}{4}\right)' = \frac{\pi}{4}\sec^2\frac{\pi x}{4}, which is π2\frac{\pi}{2} at x=1x = 1.

composition f(g(x))f(g(x)) f′(g′(x))f'(g'(x)) rule that does not exist

Example: f(x)=x2f(x) = x^2, g(x)=x3g(x) = x^3: (x6)′=6x5(x^6)' = 6x^5 is 66 at x=1x = 1, while f′(g′(x))=2⋅3x2f'(g'(x)) = 2 \cdot 3x^2 is 66 at 11 but 2424 at x=2x = 2 instead of 192192.

What to do: Multiply side by side: f′(g(x))⋅g′(x)=2x3⋅3x2=6x5f'(g(x)) \cdot g'(x) = 2x^3 \cdot 3x^2 = 6x^5.

exponential eue^{u} u eu−1u\,e^{u-1} rule that does not exist

Example: (ex2)′(e^{x^2})' at x=1x = 1 is 2e≈5.442e \approx 5.44; the power rule on the exponent gives 1⋅e0=11 \cdot e^0 = 1.

What to do: The exponential comes back unchanged: (eu)′=euu′(e^u)' = e^u u'; the power rule is for a variable BASE.

Every line ends with u′u'. A derivative of a composite without that factor is wrong everywhere u′≠1u' \ne 1.

The mistakes that cost marks

These are the errors I correct most often in session. Each one costs marks on a paper, even when the reasoning behind it is right.

1. Forgetting the inner derivative

half the marks of the question, and every later part built on it

What not to write

“ddxx3+1=12x3+1\frac{d}{dx}\sqrt{x^3 + 1} = \frac{1}{2\sqrt{x^3 + 1}}.”

What to write

“Let u=x3+1u = x^3 + 1, so y=uy = \sqrt u and y′=u′2u=3x22x3+1y' = \frac{u'}{2\sqrt u} = \frac{3x^2}{2\sqrt{x^3 + 1}}.”

Why: The outer layer alone is correct, which is why the error survives rereading. Naming uu on the first line forces the question “and u′u'?”.

2. Putting the inner derivative inside the outer function

the whole question

What not to write

“ddxsin⁡(x2)=cos⁡(2x)\frac{d}{dx}\sin(x^2) = \cos(2x).”

What to write

“The sine is the outer layer and receives x2x^2: ddxsin⁡(x2)=cos⁡(x2)⋅2x\frac{d}{dx}\sin(x^2) = \cos(x^2) \cdot 2x.”

Why: The chain rule MULTIPLIES two factors side by side; it never nests one derivative inside another. At x=0x = 0 the false answer gives 11 while the graph of sin⁡(x2)\sin(x^2) is flat.

3. Reading the outer derivative at x instead of at g(x)

the whole question, on every table or graph item of the exam

What not to write

“h=f∘gh = f \circ g, so h′(1)=f′(1) g′(1)=2⋅4=8h'(1) = f'(1)\,g'(1) = 2 \cdot 4 = 8.”

What to write

“h′(1)=f′(g(1)) g′(1)h'(1) = f'(g(1))\,g'(1). Since g(1)=2g(1) = 2, h′(1)=f′(2) g′(1)=5⋅4=20h'(1) = f'(2)\,g'(1) = 5 \cdot 4 = 20.”

Why: The outer function never sees xx, only the value that gg hands it. Write g(1)g(1) as a number first, THEN go to that row of the table.

4. Applying the power rule to an exponential

the whole question

What not to write

“ddx2x=x 2x−1\frac{d}{dx}2^x = x\,2^{x-1}.”

What to write

“2x=exln⁡22^x = e^{x\ln 2}, with ln⁡2\ln 2 a constant, so ddx2x=exln⁡2ln⁡2=2xln⁡2\frac{d}{dx}2^x = e^{x\ln 2}\ln 2 = 2^x\ln 2.”

Why: The power rule needs a variable base and a constant exponent. At x=0x = 0 the false formula gives slope 00 to an increasing curve, whose true slope is ln⁡2≈0.69\ln 2 \approx 0.69.

5. Taking e to the x squared as its own derivative

2 to 3 marks, and a wrong tangent line

What not to write

“exe^x is its own derivative, so ddxex2=ex2\frac{d}{dx}e^{x^2} = e^{x^2}.”

What to write

“With u=x2u = x^2: ddxex2=ex2⋅2x\frac{d}{dx}e^{x^2} = e^{x^2}\cdot 2x, so the slope at x=1x = 1 is 2e2e.”

-1.5-1-0.50.511.512345678y = e^(x²)slope 2e: tangentslope e: falsex
At (1,e)(1, e) the green line of slope 2e2e touches the curve; the red line of slope ee cuts through it, so it is not the tangent.

Why: exe^x is its own derivative with respect to its own exponent only. With any other exponent the factor u′u' appears, and on the graph the false tangent is visibly too flat.

6. Stopping one layer early

1 to 2 marks

What not to write

“ddxsin⁡3(4x)=3sin⁡2(4x)cos⁡(4x)\frac{d}{dx}\sin^3(4x) = 3\sin^2(4x)\cos(4x).”

What to write

“Layers: cube, sine, 4x4x. So ddxsin⁡3(4x)=3sin⁡2(4x)⋅cos⁡(4x)⋅4=12sin⁡2(4x)cos⁡(4x)\frac{d}{dx}\sin^3(4x) = 3\sin^2(4x)\cdot\cos(4x)\cdot 4 = 12\sin^2(4x)\cos(4x).”

Why: Two layers were handled and the third, the innermost, was forgotten because its derivative is only a number. List the layers first, then write one factor per layer.

7. Inventing a chain rule for second derivatives

the whole question

What not to write

“(f∘g)′′(1)=f′′(g(1)) g′′(1)=5⋅(−1)=−5(f \circ g)''(1) = f''(g(1))\,g''(1) = 5 \cdot (-1) = -5.”

What to write

“(f∘g)′′=f′′(g) (g′)2+f′(g) g′′(f \circ g)'' = f''(g)\,(g')^2 + f'(g)\,g'', so (f∘g)′′(1)=5⋅32+4⋅(−1)=41(f \circ g)''(1) = 5 \cdot 3^2 + 4 \cdot (-1) = 41.”

Why: (f∘g)′=f′(g) g′(f \circ g)' = f'(g)\,g' is a PRODUCT: differentiating it again needs the product rule, and the chain rule once more on f′(g)f'(g). Test on f(x)=x2f(x) = x^2, g(x)=2xg(x) = 2x: 4x24x^2 has second derivative 88, the false rule gives 00.

8. Believing the derivative of an even function is even

1 to 2 marks, often on a graph-matching question

What not to write

“ff is even, so f′f' is even too: f′(−1)=f′(1)f'(-1) = f'(1).”

What to write

“Differentiating f(−x)=f(x)f(-x) = f(x) by the chain rule gives −f′(−x)=f′(x)-f'(-x) = f'(x): f′f' is ODD, so f′(−1)=−f′(1)f'(-1) = -f'(1).”

-3-2-112312345slope -2 at x = 1slope 2 at x = -1y = 4/(1 + x²)x
y=41+x2y = \frac{4}{1 + x^2} is even: the tangents at x=−1x = -1 and x=1x = 1 are mirror images, with slopes 22 and −2-2.

Why: The inner function −x-x has derivative −1-1, and that factor flips the sign. A symmetric graph has mirror-image tangents, with opposite slopes.

9. Differentiating a sine of degrees as if it were radians

the whole question

What not to write

“S(x)=sin⁡(x∘)S(x) = \sin(x^\circ), so S′(x)=cos⁡(x∘)S'(x) = \cos(x^\circ) and S′(0)=1S'(0) = 1.”

What to write

“xx degrees is πx180\frac{\pi x}{180} radians, so S′(x)=π180cos⁡(x∘)S'(x) = \frac{\pi}{180}\cos(x^\circ) and S′(0)=π180S'(0) = \frac{\pi}{180}.”

Why: The formula (sin⁡x)′=cos⁡x(\sin x)' = \cos x holds in radians only. A change of unit is an inner function, and its derivative is a factor.

Which method to choose

Which rule first, by the LAST operation of the expression

Look at the operation that would be performed last, then pick the rule

  • If a power or a root of an expression: [u]n[u]^n, u\sqrt u, 1uk\frac{1}{u^k} → rewrite as uru^r, then rur−1u′ru^{r-1}u'

    Example: 19−x2=(9−x2)−1/2\frac{1}{\sqrt{9 - x^2}} = (9 - x^2)^{-1/2}, derivative x(9−x2)3/2\frac{x}{(9 - x^2)^{3/2}}

  • If ee or a constant base bb raised to an expression → the exponential unchanged, times ln⁡b\ln b, times the derivative of the exponent

    Example: 5sin⁡x5^{\sin x} gives 5sin⁡xln⁡5cos⁡x5^{\sin x}\ln 5 \cos x

  • If sin⁡\sin, cos⁡\cos or tan⁡\tan of an expression other than xx → the trig derivative at the same expression, times its derivative

    Example: cos⁡(x3)\cos(x^3) gives −3x2sin⁡(x3)-3x^2\sin(x^3)

  • If a product of two factors, each a composition → product rule first, chain rule inside each factor, then factor out the lowest powers

    Example: (x2+1)3(2x−5)4(x^2 + 1)^3(2x - 5)^4 gives 2(x2+1)2(2x−5)3(10x2−15x+4)2(x^2 + 1)^2(2x - 5)^3(10x^2 - 15x + 4)

  • If a quotient raised to a power → chain rule outside, quotient rule for the inner derivative only

    Example: (2x+1x−3)5\left(\frac{2x + 1}{x - 3}\right)^5 gives −35(2x+1)4(x−3)6-\frac{35(2x + 1)^4}{(x - 3)^6}

  • If functions given only by a table or a graph → compute g(a)g(a) first, then read f′f' at g(a)g(a) and multiply by g′(a)g'(a)

    Example: g(1)=2g(1) = 2, f′(2)=5f'(2) = 5, g′(1)=4g'(1) = 4 give (f∘g)′(1)=20(f \circ g)'(1) = 20

    if g(a)g(a) is a corner of ff, the rule does not apply: compare one-sided slopes

Several branches can apply in turn: esin⁡(x2)e^{\sin(x^2)} takes the exponential branch, then the trig branch, then the power. Each branch you pass through adds one factor.

How the answer is expected to be written

A marker ticks steps. Here they are in order, with the concluding sentence expected word for word.

The chain rule from a table of values

When to use it: The statement gives ff, f′f', gg, g′g' at a few points and asks for (f∘g)′(a)(f \circ g)'(a), or for the derivative of f(x2)f(x^2), [g(x)]3[g(x)]^3, f(f(x))f(f(x))

  1. 1 Write the composite and the formula with the point: h′(a)=f′(g(a)) g′(a)h'(a) = f'(g(a))\,g'(a).
  2. 2 Compute the inner value g(a)g(a) as a NUMBER and write it down.
  3. 3 Read f′f' in the row of that number, not in the row of aa; read g′(a)g'(a) in the row of aa.
  4. 4 Multiply, and check the units or the sign if the context gives any.

Concluding sentence

“By the chain rule, h′(1)=f′(g(1)) g′(1)h'(1) = f'(g(1))\,g'(1). Since g(1)=2g(1) = 2, h′(1)=f′(2) g′(1)=5⋅4=20h'(1) = f'(2)\,g'(1) = 5 \cdot 4 = 20.”

The trap: Reading f′(1)f'(1) because the question says x=1x = 1: the outer derivative is read at g(1)g(1).

Marking: Typically 1 mark for the formula, 1 for g(a), 1 for the correct row, 1 for the product.

Tangent line to a composite curve

When to use it: Find the tangent to y=F(x)y = F(x) at x=ax = a when FF is a composition

  1. 1 Name the layers of FF and write F′(x)F'(x) in general, one factor per layer, factored.
  2. 2 Compute F(a)F(a) and F′(a)F'(a) separately, substituting only now.
  3. 3 Write y=F(a)+F′(a)(x−a)y = F(a) + F'(a)(x - a), and the normal with slope −1F′(a)-\frac{1}{F'(a)} if asked.
  4. 4 Check that the point lies on the line, and that the sign of the slope matches the graph.

Concluding sentence

“With u=x2−3u = x^2 - 3, y′=8x(x2−3)3y' = 8x(x^2 - 3)^3. At x=2x = 2, y=1y = 1 and y′=16y' = 16, so the tangent is y=16x−31y = 16x - 31.”

The trap: Substituting x=2x = 2 before differentiating: (22−3)4=1(2^2 - 3)^4 = 1 is a constant, and its derivative 00 is not the slope.

Check before you hand in

Five minutes of checking recover more marks than one more problem started in a hurry.

The typical problem, taken apart

A tangent line through three layers

Find the equation of the tangent line to y=(1+tan⁡πx4)3y = \left(1 + \tan\frac{\pi x}{4}\right)^3 at x=1x = 1.

No calculator. Give an exact slope, and justify every factor as on a MATH 140 final.

-1.5-1-0.50.511.55101520y = (1 + tan(πx/4))³(1, 8)x
The curve climbs steeply near x=1x = 1, where it passes through (1,8)(1, 8): the slope to find is large and positive, a check before any computation.

Step 1

Layers, from the outside in: the cube, then 1+tan⁡w1 + \tan w, then w=πx4w = \frac{\pi x}{4}. Three layers, so the derivative will have three factors.

Why

Listing the layers is the insurance against the missing factor, and markers read it as the method.

Step 2

y′=3(1+tan⁡πx4)2⋅sec⁡2πx4⋅π4y' = 3\left(1 + \tan\frac{\pi x}{4}\right)^2 \cdot \sec^2\frac{\pi x}{4} \cdot \frac{\pi}{4}.

Why

Each outer derivative keeps its inside untouched: the square keeps 1+tan⁡πx41 + \tan\frac{\pi x}{4}, the sec⁡2\sec^2 keeps πx4\frac{\pi x}{4}. The constant 11 has derivative 00 and leaves no factor.

Step 3

At x=1x = 1: tan⁡π4=1\tan\frac{\pi}{4} = 1 and sec⁡2π4=1cos⁡2(π/4)=2\sec^2\frac{\pi}{4} = \frac{1}{\cos^2(\pi/4)} = 2. So y(1)=23=8y(1) = 2^3 = 8 and y′(1)=3⋅4⋅2⋅π4=6πy'(1) = 3 \cdot 4 \cdot 2 \cdot \frac{\pi}{4} = 6\pi.

Why

Substitute only now, after the general derivative: substituting first would make the function a constant with derivative 00.

Step 4

Tangent: y=8+6π(x−1)y = 8 + 6\pi(x - 1).

Why

The exact slope is 6π6\pi; a decimal like 18.8518.85 would lose the exactness the course asks for.

Step 5

Check: the slope is positive and large, as the figure shows; and forgetting the factor π4\frac{\pi}{4} would give 2424, forgetting sec⁡2\sec^2 would give 3π3\pi.

Why

Naming what each forgotten factor would have produced is the fastest way to be sure none was forgotten.

The conclusion, written out

“With three layers, y′=3(1+tan⁡πx4)2sec⁡2πx4⋅π4y' = 3\left(1 + \tan\frac{\pi x}{4}\right)^2\sec^2\frac{\pi x}{4}\cdot\frac{\pi}{4}, so y′(1)=6πy'(1) = 6\pi and y(1)=8y(1) = 8: the tangent is y=8+6π(x−1)y = 8 + 6\pi(x - 1).”

The classic mistake on this problem: Writing y′=3(1+tan⁡πx4)2sec⁡2xy' = 3\left(1 + \tan\frac{\pi x}{4}\right)^2 \sec^2 x, with the inside of the secant changed and the factor π4\frac{\pi}{4} lost.

Learn by heart

  • • (f∘g)′(x)=f′(g(x)) g′(x)(f \circ g)'(x) = f'(g(x))\,g'(x): outer derivative AT g(x)g(x), times inner derivative.
  • • One factor per layer; count them.
  • • (un)′=nun−1u′(u^n)' = nu^{n-1}u', (u)′=u′2u(\sqrt u)' = \frac{u'}{2\sqrt u}, (eu)′=euu′(e^u)' = e^u u', (sin⁡u)′=cos⁡u⋅u′(\sin u)' = \cos u\cdot u'.
  • • (bx)′=bxln⁡b(b^x)' = b^x\ln b from bx=exln⁡bb^x = e^{x\ln b}; (xb)′=bxb−1(x^b)' = bx^{b-1}.
  • • Table: compute g(a)g(a) first, then read f′f' at g(a)g(a).
  • • (f∘g)′′=f′′(g) (g′)2+f′(g) g′′(f \circ g)'' = f''(g)\,(g')^2 + f'(g)\,g''.
  • • ddxf(kx+c)=k f′(kx+c)\frac{d}{dx}f(kx + c) = k\,f'(kx + c): a change of unit is a factor. Calculus works in radians.

Frequently asked questions

How do I know when to use the chain rule?

Whenever something other than x itself sits inside a function: a power of a bracket, a root of an expression, e to anything other than x, the sine of 2x. Read the expression as a calculator would evaluate it; if the last operation is applied to an expression rather than to x alone, that operation is the outer layer and the chain rule applies.

What is the inner function in the chain rule?

It is the expression that the outer function receives. In the square root of x cubed plus one, the outer function is the square root and the inner function is x cubed plus one. Name it u on the first line of your answer, differentiate the outer function at u without changing u, then multiply by the derivative of u.

How do I use the chain rule with a table of values?

For the derivative of f of g at a, first read g of a in the table and write it as a number. Then go to the row of that number to read the derivative of f, and multiply by the derivative of g read in the row of a. The most common error is reading the derivative of f in the row of a.

What is the derivative of 2 to the power x?

It is 2 to the power x times the natural logarithm of 2. Write 2 to the x as e to the power x times ln 2, where ln 2 is a constant, and apply the chain rule. The power rule does not apply, because the variable is in the exponent, not in the base.

Why do calculus formulas use radians and not degrees?

Because the derivative of sine is cosine only in radians. An angle of x degrees is pi x over 180 radians, so by the chain rule the derivative of the sine of x degrees is pi over 180 times the cosine. Radians are the unit in which that conversion factor is exactly 1.

Practise it

Corrected exercises: The chain rule, MATH 140 at McGill

A method is proved on a paper, not on a sheet. The set for the same chapter takes each of these traps into a problem, with the solution written out step by step.

  • 10 corrected exercises
  • 100 points
  • 150 minutes
Do the exercises
Previous sheet Derivatives of trigonometric functions Next sheet Implicit differentiation

© Ahmed Squalli Houssaini. Revision sheet published at www.letuteurscientifique.ca/en/fiches/math140-chain-rule. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

See also

Looking for a MATH 140 tutor in Montreal?

Get in touch for a first session. The chain rule is the rule every later chapter of MATH 140 relies on: implicit differentiation, related rates and optimization all start with it.

Site by Studio Squalli