impera Open Impera

AP Calculus BC · Differentiation: composite, implicit and inverse functions

The chain rule

1Composite functions

A composite function is a function inside another function: $f(g(x))$. Examples: $(3x + 1)^5$, $\sin(x^2)$, $e^{4x}$, $\ln(\cos x)$.

To differentiate these, we need the chain rule:

$$\frac{d}{dx}[f(g(x))] = f'(g(x)) \cdot g'(x)$$

In words: "derivative of the outside, keeping the inside the same, times the derivative of the inside."

In Leibniz notation, if $y = f(u)$ and $u = g(x)$:

$$\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}$$

Think of gears: if $y$ changes 3 times as fast as $u$, and $u$ changes 2 times as fast as $x$, then $y$ changes $3 \times 2 = 6$ times as fast as $x$.

Check yourself

For y = sin(x²), what is the inside function?

  • 2x

  • x²

  • sin x

  • sin

Show the answer

x²

The outside function is sine.

2Using the chain rule

Worked example

$y = (3x^2 + 1)^4$

  1. Outside: $u^4$, derivative $4u^3$. Inside: $u = 3x^2 + 1$, derivative $6x$.
  2. $y' = 4(3x^2 + 1)^3 \cdot 6x = 24x(3x^2 + 1)^3$.
Worked example

$y = \sqrt{5 - x^2} = (5 - x^2)^{1/2}$

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

Common patterns:

  • $\frac{d}{dx}[e^{g(x)}] = e^{g(x)} g'(x)$, e.g. $\frac{d}{dx}[e^{3x}] = 3e^{3x}$
  • $\frac{d}{dx}[\ln g(x)] = \frac{g'(x)}{g(x)}$, e.g. $\frac{d}{dx}[\ln(x^2 + 1)] = \frac{2x}{x^2 + 1}$
  • $\frac{d}{dx}[\sin(kx)] = k\cos(kx)$
  • $\frac{d}{dx}[\cos^2 x] = 2\cos x \cdot (-\sin x)$, since $\cos^2 x = (\cos x)^2$
Check yourself

d/dx [e^(5x)] =

  • 5xe^(5x − 1)

  • e⁵

  • e^(5x)

  • 5e^(5x)

Show the answer

5e^(5x)

Multiply by the inside derivative, 5.

3Multiple layers

Some functions have several layers. Work from the outside in, multiplying a derivative for each layer.

Worked example

$y = \sin^3(2x) = [\sin(2x)]^3$

  1. Outer layer (cube): $3[\sin(2x)]^2$.
  2. Middle layer (sine): $\cos(2x)$.
  3. Inner layer ($2x$): $2$.
  4. $y' = 3\sin^2(2x) \cdot \cos(2x) \cdot 2 = 6\sin^2(2x)\cos(2x)$.

The chain rule takes one derivative per layer, outside to inside, and multiplies them

Check yourself

d/dx [ln(sin x)] =

  • 1/sin x

  • cot x

  • tan x

  • cos x

Show the answer

cot x

cos x / sin x = cot x.

4Chain rule with other rules

The chain rule often combines with the product or quotient rule.

Worked example

$y = x^2 e^{-3x}$

  1. Product rule: $y' = 2x \cdot e^{-3x} + x^2 \cdot (-3e^{-3x})$.
  2. Factor: $y' = xe^{-3x}(2 - 3x)$.

Table questions: if $h(x) = f(g(x))$, then $h'(a) = f'(g(a)) \cdot g'(a)$. Find $g(a)$ first, then look up $f'$ at that value.

Worked example

$g(1) = 3$, $g'(1) = 2$, $f'(3) = -4$, $f'(1) = 7$.

  1. $h'(1) = f'(g(1)) \cdot g'(1) = f'(3) \cdot 2 = -8$.
  2. A common mistake is to use $f'(1) = 7$.
Check yourself

h(x) = f(g(x)), g(2) = 5, g′(2) = 3, f′(5) = 4, f′(2) = 1. h′(2) =

  • 4

  • 3

  • 12

  • 15

Show the answer

12

f′(g(2)) · g′(2) = f′(5) · 3.

5Going deeper: nested functions, tables and combining with other rules

The rule: for a composition $y = f(g(x))$,

$$\frac{dy}{dx} = f'(g(x)) \cdot g'(x)$$

"Differentiate the outside, leaving the inside alone; then multiply by the derivative of the inside." In Leibniz form: $\frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx}$.

