What the formula says
d/dx f(g(x)) = f′(g(x)) · g′(x)
The chain rule differentiates a composite function, one function inside another. g is the inner
function and f the outer one. The derivative is the outer derivative, taken at the inner function, times
the inner derivative. The rule is a theorem.
What sets the chain rule apart from the product rule is that the two functions do not stand side by side but one inside the other. sin(x) · x² needs the product rule; sin(x²) needs the chain rule. Run backwards, the chain rule is integration by substitution.
Worked examples
sin(x² + 1). The inner function is g(x) = x² + 1 with g′(x) = 2x. The outer one is sin, with derivative cos.
- d/dx sin(x² + 1) = cos(x² + 1) · 2x.
- At x = 1.3: cos(2.69) · 2.6 ≈ −2.339.
(2x + 1)³. The inner function is 2x + 1 with derivative 2. The outer one is u³, with derivative 3u².
- d/dx (2x + 1)³ = 3(2x + 1)² · 2 = 6(2x + 1)².
- At x = 1: 6 · 9 = 54. Without the inner derivative the answer would have been 27, half. The difference is the factor that was forgotten.
A linear inner function. d/dx f(3x) = 3 · f′(3x). That is why the derivative of eˣ becomes 3e^(3x) when the exponent is 3x.
Common mistakes
- Forgetting the inner derivative. A common mistake, and the one the (2x + 1)³ example shows: the answer is off by exactly the factor g′(x).
- Taking the outer derivative at x. f′(x) · g′(x) is wrong. The outer derivative is taken at the inner function: cos(x² + 1), not cos x.
- Multiplying by g(x) instead of g′(x). What gets multiplied is the inner function’s derivative, not the function itself.
Common questions
When do you use the chain rule?
Whenever something other than plain x sits where a function expects its argument: inside a bracket that
is raised to a power, in an exponent, under a root sign or inside sin, cos or ln.
How do you tell which function is inner and which is outer?
Think about how you would work out the value for a given x. What you work out first is the inner
function, what you do last is the outer. In sin(x² + 1) you work out x² + 1 first and take the sine
last.
Can you use the chain rule more than once?
Yes, once for each layer. sin(e^(x²)) has three: sin outermost, e^u in the middle and x² innermost. The
derivative is cos(e^(x²)) · e^(x²) · 2x, one factor per layer.
To see the rule applied to your own function, step by step, there is the derivative calculator.