← MATH 161 MathScape 0 MATH161

Applying the Chain Rule

5 min read

Jump to a section
Reference: Stewart §2.5

Textbook Reference

Primary source OpenStax Calculus Volume 1, Section 3.6: “The Chain Rule”
Book URL https://openstax.org/details/books/calculus-volume-1

Freely available and openly licensed.


Try This First

Estimate $\dfrac{d}{dx}[\sin(2x)]\big|_{x=0}$ without computing it formally.

Think: $\sin(2x)$ oscillates twice as fast as $\sin(x)$. If $\sin x$ has slope $\cos(0) = 1$ at $x = 0$, what should $\sin(2x)$ have?

Predicted slope: $\underline{\hspace{2cm}}$.

Now compute it using the chain rule: $\dfrac{d}{dx}[\sin(2x)] = \cos(2x) \cdot 2$. At $x = 0$: $\cos(0) \cdot 2 = 2$.

Does your prediction match? The factor of 2 from the inner derivative is exactly the “twice as fast” doubling.


Prerequisite Check

Before this lesson, make sure you can do all of the following:


Quick Reference

The Chain Rule: \[ \frac{d}{dx}[f(g(x))] = f'(g(x)) \cdot g'(x). \]

Step-by-step procedure:

  1. Identify outer $f$ and inner $g$.
  2. Differentiate the outer function at the inner: $f'(g(x))$.
  3. Multiply by the derivative of the inner: $g'(x)$.

Leibniz notation: If $y = f(u)$ and $u = g(x)$: \[ \frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}. \]


Key Concepts

1. Single Composition: Standard Examples

Example 1. Differentiate $h(x) = (3x + 2)^5$.

Outer: $f(t) = t^5$ so $f'(t) = 5t^4$. Inner: $g(x) = 3x+2$ so $g'(x) = 3$.

$h'(x) = 5(3x+2)^4 \cdot 3 = 15(3x+2)^4$.

Example 2. Differentiate $h(x) = \sin(x^2)$.

Outer: $\sin$, inner: $x^2$.

$h'(x) = \cos(x^2) \cdot 2x = 2x\cos(x^2)$.

Example 3. Differentiate $h(x) = e^{\cos x}$.

Outer: $e^t$, inner: $\cos x$.

$h'(x) = e^{\cos x} \cdot (-\sin x) = -\sin x\, e^{\cos x}$.

Example 4. Differentiate $h(x) = \sqrt{5x^2 - 3}$.

Outer: $\sqrt{t} = t^{1/2}$, inner: $5x^2 - 3$.

$h'(x) = \frac{1}{2}(5x^2-3)^{-1/2} \cdot 10x = \frac{5x}{\sqrt{5x^2-3}}$.


2. Nested Composites (Chain Rule Twice)

When $h(x) = f(g(p(x)))$ -- three nested functions -- differentiate from outside in, each step introducing another “inner” factor.

Example 5. Differentiate $h(x) = \sin^4(3x)$.

Identify layers: outermost is $(\cdot)^4$, middle is $\sin(\cdot)$, innermost is $3x$.

Step 1 (outermost): $\frac{d}{dt}[t^4] = 4t^3$ evaluated at $t = \sin(3x)$: gives $4\sin^3(3x)$.

Step 2 (middle): $\frac{d}{du}[\sin u] = \cos u$ at $u = 3x$: gives $\cos(3x)$.

Step 3 (innermost): $\frac{d}{dx}[3x] = 3$.

Combined: $h'(x) = 4\sin^3(3x) \cdot \cos(3x) \cdot 3 = 12\sin^3(3x)\cos(3x)$.


3. Chain Rule Combined with Product and Quotient Rules

Example 6. Differentiate $f(x) = x^2 \sin(3x)$.

Product rule: $f'(x) = 2x\sin(3x) + x^2 \cdot \cos(3x) \cdot 3 = 2x\sin(3x) + 3x^2\cos(3x)$.

Factor: $f'(x) = x[2\sin(3x) + 3x\cos(3x)]$.

Example 7. Differentiate $g(x) = \dfrac{e^{2x}}{x^2 + 1}$.