Worked examples (one layer)

  1. $(3x^2 + 1)^5$: $5(3x^2 + 1)^4 \cdot 6x = 30x(3x^2 + 1)^4$.
  2. $\sin(x^2)$: $\cos(x^2) \cdot 2x$.
  3. $e^{-x^2}$: $e^{-x^2} \cdot (-2x)$.
  4. $\ln(\cos x)$: $\frac{1}{\cos x} \cdot (-\sin x) = -\tan x$.
  5. $\sqrt{4x + 1}$: $\frac{1}{2\sqrt{4x + 1}} \cdot 4 = \frac{2}{\sqrt{4x + 1}}$.
  6. $\cos(5x)$: $-5\sin(5x)$.

General patterns

  • $\frac{d}{dx}[u^n] = nu^{n-1}u'$.
  • $\frac{d}{dx}[e^u] = e^uu'$; $\frac{d}{dx}[a^u] = a^u(\ln a)u'$.
  • $\frac{d}{dx}[\ln u] = \frac{u'}{u}$.
  • $\frac{d}{dx}[\sin u] = (\cos u)u'$; $\frac{d}{dx}[\tan u] = (\sec^2u)u'$.

Nested (two or more layers): work from the outside in, multiplying as you go.

Worked example

$y = \sin^3(2x) = (\sin(2x))^3$.

  1. Power: $3(\sin 2x)^2$.
  2. Times derivative of sin(2x): $\cos(2x)$.
  3. Times derivative of 2x: 2.
  4. $y' = 6\sin^2(2x)\cos(2x)$.
Worked example

$y = e^{\sqrt{x^2 + 1}}$.

  1. $e^{\sqrt{x^2 + 1}} \cdot \frac{1}{2\sqrt{x^2 + 1}} \cdot 2x = \frac{xe^{\sqrt{x^2 + 1}}}{\sqrt{x^2 + 1}}$.

From a table: h(x) = f(g(x)), with g(1) = 3, g′(1) = 2, f(3) = 7, f′(3) = −4, f′(1) = 9.

  1. $h'(1) = f'(g(1)) \cdot g'(1) = f'(3) \cdot 2$.
  2. $= (-4)(2)$ = −8.
  3. The tempting error is to use f′(1): the outer derivative is evaluated at the inner function's value.

With the product rule

Worked example

$y = x^2e^{3x}$.

  1. $y' = 2xe^{3x} + x^2 \cdot 3e^{3x}$.
  2. $= xe^{3x}(2 + 3x)$.

With the quotient rule, or avoiding it: $y = \frac{1}{(2x + 1)^3} = (2x + 1)^{-3}$, so $y' = -3(2x + 1)^{-4}(2) = -\frac{6}{(2x + 1)^4}$.

Rates in context: if the radius of a balloon is r(t) and its volume $V = \frac{4}{3}\pi r^3$, then $\frac{dV}{dt} = 4\pi r^2\frac{dr}{dt}$. This is the chain rule, and the basis of related rates.

Tangent line: $y = \sqrt{x^2 + 9}$ at x = 4.

  1. y = 5.
  2. $y' = \frac{x}{\sqrt{x^2 + 9}} = \frac{4}{5}$.
  3. $y - 5 = \frac{4}{5}(x - 4)$.

Even and odd checks: the derivative of an even function is odd, and of an odd function, even: a quick way to catch sign errors.

Common mistakes

  • Forgetting the derivative of the inside.
  • Differentiating the inside inside the outer derivative: $\cos(2x)$ for the derivative of sin(x²).
  • Stopping after one layer in a nested function.
  • Using f′(x) where f′(g(x)) is needed.
  • Writing $\sin^3(2x)$ as $\sin(8x^3)$.
Check yourself

If h(x) = f(g(x)), g(2) = 5, g′(2) = 3 and f′(5) = 4, what is h′(2)?

  • 20

  • 12

  • 7

  • 15

Show the answer

12

h′(2) = f′(g(2)) · g′(2) = f′(5) · 3 = 12.

6For top marks

  • Identify the outside and inside functions explicitly before differentiating.
  • Do not forget the final "times the inside derivative"; it is the most common error.
  • For table questions, evaluate $g(a)$ first, then use $f'(g(a))$.
  • Rewrite roots and reciprocals as powers: $\frac{1}{(x^2 + 1)^3} = (x^2 + 1)^{-3}$.
Example

"$h'(1) = f'(g(1)) \cdot g'(1) = f'(3) \cdot 2 = (-4)(2) = -8$."

Check yourself

d/dx [1/(2x + 1)] =

  • −1/(2x + 1)²

  • 1/2

  • 2/(2x + 1)²

  • −2/(2x + 1)²

Show the answer

−2/(2x + 1)²

(2x + 1)⁻¹ gives −(2x + 1)⁻² · 2.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera