Navigation

The Derivative & Its Rules · Topic 09 of 23

The Chain Rule

To differentiate a composite, differentiate the outside with the inside left alone, then multiply by the derivative of the inside: (fg)(x)=f(g(x))g(x)(f\circ g)'(x)=f'(g(x))\,g'(x). The factor g(x)g'(x) is the one students drop: when the inside is anything but plain xx, an answer to ddxf(u)\frac{d}{dx}f(u) with no uu' in it is wrong.

4 min readCore — on every final8 formulas6 quick checks
01

Key ideas

5 things to remember
  1. 1

    Outside derivative times inside derivative

    For F(x)=f(g(x))F(x)=f(g(x)), differentiate the outer function with the inside left exactly as it is, then multiply by the derivative of the inside: F(x)=f(g(x))g(x)F'(x)=f'(g(x))\,g'(x). Multiply — never add.

  2. 2

    Find the outer function first

    Ask which operation you would perform last when evaluating the expression: that is the outer function, and everything it acts on is the inside uu. sin(x3)\sin(x^3) has outer sin\sin; sin3x=(sinx)3\sin^3x=(\sin x)^3 has outer cube.

  3. 3

    Feed ff' the inside, not xx

    The outer derivative is evaluated at the output of the inner function: ddxsin(x2)=2xcos(x2)\frac{d}{dx}\sin(x^2)=2x\cos(x^2), not 2xcosx2x\cos x. In a table question (fg)(1)=f(g(1))g(1)(f\circ g)'(1)=f'(g(1))\,g'(1) — read ff' at g(1)g(1), not at 11.

  4. 4

    One factor per layer

    For nested compositions peel from the outside in: ddxsin3(4x)=3sin2(4x)cos(4x)4\frac{d}{dx}\sin^3(4x)=3\sin^2(4x)\cdot\cos(4x)\cdot4. Every layer contributes exactly one factor; stop when what is left inside is xx itself.

  5. 5

    The outermost operation picks the rule

    A product on the outside means product rule first, chain rule inside each factor; a power of a fraction means chain rule first, quotient rule inside. Compare (3x1x+2)4\big(\frac{3x-1}{x+2}\big)^4 with (3x1)4x+2\frac{(3x-1)^4}{x+2}.

−π−π/2π/2π-11xyy = sin xy = sin 3xtangent to sin 3x: slope 3tangent to sin x: slope 1
Compressing sinx\sin x into sin3x\sin 3x keeps the amplitude but triples every slope: the tangents at the origin have slopes 11 and 33. Forgetting the inside derivative gives cos3x\cos 3x, which at x=0x=0 is the slope of the wrong curve.
-2-112-2-112xy(√2, 2), y′ = 0(−√2, −2), y′ = 0vertical tangentvertical tangenty = x√(4 − x²)
y=x4x2y=x\sqrt{4-x^2} has y=42x24x2y'=\frac{4-2x^2}{\sqrt{4-x^2}} (product rule, chain rule on the root). The numerator is 00 at x=±2x=\pm\sqrt2: horizontal tangents. At x=±2x=\pm2 the inside of the root is 00, where u\sqrt u has no derivative, and the curve ends in vertical tangents.
02

Formulas

What to have memorised
  • Chain rule

    (fg)(x)=f(g(x))g(x)(f\circ g)'(x)=f'\big(g(x)\big)\cdot g'(x)

    ff' is evaluated at the inside g(x)g(x), never at xx.

  • Leibniz form

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

    Evaluate dydu\frac{dy}{du} at u=g(x)u=g(x); the answer must end up in terms of xx.

  • General power rule

    ddxun=nun1u\frac{d}{dx}\,u^{n}=n\,u^{n-1}\,u'

    Non-integer nn needs u>0u>0 — which is why u\sqrt{u} fails where u=0u=0.

  • Linear inside

    ddxf(ax+b)=af(ax+b)\frac{d}{dx}\,f(ax+b)=a\,f'(ax+b)

    The workhorse: sin3x3cos3x\sin 3x\to 3\cos 3x, e4x4e4xe^{-4x}\to -4e^{-4x}.

  • Square root

    ddxu=u2u\frac{d}{dx}\sqrt{u}=\frac{u'}{2\sqrt{u}}

    Valid for u>0u>0 only; where u=0u=0 the graph has a vertical tangent.

  • Trig templates

    ddxsinu=cosuu,ddxcosu=sinuu\frac{d}{dx}\sin u=\cos u\cdot u',\qquad \frac{d}{dx}\cos u=-\sin u\cdot u'

    The plain rules with uu' tacked on; likewise ddxtanu=sec2uu\frac{d}{dx}\tan u=\sec^2u\cdot u'.

  • Exponential and log templates

    ddxeu=euu,ddxlnu=uu\frac{d}{dx}e^{u}=e^{u}\,u',\qquad \frac{d}{dx}\ln u=\frac{u'}{u}

    lnu\ln u needs u>0u>0. Never use the power rule on a variable exponent.

  • Three layers

    dydx=dydududvdvdx\frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dv}\cdot\frac{dv}{dx}

    One factor per layer; peel from the outside in until only xx remains.