Quotient rule: $g'(x) = \dfrac{2e^{2x}(x^2+1) - e^{2x} \cdot 2x}{(x^2+1)^2} = \dfrac{2e^{2x}(x^2 - x + 1)}{(x^2+1)^2}$.


4. Multiple Representations: Leibniz Notation

The Leibniz form $\dfrac{dy}{dx} = \dfrac{dy}{du} \cdot \dfrac{du}{dx}$ clarifies the chain rule by making the cancellation look like a fraction.

Example 8. Let $y = u^3$ where $u = 3x + 1$.

$\dfrac{dy}{du} = 3u^2$. $\dfrac{du}{dx} = 3$.

$\dfrac{dy}{dx} = 3u^2 \cdot 3 = 9u^2 = 9(3x+1)^2$.

The $du$ “cancels” (not a real cancellation -- the notation models the chain rule pattern): \[ \frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}. \]

This notation is especially useful in integration by substitution, where you deliberately introduce an inner function $u = g(x)$ and use $du = g'(x)\,dx$.


5. Ask Why: Why Must We Multiply by the Inner Derivative?

The chain rule corrects for a “speed mismatch.” If $g(x)$ is changing 3 times as fast as $x$ (i.e., $g'(x) = 3$), then as $x$ changes by $\Delta x$, the input to $f$ changes by approximately $3\Delta x$. The output of $f$ changes by $f'(g(x)) \cdot 3\Delta x$. Dividing by $\Delta x$: the rate of change is $f'(g(x)) \cdot 3 = f'(g(x)) \cdot g'(x)$.

Without the inner derivative: you would be computing how fast $f$ responds to changes in $u$, but forgetting to account for how fast $u$ itself is changing with $x$.


Named Misconception: Forgetting the Inner Derivative

The most common chain-rule error is computing $f'(g(x))$ and stopping, without multiplying by $g'(x)$.

Wrong: $\dfrac{d}{dx}[\sin(x^2)] = \cos(x^2)$.

Right: $\dfrac{d}{dx}[\sin(x^2)] = \cos(x^2) \cdot 2x$.

The inner derivative $g'(x)$ is always required. It represents the rate of change of the “input pipeline” and cannot be omitted.


Common Errors

Error Example Correction
Omitting inner derivative $(\sin(x^2))' = \cos(x^2)$ Multiply by $g'(x) = 2x$: answer is $2x\cos(x^2)$
Evaluating outer derivative at wrong place $(e^{x^2})' = e^x \cdot 2x$ Outer derivative $e^t$ is evaluated at $t = x^2$: $(e^{x^2})' = e^{x^2} \cdot 2x$
Applying chain rule to a product $(x\sin x)' = \cos(x) \cdot 1 = \cos x$ $x\sin x$ is a product, not a composition; use product rule: $\sin x + x\cos x$


Common Misconceptions

Common misconception

the derivative of f(g(x)) is f’(x) times g’(x).

This is the composition-is-not-chaining error. The outer derivative must be evaluated at the inner function, not at x. The formula is $f'(g(x)) \cdot g'(x)$, where $f'$ is applied to $g(x)$ as its argument. For $h(x) = e^{x^2}$, the outer derivative is $e^t$ evaluated at $t = x^2$, giving $e^{x^2}$, not $e^x$. The correct derivative is $e^{x^2} \cdot 2x$; writing $e^x \cdot 2x$ is the composition-is-not-chaining error and is numerically wrong at every $x \neq 0$.

Common misconception

a product of two functions involving the same variable is the same as a composition.

This is a structural identification error. The chain rule applies to $f(g(x))$, where one function’s output is the other’s input. The product $x \cdot \sin x$ is not a composition: no single function acts on the output of another. Applying the chain rule to $x \sin x$ and writing $\cos(x) \cdot 1$ ignores the factor $x$ entirely and produces the wrong rule; the product rule gives $\sin x + x\cos x$.


Leveled Practice

Level 1 -- Single Chain Rule

Problem 1. Differentiate: (a) $(4x-1)^6$, (b) $\cos(3x)$, (c) $e^{-x^2}$.

Show answer

(a) $6(4x-1)^5 \cdot 4 = 24(4x-1)^5$.

(b) $-\sin(3x) \cdot 3 = -3\sin(3x)$.

(c) $e^{-x^2} \cdot (-2x) = -2xe^{-x^2}$.


Problem 2. Differentiate $h(x) = \ln(x^2 + 4)$.

Show answer

Outer: $\ln t$, derivative $1/t$. Inner: $x^2 + 4$, derivative $2x$.

$h'(x) = \dfrac{1}{x^2+4} \cdot 2x = \dfrac{2x}{x^2+4}$.


Level 2 -- Combined Rules

Problem 3. Differentiate $f(x) = x^3\cos(x^2)$.

Show answer

Product rule: $f'(x) = 3x^2\cos(x^2) + x^3 \cdot (-\sin(x^2)) \cdot 2x = 3x^2\cos(x^2) - 2x^4\sin(x^2)$.

Factor: $x^2[3\cos(x^2) - 2x^2\sin(x^2)]$.


Problem 4. Differentiate $g(x) = \sqrt{\dfrac{x+1}{x-1}}$.

Show answer

Let $u = (x+1)/(x-1)$. Then $g = u^{1/2}$ and $g'(x) = \frac{1}{2}u^{-1/2} \cdot u'$.

$u' = \dfrac{(x-1) - (x+1)}{(x-1)^2} = \dfrac{-2}{(x-1)^2}$.

$g'(x) = \dfrac{1}{2}\left(\dfrac{x-1}{x+1}\right)^{1/2} \cdot \dfrac{-2}{(x-1)^2} = \dfrac{-1}{(x-1)^{3/2}(x+1)^{1/2}}$.


Level 3 -- Low-Floor-High-Ceiling Extension

Problem 5 (Extension).

(a) (Floor) Differentiate $y = e^{5x}$ using the chain rule and verify your answer makes sense for $x = 0$ (the slope of $y = e^{5x}$ at the origin should be 5, since the graph rises 5 times faster than $y = e^x$).

(b) (Mid) Find a formula for $\dfrac{d}{dx}[f(ax + b)]$ in terms of $f'$ and $a$. Interpret: if $f$ is a given function and you “compress” its input by a factor of $a$, what happens to the slope?

(c) (Ceiling) The derivative of $\sin(g(x))$ is $\cos(g(x)) \cdot g'(x)$. Use this to derive a formula for $\dfrac{d}{dx}[\sin^n(g(x))]$ (i.e., apply the chain rule twice). Then differentiate $\sin^3(2x^2)$ using your formula.

Show answer

(a) $y' = e^{5x} \cdot 5$. At $x = 0$: $y'(0) = e^0 \cdot 5 = 5$. The slope is 5 at the origin. The graph of $e^{5x}$ rises 5 times as steeply as $e^x$ near $x = 0$.

(b) $\frac{d}{dx}[f(ax+b)] = f'(ax+b) \cdot a$. Compressing input by $a$ multiplies the slope by $a$. A function that varies faster in $x$ has a proportionally larger derivative.

(c) Apply chain rule twice: outer $t^n$, middle $\sin(\cdot)$, inner $g(x)$.

$\frac{d}{dx}[\sin^n(g(x))] = n\sin^{n-1}(g(x)) \cdot \cos(g(x)) \cdot g'(x)$.

For $\sin^3(2x^2)$: $n = 3$, $g(x) = 2x^2$, $g'(x) = 4x$.

$= 3\sin^2(2x^2)\cos(2x^2) \cdot 4x = 12x\sin^2(2x^2)\cos(2x^2)$.


Mastery Checklist

You have mastered this skill when you can do all of the following without referring to notes:


Mental Model

The chain rule accounts for a cascade of rates. If the inner machine $g$ is running at speed $g'(x)$, and the outer machine $f$ converts its input at speed $f'(u)$ (where $u = g(x)$), then the combined speed is $f'(g(x)) \cdot g'(x)$.

Think of two gears: the first gear turns at $g'(x)$ RPM and drives a second gear that amplifies by $f'$ RPM per RPM. Total output speed: $f'(g(x)) \cdot g'(x)$.

The most important practice habit: write the outer derivative and the inner derivative as separate factors before combining them. “Derivative of outside, times derivative of inside” -- say this aloud as a checklist.


Connections

Within Calculus I (MATH161)


Back to Calculus I Skills | Previous: Identifying Composite Functions | Next: Implicit Differentiation