01 / 21

Multivariable
Chain Rule

Learn how to differentiate composite functions of several variables, build dependency trees, and apply the chain rule to real-world problems in Calculus 3.

Calculus 3

Why Do We Need a Chain Rule?

In single-variable calculus, the chain rule lets us differentiate compositions like \( f(g(x)) \). But in multivariable calculus, a function's inputs can themselves depend on multiple variables.

For example, if temperature \( T \) depends on position \( (x, y) \), and position depends on time \( t \), how does \( T \) change with respect to \( t \)?

Composition in Multiple Variables

Consider \( z = f(x, y) \) where \( x = g(t) \) and \( y = h(t) \). Then \( z \) is ultimately a function of the single variable \( t \), composed through two intermediate variables.

Outer Function
\( z = f(x, y) \) takes two inputs and produces one output
Inner Functions
\( x = g(t) \) and \( y = h(t) \) each depend on the same parameter \( t \)

The Dependency Tree

A tree diagram maps every dependency path from independent to dependent variables. Each edge is labeled with the appropriate derivative.

z x y t \(\frac{\partial z}{\partial x}\) \(\frac{\partial z}{\partial y}\) \(\frac{dx}{dt}\) \(\frac{dy}{dt}\)

Case 1: One Independent Variable

If \( z = f(x, y) \) is differentiable and \( x = g(t) \), \( y = h(t) \) are differentiable functions of \( t \), then:

$$ \frac{dz}{dt} = \frac{\partial z}{\partial x}\,\frac{dx}{dt} + \frac{\partial z}{\partial y}\,\frac{dy}{dt} $$

Case 2: Two Independent Variables

Now suppose \( z = f(x, y) \) where \( x = g(s, t) \) and \( y = h(s, t) \). Then \( z \) depends on two independent variables \( s \) and \( t \).

$$ \frac{\partial z}{\partial s} = \frac{\partial z}{\partial x}\,\frac{\partial x}{\partial s} + \frac{\partial z}{\partial y}\,\frac{\partial y}{\partial s} $$
$$ \frac{\partial z}{\partial t} = \frac{\partial z}{\partial x}\,\frac{\partial x}{\partial t} + \frac{\partial z}{\partial y}\,\frac{\partial y}{\partial t} $$

Case 2 Tree Diagram

z x y s t s t \(\frac{\partial z}{\partial x}\) \(\frac{\partial z}{\partial y}\) \(\frac{\partial x}{\partial s}\) \(\frac{\partial x}{\partial t}\) \(\frac{\partial y}{\partial s}\) \(\frac{\partial y}{\partial t}\)

Single-Variable vs Multivariable

Single-Variable Multivariable
Setup \( y = f(g(x)) \) \( z = f(x(t), y(t)) \)
Formula \( \frac{dy}{dx} = f'(g(x)) \cdot g'(x) \) \( \frac{dz}{dt} = \frac{\partial f}{\partial x}\frac{dx}{dt} + \frac{\partial f}{\partial y}\frac{dy}{dt} \)
Paths One path Multiple paths (summed)
Derivatives Ordinary \( \frac{d}{dx} \) Mix of \( \partial \) and \( \frac{d}{dt} \)
Key Step Multiply Multiply along paths, then add

How to Apply the Chain Rule

1
Identify the dependency structure. What is the outer function? What are the intermediate and independent variables?
2
Draw the tree diagram. Place the dependent variable at the top, intermediates in the middle, independents at the bottom.
3
Label each edge with the appropriate partial (or ordinary) derivative.
4
Trace all paths from the dependent variable to the desired independent variable.
5
Multiply the derivatives along each path, then sum all path products.

Example 1: Basic Application

Let \( z = x^2 y + 3xy^2 \), where \( x = \sin t \) and \( y = e^t \). Find \( \frac{dz}{dt} \).

Example 2: Two Independent Variables

Let \( z = e^{x}\sin y \), where \( x = st^2 \) and \( y = s^2 t \). Find \( \frac{\partial z}{\partial s} \) and \( \frac{\partial z}{\partial t} \).

Example 2: Finding \( \frac{\partial z}{\partial t} \)

Example 3: Longer Chain

Let \( w = xy + yz + xz \), where \( x = r\cos\theta \), \( y = r\sin\theta \), \( z = r\theta \). Find \( \frac{\partial w}{\partial r} \).

Connection to Implicit Differentiation

The multivariable chain rule also gives us a formula for implicit differentiation. If \( F(x, y) = 0 \) defines \( y \) implicitly as a function of \( x \), then:

$$ \frac{dy}{dx} = -\frac{F_x}{F_y} \quad \text{(provided } F_y \neq 0\text{)} $$

Common Mistakes

✕ Missing a Path
Forgetting to include all intermediate variables. If \( z \) depends on \( x \), \( y \), and \( w \), you need three terms, not two.
✕ Wrong Notation
Using \( \frac{d}{dt} \) when \( \frac{\partial}{\partial t} \) is needed, or vice versa. Use \( d \) only when the variable depends on a single independent variable.
✕ Forgetting to Sum
Writing only one path's contribution instead of summing over all paths. The chain rule always adds path products.

Summary of Chain Rule Cases

Case Setup Formula
One independent \( z = f(x(t), y(t)) \) \( \frac{dz}{dt} = f_x \frac{dx}{dt} + f_y \frac{dy}{dt} \)
Two independent \( z = f(x(s,t), y(s,t)) \) \( \frac{\partial z}{\partial s} = f_x \frac{\partial x}{\partial s} + f_y \frac{\partial y}{\partial s} \)
General \( w = f(x_1, \ldots, x_n) \) \( \frac{\partial w}{\partial t_j} = \sum_i \frac{\partial w}{\partial x_i}\frac{\partial x_i}{\partial t_j} \)
Implicit \( F(x, y) = 0 \) \( \frac{dy}{dx} = -\frac{F_x}{F_y} \)

Question 1 of 5

If \( z = f(x, y) \), \( x = g(t) \), and \( y = h(t) \), which formula gives \( \frac{dz}{dt} \)?

Question 2 of 5

Let \( z = x^2 + y^2 \), \( x = t \), \( y = t^2 \). What is \( \frac{dz}{dt} \)?

Question 3 of 5

In the tree diagram for \( z = f(x, y) \) with \( x = x(s,t) \) and \( y = y(s,t) \), how many paths lead from \( z \) to \( s \)?

Question 4 of 5

If \( F(x,y) = x^3 + xy - y^2 = 0 \) defines \( y \) implicitly, what is \( \frac{dy}{dx} \)?

Question 5 of 5

Let \( w = f(x, y, z) \) where each of \( x, y, z \) depends on \( u \) and \( v \). How many terms appear in the chain rule expression for \( \frac{\partial w}{\partial u} \)?