The Chain Rule

Subtopic: Differentiation

The chain rule differentiates compositions: if y y depends on u u and u u depends on x x, how does y y depend on x x? Multiply the rates. This simple principle handles nested functions, implicit differentiation, and related rates. It's essential whenever functions are built from other functions.

Introduction

You're driving. Your speed depends on the gear, and the gear depends on time. How does speed depend on time? Combine the effects: (change in speed per gear) ⋅ times (change in gear per time).

The chain rule makes this precise: the derivative of a composition is the product of the derivatives.

The Formula

If y=ƒ⁡(g⁡(x)) y equals f with hook of g of x, then:

dydx=dydu⋅dudx=ƒ′⁢(g⁡(x))⋅g⁡(x)′ d y over d x equals d y over d u times d u over d x equals f with hook prime times g of x times g of x prime

In words: differentiate the outer function (leaving the inner alone), then multiply by the derivative of the inner.

Leibniz notation makes it memorable: the du d u "cancel" (though this is just mnemonic, not rigorous).

Why It Works

Small changes propagate through compositions. If x x changes by Δx triangle x:

u=g⁡(x) u equals g of x changes by approximately g′⁢(x)⁢Δx g prime times x times triangle x.

y=ƒ⁡(u) y equals f with hook of u changes by approximately ƒ′⁢(u)×(change in ⁢u)=ƒ′⁢(g⁡(x))⁢g′⁢(x)⁢Δx f with hook prime times u times open paren change in u close paren equals f with hook prime times g of x times g prime times x times triangle x.

The rates multiply.

Worked Example 1

Differentiate y=(3⁢x+1)5 y equals open paren 3 x plus 1 close paren to the fifth power.

Let u=3⁢x+1 u equals 3 x plus 1, so y=u5 y equals u to the fifth power.

dydu=5⁢u4 d y over d u equals 5 u to the fourth power, and dudx=3 d u over d x equals 3.

dydx=5⁢u4⋅3=15⁢(3⁢x+1)4 d y over d x equals 5 u to the fourth power times 3 equals 15 times open paren 3 x plus 1 close paren to the fourth power

Multiple Compositions

For y=ƒ⁡(g⁡(h⁡(x))) y equals f with hook of g of h of x, apply chain rule multiple times:

dydx=ƒ′⁢(g⁡(h⁡(x)))⋅g′⁢(h⁡(x))⋅h′⁢(x) d y over d x equals f with hook prime times g of h of x times g prime times h of x times h prime times x

Peel off layers one at a time, multiplying derivatives.

Common Patterns

These follow directly from the chain rule:

  • dƒ⁡(x)ndx=n⁢ƒ⁡(x)n-1⁢ƒ′⁢(x) d f with hook of x to the n-th power over d x equals n f with hook of x raised to the n minus 1 power f with hook prime times x

  • deƒ⁡(x)dx=eƒ⁡(x)⁢ƒ′⁢(x) d e raised to the f with hook of x power over d x equals e raised to the f with hook of x power f with hook prime times x

  • dln⁡ƒ⁡(x)dx=ƒ′⁢(x)ƒ⁡(x) d l n f with hook of x over d x equals f with hook prime times x over f with hook of x

  • dsin⁡ƒ⁡(x)dx=cos⁡(ƒ⁡(x))⁢ƒ′⁢(x) d sine f with hook of x over d x equals cosine f with hook of x f with hook prime times x

Implicit Differentiation

The chain rule powers implicit differentiation. If y y is a function of x x, then:

dy2dx=2⁢y⁢dydx d y squared over d x equals 2 y d y over d x

The dydx d y over d x factor appears because we're differentiating a function of y y with respect to x x.

Related Rates

In related rates problems, quantities change with time. The chain rule connects their rates:

dVdt=dVdr⁢drdt d V over d t equals d V over d r d r over d t

If you know how volume depends on radius and how radius changes with time, you can find how volume changes with time.

Applications

In neural networks, back propagation applies the chain rule to compute gradients through many layers.

In physics, the chain rule relates velocities and accelerations in different coordinate systems.

In economics, it computes how changes in input prices affect output costs through intermediate goods.

Summary

The chain rule differentiates compositions: (ƒ∘g)′⁢(x)=ƒ′⁢(g⁡(x))⁢g′⁢(x) open paren f with hook composed with g close paren prime times x equals f with hook prime times g of x times g prime times x. In Leibniz notation: dydx=dydu⁢dudx d y over d x equals d y over d u d u over d x. Apply it from outside in: differentiate the outer function, then multiply by the derivative of the inner function. For multiple compositions, apply the rule repeatedly. The chain rule underlies implicit differentiation, related rates, and backpropagation.