Multivariable
Chain Rule
Learn how to differentiate compositions of functions with multiple variables: the essential tool for connecting rates of change across linked quantities.
Why We Need a New Chain Rule
In single-variable calculus, the chain rule is simple: if \( y = f(g(t)) \), then \( \frac{dy}{dt} = f'(g(t)) \cdot g'(t) \). But what happens when \( f \) depends on two or more intermediate variables, each of which depends on \( t \)?
The Dependency Tree
A dependency tree (or tree diagram) maps how the final output connects to the independent variable through intermediate variables. Each path contributes a product of partial derivatives.
Intuition: Adding Up Influences
Imagine you are hiking on a surface \( z = f(x,y) \). As time \( t \) passes, your position \( (x(t), y(t)) \) changes. The altitude \( z \) changes because:
The Chain Rule: Case 1
This is Case 1: one independent variable \( t \), two intermediate variables \( x \) and \( y \). The formula sums the contribution from each pathway in the dependency tree.
The Chain Rule: Case 2
This is Case 2: two independent variables \( s \) and \( t \). Now every derivative in the formula is partial, and we get one equation per independent variable.
The General Formula
The pattern is always the same: sum over all intermediate variables, each contributing a product of the partial of the output with respect to that intermediate, times the partial of the intermediate with respect to the independent variable.
Case 1 vs Case 2
| Case 1 | Case 2 | |
|---|---|---|
| Independent vars | One: \( t \) | Two+: \( s, t, \ldots \) |
| Intermediate vars | \( x(t),\; y(t) \) | \( x(s,t),\; y(s,t) \) |
| Result type | Ordinary: \( \frac{dz}{dt} \) | Partial: \( \frac{\partial z}{\partial s},\; \frac{\partial z}{\partial t} \) |
| Equations produced | 1 | 1 per independent var |
| Derivative notation | \( \frac{d}{dt} \) for intermediates | \( \frac{\partial}{\partial s},\; \frac{\partial}{\partial t} \) throughout |
How to Apply the Chain Rule
Example 1: Basic Application
Find \( \frac{dz}{dt} \) if \( z = x^2 y + 3y \), where \( x = \sin t \) and \( y = e^t \).
Example 2: Case 2 with Two Independents
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 3: Three Intermediate Variables
Let \( w = x^2 + yz \), where \( x = t \), \( y = t^2 \), \( z = t^3 \). Find \( \frac{dw}{dt} \).
Connection to Implicit Differentiation
The multivariable chain rule also gives us a clean formula for implicit differentiation. If \( F(x, y) = 0 \) defines \( y \) implicitly as a function of \( x \), then:
This follows from applying the chain rule to \( F(x, y(x)) = 0 \) and solving for \( \frac{dy}{dx} \). The same idea extends: if \( F(x,y,z) = 0 \) defines \( z \) implicitly, then \( \frac{\partial z}{\partial x} = -\frac{F_x}{F_z} \).
The Chain Rule as a Dot Product
There is a beautiful compact form using the gradient. If \( z = f(x,y) \) and \( \mathbf{r}(t) = \langle x(t), y(t) \rangle \), then:
The chain rule is a dot product of the gradient of \( f \) and the velocity vector of the path. This viewpoint connects directly to directional derivatives: the rate of change of \( f \) along a curve equals the gradient dotted with the tangent vector.
Common Mistakes
Summary of Chain Rule Forms
| Setup | Formula | Result Type |
|---|---|---|
| \( z=f(x,y),\; x=x(t),\; y=y(t) \) | \( \frac{dz}{dt} = z_x\,x' + z_y\,y' \) | Ordinary |
| \( z=f(x,y),\; x=x(s,t),\; y=y(s,t) \) | \( \frac{\partial z}{\partial s} = z_x\,x_s + z_y\,y_s \) | Partial |
| \( w = f(x_1,\ldots,x_n),\; x_i=x_i(t_1,\ldots,t_m) \) | \( \frac{\partial w}{\partial t_j} = \sum_i w_{x_i}\,(x_i)_{t_j} \) | Partial |
| Gradient form | \( \frac{dz}{dt} = \nabla f \cdot \mathbf{r}'(t) \) | Ordinary |
Question 1 of 5
If \( z = xy^2 \), \( x = t^2 \), and \( y = t^3 \), what is \( \frac{dz}{dt} \)?
Question 2 of 5
How many terms appear in \( \frac{\partial w}{\partial t} \) if \( w = f(x, y, z) \) with \( x = x(s,t) \), \( y = y(s,t) \), \( z = z(s,t) \)?
Question 3 of 5
If \( F(x,y) = x^3 + xy - y^2 = 0 \), what is \( \frac{dy}{dx} \) using implicit differentiation via the chain rule?
Question 4 of 5
Let \( z = \ln(x^2 + y) \), \( x = e^t \), \( y = t^2 \). Which expression correctly gives \( \frac{dz}{dt} \)?
Question 5 of 5
The multivariable chain rule \( \frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt} \) can be written compactly as: