Mathwords logoMathwords

Chain Rule

Chain Rule

A method for finding the derivative of a composition of functions. The formula is d/dx f(g(x)) = f'(g(x))g'(x). Another form of the chain rule is dy/dx = (dy/du)(du/dx).

 

Chain Rule formula: d/dx[f(g(x))]=f'(g(x))g'(x), with examples using (x²+5)⁸ showing step-by-step derivative calculations.

 

 

See also

Derivative rules

Key Formula

ddx[f(g(x))]=f(g(x))g(x)\frac{d}{dx}\big[f(g(x))\big] = f'(g(x)) \cdot g'(x)
Where:
  • ff = The outer function
  • gg = The inner function
  • f(g(x))f'(g(x)) = The derivative of the outer function, evaluated at the inner function
  • g(x)g'(x) = The derivative of the inner function

Worked Example

Problem: Find the derivative of y = (3x + 2)^5.
Step 1: Identify the outer and inner functions. The outer function is f(u) = u^5 and the inner function is g(x) = 3x + 2.
f(u)=u5,g(x)=3x+2f(u) = u^5, \quad g(x) = 3x + 2
Step 2: Differentiate the outer function with respect to u, then substitute the inner function back in for u.
f(u)=5u4f(g(x))=5(3x+2)4f'(u) = 5u^4 \quad \Rightarrow \quad f'(g(x)) = 5(3x + 2)^4
Step 3: Differentiate the inner function with respect to x.
g(x)=3g'(x) = 3
Step 4: Multiply the two results together using the chain rule formula.
dydx=5(3x+2)43=15(3x+2)4\frac{dy}{dx} = 5(3x+2)^4 \cdot 3 = 15(3x+2)^4
Answer: dy/dx = 15(3x + 2)^4

Another Example

This example uses a trigonometric outer function instead of a power function, showing how the chain rule applies to different types of compositions.

Problem: Find the derivative of y = sin(x^2).
Step 1: Identify the outer and inner functions. The outer function is f(u) = sin(u) and the inner function is g(x) = x^2.
f(u)=sin(u),g(x)=x2f(u) = \sin(u), \quad g(x) = x^2
Step 2: Differentiate the outer function and evaluate it at the inner function.
f(u)=cos(u)f(g(x))=cos(x2)f'(u) = \cos(u) \quad \Rightarrow \quad f'(g(x)) = \cos(x^2)
Step 3: Differentiate the inner function.
g(x)=2xg'(x) = 2x
Step 4: Apply the chain rule by multiplying the two derivatives.
dydx=cos(x2)2x=2xcos(x2)\frac{dy}{dx} = \cos(x^2) \cdot 2x = 2x\cos(x^2)
Answer: dy/dx = 2x cos(x²)

Frequently Asked Questions

When do you use the chain rule?
You use the chain rule whenever you need to differentiate a composite function — that is, a function inside another function. If you can describe your function as 'something of something,' such as sin(x²) or (2x + 1)^7, the chain rule is required. A quick test: if removing the inner part and replacing it with just x would give you a simpler standard derivative, you likely need the chain rule.
What is the difference between the chain rule and the product rule?
The chain rule handles compositions of functions (one function nested inside another), while the product rule handles the product of two functions multiplied together. For example, sin(x²) requires the chain rule because sin wraps around x², but x² · sin(x) requires the product rule because the two functions are multiplied side by side. Sometimes you need both rules in the same problem.
How do you apply the chain rule multiple times?
When you have three or more nested functions, you apply the chain rule repeatedly from the outermost layer inward. For example, to differentiate sin((2x)³), you first treat sin as the outermost function, then the cube, then 2x. The derivative is cos((2x)³) · 3(2x)² · 2. Each layer contributes a factor to the final product.

Chain Rule vs. Product Rule

Chain RuleProduct Rule
PurposeDifferentiates a composition f(g(x))Differentiates a product f(x) · g(x)
Formula[f(g(x))]' = f'(g(x)) · g'(x)[f · g]' = f' · g + f · g'
When to useOne function is nested inside anotherTwo functions are multiplied together
Examplesin(x²)x² · sin(x)
Number of terms in resultOne product (two factors)A sum of two terms

Why It Matters

The chain rule is one of the most frequently used differentiation rules in calculus. Nearly every real-world function involves compositions — for instance, modeling exponential decay as e^{-kt} or computing rates of change in physics with nested relationships like position as a function of time through velocity. Without it, you could only differentiate the most basic functions, and topics like implicit differentiation and related rates would be impossible.

Common Mistakes

Mistake: Forgetting to multiply by the derivative of the inner function.
Correction: The most common error is differentiating only the outer function and dropping g'(x). For example, writing the derivative of (3x + 2)^5 as 5(3x + 2)^4 instead of 15(3x + 2)^4. Always ask yourself: 'Did I multiply by the derivative of the inside?'
Mistake: Confusing when to use the chain rule versus the product rule.
Correction: If two functions are nested (one inside the other), use the chain rule. If two functions are multiplied side by side, use the product rule. For example, e^(x²) needs the chain rule, while e^x · x² needs the product rule.

Related Terms

  • DerivativeThe chain rule computes a specific type of derivative
  • CompositionThe chain rule applies to composed functions
  • FunctionThe building blocks that get composed
  • Derivative RulesThe chain rule is one of several derivative rules
  • FormulaThe chain rule is expressed as a formula
  • Product RuleOften confused with or used alongside the chain rule
  • Implicit DifferentiationRelies heavily on the chain rule
  • Power RuleOften combined with the chain rule for power compositions