03

Differentiate a composite function

The steps, in order
  1. 1

    Name the outermost operation — the last key you would press. That is the outer function; everything inside it is uu.

  2. 2

    If the outermost operation is a product or quotient, apply that rule first and use the chain rule on each factor as needed.

  3. 3

    Differentiate the outer function with uu left untouched, then multiply by uu'. Write f(u)uf'(u)\cdot u' on its own line before simplifying.

  4. 4

    If uu is itself a composite, repeat: one factor per layer, until the innermost piece is xx.

  5. 5

    Substitute u=g(x)u=g(x) back so the answer is in xx, factor out common powers, and state any restriction (u>0u>0 under a root or log).

  6. 6

    To evaluate at x=ax=a: compute the inside g(a)g(a) first, feed that number to ff', then multiply by g(a)g'(a).

04

Watch out

The mistakes that cost marks
  • ✗ Wrong

    ddxsin(3x)=cos(3x)\frac{d}{dx}\sin(3x)=\cos(3x)

    ✓ Right

    ddxsin(3x)=3cos(3x)\frac{d}{dx}\sin(3x)=3\cos(3x)

    Why: The inside derivative is a factor even when the inside is only 3x3x.

  • ✗ Wrong

    ddxsin(x2)=2xcosx\frac{d}{dx}\sin(x^2)=2x\cos x

    ✓ Right

    ddxsin(x2)=2xcos(x2)\frac{d}{dx}\sin(x^2)=2x\cos(x^2)

    Why: The outer derivative is evaluated at the inside x2x^2, not at xx.

  • ✗ Wrong

    ddx(x2+1)3=3(x2+1)2+2x\frac{d}{dx}(x^2+1)^3=3(x^2+1)^2+2x

    ✓ Right

    ddx(x2+1)3=3(x2+1)22x=6x(x2+1)2\frac{d}{dx}(x^2+1)^3=3(x^2+1)^2\cdot2x=6x(x^2+1)^2

    Why: The chain rule multiplies; it never adds.

  • ✗ Wrong

    ddxe5x=5xe5x1\frac{d}{dx}e^{5x}=5x\,e^{5x-1}

    ✓ Right

    ddxe5x=5e5x\frac{d}{dx}e^{5x}=5e^{5x}

    Why: The power rule is for xnx^n; a variable in the exponent is an exponential.

  • ✗ Wrong

    ddxcos2x=sin2x\frac{d}{dx}\cos^2x=-\sin^2x

    ✓ Right

    ddxcos2x=2cosx(sinx)=2sinxcosx\frac{d}{dx}\cos^2x=2\cos x\cdot(-\sin x)=-2\sin x\cos x

    Why: cos2x\cos^2x means (cosx)2(\cos x)^2: the outer function is the square.

  • ✗ Wrong

    ddx[xsin(2x)]=sin(2x)+xcos(2x)\frac{d}{dx}\big[x\sin(2x)\big]=\sin(2x)+x\cos(2x)

    ✓ Right

    ddx[xsin(2x)]=sin(2x)+2xcos(2x)\frac{d}{dx}\big[x\sin(2x)\big]=\sin(2x)+2x\cos(2x)

    Why: The chain rule still applies inside the product rule.

05

Quick check

