How to Use the Chain Rule in Multivariable Calculus
At a glance
- 1. Identify the composition
Write down which variables depend on which other variables.
- 2. Differentiate each link
Find the relevant partial derivatives at each stage of the composition.
- 3. Multiply and add
Multiply along each dependency path, then add the contributions.
- 4. Substitute the point
Evaluate the derivatives at the corresponding input values.
The multivariable chain rule tells you how to differentiate a function whose inputs depend on other variables. The main idea is simple: follow every route by which a variable can affect the output, multiply the derivatives along that route, and add the results.
The basic formula
Suppose , where both and are differentiable functions of a parameter , and is differentiable at the corresponding point. Then also depends on , and
The partial derivatives of measure how changes when one input changes while the other is held fixed. The derivatives and describe how the inputs change with . Each product is one input’s contribution to the overall change in .
If is differentiable and each is differentiable, the same rule becomes
A worked example with two parameters
Let
Find and . First differentiate the outer function:
Then differentiate the inner functions:
Apply the chain rule separately for each parameter:
To evaluate these at , first find the corresponding outer inputs: and . Thus and . Therefore,
You can check by substitution: . Differentiating this expression directly also gives and at .
The same rule in Jacobian form
For differentiable functions with several outputs, use Jacobian matrices. If maps an input vector to an intermediate vector and maps that intermediate vector to an output, then
The order matters: the Jacobian of the outer function is evaluated at the output of the inner function, and it is multiplied on the left. This is the matrix version of multiplying derivatives along a dependency path and adding contributions that reach the same output.
For example, if and is scalar-valued, then
Their product is , giving the two partial-derivative formulas above.
A quick way to organize the calculation
For a longer composition, sketch a dependency diagram. For example, if and depend on , draw arrows from and to the intermediate variables they affect, then arrows from to . To find , follow only paths starting at . Multiply the derivatives on each path and add the path products. This is often easier to remember than trying to memorize a large formula.
If there is just one path, such as with , the rule reduces to the familiar single-variable form .
Common mistakes
- Leaving out an indirect effect: If affects both and , both terms belong in .
- Using ordinary derivatives for the wrong role: Use partial derivatives such as for the outer function, and derivatives such as for the inner functions.
- Substituting too early: Keep the variables symbolic until you have formed the chain-rule expression. Then substitute the corresponding intermediate values.
- Reversing Jacobian order: For , the product is , not the reverse.
- Confusing partial and total change: A partial derivative of holds its other input fixed. The derivative of a composition includes all changing inputs through the chain rule.
References
- Calculus: Early Transcendentals, James Stewart
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.