Commit to an answer before you reveal one
  1. Q1easy

    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^4x

    Hint

    For (d), write cos4x=(cosx)4\cos^4x=(\cos x)^4 before deciding what is outside — it is not cos(x4)\cos(x^4).

    Show answer

    Answer

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

    Steps

    (a) u=5x2u=5x^2, u=10xu'=10x, outer sinu\sin u: y=cos(5x2)10xy'=\cos(5x^2)\cdot10x.

    (b) u=4xu=-4x, u=4u'=-4, outer eue^u: y=e4x(4)y'=e^{-4x}\cdot(-4).

    (c) u=7x+2u=7x+2, u=7u'=7, outer u\sqrt u: y=127x+27y'=\dfrac{1}{2\sqrt{7x+2}}\cdot7. The root needs u>0u>0, so the formula holds for x>27x>-\frac27; at x=27x=-\frac27 the graph starts with a vertical tangent.

    (d) u=cosxu=\cos x, u=sinxu'=-\sin x, outer u4u^4: y=4cos3x(sinx)=4sinxcos3xy'=4\cos^3x\cdot(-\sin x)=-4\sin x\cos^3x.

  2. Q2easy

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

    Hint

    The inside is linear, so its derivative is just the constant 44 — but it must still appear as a factor.

    Show answer

    Answer

    f(x)=40(4x+7)9f'(x)=40(4x+7)^{9}; f(1)=4039=787320f'(-1)=40\cdot3^{9}=787\,320.

    Steps

    u=4x+7u=4x+7, u=4u'=4, outer u10u^{10}:

    f(x)=10(4x+7)94=40(4x+7)9f'(x)=10(4x+7)^{9}\cdot4=40(4x+7)^{9}

    At x=1x=-1 the inside is 4(1)+7=34(-1)+7=3, so f(1)=4039=4019683=787320f'(-1)=40\cdot3^{9}=40\cdot19\,683=787\,320. Without the factor 44 the answer would be 196830196\,830 — a quarter of the true slope.

  3. Q3medium

    ff and gg are differentiable with

    • f(1)=3f(1)=3, f(1)=4f'(1)=4, g(1)=2g(1)=2, g(1)=5g'(1)=5
    • f(2)=1f(2)=1, f(2)=6f'(2)=6, g(2)=3g(2)=3, g(2)=2g'(2)=-2
    • f(3)=2f(3)=2, f(3)=7f'(3)=7, g(3)=1g(3)=1, g(3)=8g'(3)=8

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

    Hint

    Write (fg)(a)=f(g(a))g(a)(f\circ g)'(a)=f'(g(a))\,g'(a) in symbols first, then look up the numbers — ff' is read at g(a)g(a), not at aa.

    Show answer

    Answer

    (a) 3030 (b) 3232 (c) 2424 (d) 1414

    Steps

    (a) (fg)(1)=f(g(1))g(1)=f(2)5=65=30(f\circ g)'(1)=f'(g(1))\,g'(1)=f'(2)\cdot5=6\cdot5=30.

    (b) (gf)(1)=g(f(1))f(1)=g(3)4=84=32(g\circ f)'(1)=g'(f(1))\,f'(1)=g'(3)\cdot4=8\cdot4=32.

    (c) (ff)(2)=f(f(2))f(2)=f(1)6=46=24(f\circ f)'(2)=f'(f(2))\,f'(2)=f'(1)\cdot6=4\cdot6=24.

    (d) p(x)=f(2x1)2p'(x)=f'(2x-1)\cdot2, so p(2)=2f(3)=27=14p'(2)=2f'(3)=2\cdot7=14.

    The trap in (a) is writing f(1)g(1)=20f'(1)\,g'(1)=20: the outer derivative must be read at the output g(1)=2g(1)=2.

  4. Q4medium

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

    Hint

    Three layers — exponential, root, x2+1x^2+1. Start at the outside and collect one factor per layer.

    Show answer

    Answer

    dydx=xex2+1x2+1\dfrac{dy}{dx}=\dfrac{x\,e^{\sqrt{x^2+1}}}{\sqrt{x^2+1}}; y(3)=32e2y'(\sqrt3)=\dfrac{\sqrt3}{2}e^{2}.

    Steps

    Outer e()e^{(\cdot)}, middle \sqrt{\cdot}, inner x2+1x^2+1:

    dydx=ex2+112x2+12x=xex2+1x2+1\frac{dy}{dx}=e^{\sqrt{x^2+1}}\cdot\frac{1}{2\sqrt{x^2+1}}\cdot2x=\frac{x\,e^{\sqrt{x^2+1}}}{\sqrt{x^2+1}}

    Valid for every xx, since x2+11x^2+1\ge1 keeps the root away from 00.

    At x=3x=\sqrt3: x2+1=4x^2+1=4 and 4=2\sqrt4=2, so y(3)=3e226.40y'(\sqrt3)=\dfrac{\sqrt3\,e^{2}}{2}\approx6.40. Sanity check: yy is even, so yy' must be odd — and the formula gives y(0)=0y'(0)=0.

  5. Q5medium

    Differentiate y=(3x1x+2)4y=\left(\dfrac{3x-1}{x+2}\right)^{4}, simplify to a single fraction, and evaluate y(1)y'(1).

    Hint

    The last operation is the fourth power, so the chain rule fires first; the quotient rule is needed only for uu'.

    Show answer

    Answer

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

    Steps

    u=3x1x+2u=\dfrac{3x-1}{x+2}, by the quotient rule:

    u=3(x+2)(3x1)(x+2)2=7(x+2)2u'=\frac{3(x+2)-(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)5y'=4u^{3}\,u'=4\left(\frac{3x-1}{x+2}\right)^{3}\cdot\frac{7}{(x+2)^2}=\frac{28(3x-1)^3}{(x+2)^5}

    At x=1x=1: 282335=2242430.922\dfrac{28\cdot2^3}{3^5}=\dfrac{224}{243}\approx0.922. Check by rewriting y=(3x1)4(x+2)4y=(3x-1)^4(x+2)^{-4} and using the product rule: 4(3x1)3(x+2)5[3(x+2)(3x1)]4(3x-1)^3(x+2)^{-5}\,[3(x+2)-(3x-1)], the same expression.

  6. Q6hard

    Let y=x4x2y=x\sqrt{4-x^2}. Find dydx\dfrac{dy}{dx} as a single fraction, state where the formula is valid and what happens at the ends, and find every point on the curve where the tangent is horizontal.

    Hint

    Product rule first, chain rule on the root, then one denominator before setting anything to zero.

    Show answer

    Answer

    dydx=42x24x2\dfrac{dy}{dx}=\dfrac{4-2x^2}{\sqrt{4-x^2}} on 2<x<2-2<x<2, with vertical tangents at x=±2x=\pm2. Horizontal tangents at (2,2)(\sqrt2,\,2) and (2,2)(-\sqrt2,\,-2).

    Steps

    Domain: 4x204-x^2\ge0, so 2x2-2\le x\le2. Product rule, with ddx4x2=2x24x2=x4x2\dfrac{d}{dx}\sqrt{4-x^2}=\dfrac{-2x}{2\sqrt{4-x^2}}=\dfrac{-x}{\sqrt{4-x^2}}:

    dydx=4x2x24x2=(4x2)x24x2=42x24x2\frac{dy}{dx}=\sqrt{4-x^2}-\frac{x^2}{\sqrt{4-x^2}}=\frac{(4-x^2)-x^2}{\sqrt{4-x^2}}=\frac{4-2x^2}{\sqrt{4-x^2}}

    Valid only where the inside of the root is positive, 2<x<2-2<x<2: u\sqrt u has no derivative at u=0u=0. At x=±2x=\pm2 the numerator is 4-4 while the denominator 0+\to0^+, so yy'\to-\infty — vertical tangents at both ends.

    Horizontal tangent: numerator 42x2=04-2x^2=0, so x=±2x=\pm\sqrt2, both inside (2,2)(-2,2). y(2)=22=2y(\sqrt2)=\sqrt2\cdot\sqrt2=2 and y(2)=2y(-\sqrt2)=-2.

06

On the exam

How this topic is marked
  • Markers look for the inside-derivative factor. Write uu and uu' before you differentiate, and show f(u)uf'(u)\cdot u' on one line before simplifying.

  • For a value at x=ax=a, compute the inside g(a)g(a) first and read ff' there; a bare f(a)f'(a) in a table question loses the mark.

  • Factor the final answer and state where it is valid — a root or a log inside needs u>0u>0; that sentence is often a mark of its own.

Keep going