Multivariable Calculus

Chain Rule for Multivariable Functions

When a function depends on variables that themselves depend on other variables, the chain rule links all of their rates of change through a single elegant formula: drawn as a dependency tree.

10 worked examples Dependency tree diagrams Total derivative dz/dt Implicit differentiation via partials
Share this page

§ 01Why We Need a Multivariable Chain Rule

You already know the single-variable chain rule: if z = f(g(t)), then dz/dt = f′(g(t))·g′(t). The multivariable version extends this idea to functions that depend on several intermediate variables simultaneously.

Consider a physical scenario: the temperature T at a point in a room depends on position (x, y, z). A bee flying through the room traces a path where each coordinate changes with time: x = x(t), y = y(t), z = z(t). To find how fast the temperature the bee experiences is changing, you need the multivariable chain rule.

More formally, we have a function w = f(x, y) where x and y are themselves functions of one or more other variables. The challenge is that changing t affects w through two separate paths: via x and via y. The chain rule sums the contributions from each path.

The Key Insight The total rate of change of w with respect to t is the sum of all indirect contributions — one for each path through the dependency tree. Each contribution is a partial derivative times the rate of change along that branch.

This is not merely an algebraic trick. The formula follows directly from the definition of the derivative and the linear approximation to a multivariable function. Importantly, it requires that all functions involved be differentiable: not just continuous.

§ 02Case 1 — One Parameter: dz/dt

Suppose z = f(x, y) where x = x(t) and y = y(t) are both functions of a single parameter t. Then z is ultimately a function of t alone, and its total derivative is:

Chain Rule — One Parameter
dz/dt = (∂z/∂x)·(dx/dt) + (∂z/∂y)·(dy/dt)

Read this as: "the total effect on z from a change in t equals the effect through the x-branch plus the effect through the y-branch." Each branch contributes a product of two derivatives: the partial derivative of z with respect to the intermediate variable, multiplied by the ordinary derivative of that variable with respect to t.

Dependency Tree Diagram

A dependency tree makes the formula completely transparent. Draw z at the top, branches down to x and y, then each branches further down to t. Label each branch with the corresponding derivative. To find dz/dt, multiply along each path from z to t, then add the results.

z x y ∂z/∂x ∂z/∂y t t dx/dt dy/dt

Multiply along each path, then add: dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt)

Extension to Three or More Intermediate Variables

If w = f(x, y, z) and each of x, y, z depends on t, the pattern extends naturally:

Three intermediate variables
dw/dt = (∂w/∂x)·(dx/dt) + (∂w/∂y)·(dy/dt) + (∂w/∂z)·(dz/dt)

In general, if w = f(x₁, x₂, …, xₙ) and each xᵢ = xᵢ(t), then dw/dt = Σᵢ (∂w/∂xᵢ)(dxᵢ/dt). There is always one term for each intermediate variable, one branch in the dependency tree.

§ 03Case 2 — Two Parameters: ∂z/∂s and ∂z/∂t

Now suppose z = f(x, y) where x = x(s, t) and y = y(s, t) each depend on two parameters, s and t. Then z is a function of both s and t, and we compute its partial derivatives:

Chain Rule — Two Parameters
∂z/∂s = (∂z/∂x)·(∂x/∂s) + (∂z/∂y)·(∂y/∂s) ∂z/∂t = (∂z/∂x)·(∂x/∂t) + (∂z/∂y)·(∂y/∂t)

Notice that all four derivatives on the right-hand side are now partial derivatives (using ∂, not d), because the intermediate variables depend on more than one parameter. The structure is otherwise identical: multiply along each path, add across paths.

z ∂z/∂x ∂z/∂y x y s t s t ∂x/∂s ∂x/∂t ∂y/∂s ∂y/∂t

For ∂z/∂s: trace all paths ending at s and sum products. Likewise for ∂z/∂t.

Common Notation Mistake When the intermediate variables depend on more than one parameter, use ∂ (partial derivative) everywhere on the right-hand side — not d. Writing dz/∂s is a category error: z depends on multiple parameters so its derivative with respect to s is partial, not total.

§ 04Implicit Differentiation via Partial Derivatives

The multivariable chain rule gives us a powerful shortcut for implicit differentiation. If a curve in the xy-plane is defined implicitly by F(x, y) = 0, we can find dy/dx without solving for y explicitly.

Treat y as a function of x, so F becomes a composite function of x alone. Differentiating F(x, y(x)) = 0 with respect to x via the chain rule:

Implicit Differentiation Formula
(∂F/∂x) + (∂F/∂y)·(dy/dx) = 0 ⟹ dy/dx = −(∂F/∂x) / (∂F/∂y)

This works whenever ∂F/∂y ≠ 0 (the implicit function theorem). In three dimensions, if a surface is defined by F(x, y, z) = 0, the same idea gives the partial derivatives of z with respect to x and y:

Implicit Partials for Surfaces
∂z/∂x = −(∂F/∂x) / (∂F/∂z) , ∂z/∂y = −(∂F/∂y) / (∂F/∂z)

This formula is far more efficient than solving F(x, y, z) = 0 for z and then differentiating: especially when F is a polynomial of high degree or involves transcendental functions.

Formula Summary Table

Setup Formula Notes
z = f(x,y), x=x(t), y=y(t) dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt) Total derivative; all ordinary d on right
z = f(x,y), x=x(s,t), y=y(s,t) ∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s) Partial derivative; all ∂ on right
F(x,y) = 0 implicitly dy/dx = −Fx/Fy Requires Fy ≠ 0
F(x,y,z) = 0 implicitly ∂z/∂x = −Fx/Fz , ∂z/∂y = −Fy/Fz Requires Fz ≠ 0
w = f(x,y,z), all depend on t dw/dt = (∂w/∂x)(dx/dt) + (∂w/∂y)(dy/dt) + (∂w/∂z)(dz/dt) Three-branch tree

§ 05Worked Examples

Work through each example carefully. Pay attention to which formula applies, and always draw the dependency tree before writing the chain rule.

Example 01 Total derivative with one parameter

Find dz/dt given z = x²y + 3y, x = cos t, y = sin t.

Step 1 — Compute partial derivatives of z
∂z/∂x = 2xy , ∂z/∂y = x² + 3
Step 2 — Compute derivatives of x and y with respect to t
dx/dt = −sin t , dy/dt = cos t
Step 3 — Apply chain rule formula
dz/dt = (2xy)(−sin t) + (x² + 3)(cos t)
Step 4 — Substitute x = cos t, y = sin t
dz/dt = (2 cos t sin t)(−sin t) + (cos²t + 3)(cos t) = −2 cos t sin²t + cos³t + 3 cos t
dz/dt = cos³t − 2 cos t sin²t + 3 cos t
Example 02 Two-parameter chain rule — finding ∂z/∂s

Find ∂z/∂s given z = exy, x = s + t, y = s − t.

Step 1 — Partial derivatives of z
∂z/∂x = y·exy , ∂z/∂y = x·exy
Step 2 — Partial derivatives of x, y with respect to s
∂x/∂s = 1 , ∂y/∂s = 1
Step 3 — Chain rule
∂z/∂s = y·exy·(1) + x·exy·(1) = (x + y)exy
Step 4 — Substitute x = s+t, y = s−t
x + y = 2s , xy = (s+t)(s−t) = s² − t²
∂z/∂s = 2s · e(s²−t²)
Example 03 Implicit differentiation — finding dy/dx

Find dy/dx for the curve x³ + y³ − 3xy = 0 (the folium of Descartes).

Step 1 — Set F(x,y) = x³ + y³ − 3xy
Fx = 3x² − 3y , Fy = 3y² − 3x
Step 2 — Apply implicit formula
dy/dx = −Fx/Fy = −(3x² − 3y)/(3y² − 3x)
dy/dx = (y − x²) / (y² − x)
Example 04 Three-branch tree — w depends on x, y, z

Find dw/dt given w = x² + y² + z², x = et, y = e−t, z = t.

Step 1 — Partial derivatives
∂w/∂x = 2x , ∂w/∂y = 2y , ∂w/∂z = 2z
Step 2 — Derivatives of x, y, z with respect to t
dx/dt = et , dy/dt = −e−t , dz/dt = 1
Step 3 — Chain rule
dw/dt = 2x·et + 2y·(−e−t) + 2z·1 = 2et·et − 2e−t·e−t + 2t
dw/dt = 2e2t − 2e−2t + 2t
Example 05 Implicit partial derivatives on a surface

Find ∂z/∂x and ∂z/∂y for the surface x²z + y²z³ − xyz = 1.

Step 1 — Define F(x,y,z) = x²z + y²z³ − xyz − 1
Step 2 — Compute partial derivatives
Fx = 2xz − yz , Fy = 2yz³ − xz , Fz = x² + 3y²z² − xy
Step 3 — Apply implicit surface formula
∂z/∂x = −Fx/Fz = −(2xz − yz)/(x² + 3y²z² − xy) ∂z/∂y = −Fy/Fz = −(2yz³ − xz)/(x² + 3y²z² − xy)
∂z/∂x = (yz − 2xz)/(x² + 3y²z² − xy)
Example 06 Evaluating dz/dt at a specific point

Find dz/dt at t = 0 given z = ln(x² + y²), x = et, y = t + 1.

Step 1 — At t = 0: x = 1, y = 1
Step 2 — Partial derivatives at (1, 1)
∂z/∂x = 2x/(x²+y²) = 2/2 = 1 , ∂z/∂y = 2y/(x²+y²) = 1
Step 3 — dx/dt = et = 1 at t=0 , dy/dt = 1
Step 4 — Chain rule
dz/dt|t=0 = 1·1 + 1·1 = 2
dz/dt|t=0 = 2
Example 07 Both ∂z/∂s and ∂z/∂t for a trig function

Find ∂z/∂s and ∂z/∂t given z = sin(x/y), x = st², y = s²t.

Step 1 — Partial derivatives
∂z/∂x = (1/y)cos(x/y) , ∂z/∂y = −(x/y²)cos(x/y)
Step 2 — For ∂z/∂s: ∂x/∂s = t², ∂y/∂s = 2st
∂z/∂s = (t²/y)cos(x/y) + (−x·2st/y²)cos(x/y) = cos(x/y)·[t²/y − 2stx/y²]
Step 3 — Note x/y = st²/s²t = t/s, so ∂z/∂s = cos(t/s)·[t²/s²t − 2st·st²/s⁴t²]
Simplified: ∂z/∂s = −(t/s²) cos(t/s)
Step 4 — For ∂z/∂t: ∂x/∂t = 2st, ∂y/∂t = s²
∂z/∂t = cos(t/s)·(1/s) via similar simplification
∂z/∂s = −(t/s²)cos(t/s) , ∂z/∂t = (1/s)cos(t/s)
Example 08 Chain rule to find a second-order relationship

If u = f(x − ct) where c is a constant, show that ∂u/∂t = −c · ∂u/∂x.

Step 1 — Let w = x − ct. Then u = f(w).
Step 2 — Partial derivatives of w
∂w/∂x = 1 , ∂w/∂t = −c
Step 3 — Chain rule
∂u/∂x = f′(w)·1 = f′(w) ∂u/∂t = f′(w)·(−c) = −c·f′(w)
Step 4 — Conclude
∂u/∂t = −c·(∂u/∂x) ✓
This is the 1D wave equation: ∂u/∂t + c·∂u/∂x = 0
Example 09 Polar coordinates — expressing partials in r and θ

With x = r cos θ, y = r sin θ, find ∂f/∂r and ∂f/∂θ for any differentiable f(x,y).

Step 1 — Chain rule for ∂f/∂r
∂f/∂r = (∂f/∂x)(∂x/∂r) + (∂f/∂y)(∂y/∂r) = (∂f/∂x)cos θ + (∂f/∂y)sin θ
Step 2 — Chain rule for ∂f/∂θ
∂f/∂θ = (∂f/∂x)(−r sin θ) + (∂f/∂y)(r cos θ)
∂f/∂r = fx cos θ + fy sin θ ∂f/∂θ = −r fx sin θ + r fy cos θ
Example 10 Verifying Euler's theorem using the chain rule

A function f(x, y) is homogeneous of degree n if f(tx, ty) = tⁿ f(x, y) for all t > 0. Use the chain rule to derive Euler's theorem: x·∂f/∂x + y·∂f/∂y = n·f.

Step 1 — Differentiate both sides of f(tx, ty) = tⁿ f(x,y) with respect to t
LHS: (∂f/∂(tx))·x + (∂f/∂(ty))·y RHS: n·tn−1·f(x,y)
Step 2 — Set t = 1
(∂f/∂x)·x + (∂f/∂y)·y = n·f(x,y)
x·fx + y·fy = n·f (Euler's theorem)

§ 06Common Mistakes to Avoid

Mistake 1: Forgetting a branch in the tree If z = f(x, y) and both x and y depend on t, you must include both branches. Writing dz/dt = (∂z/∂x)(dx/dt) alone misses the contribution from y. Always count the branches.
Mistake 2: Mixing ∂ and d incorrectly When the intermediate variables depend on a single parameter, the outer derivative is an ordinary d: dz/dt. When they depend on multiple parameters, use ∂ everywhere. Consistency with notation prevents conceptual errors.
Mistake 3: Applying implicit formula when Fy = 0 The formula dy/dx = −Fx/Fy requires division by Fy. At points where Fy = 0, the implicit function theorem may fail — the curve may have a vertical tangent or may not be expressible as a function of x near that point.
Mistake 4: Differentiating the outer function with respect to the wrong variable In dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt), the partial derivatives ∂z/∂x and ∂z/∂y are computed by differentiating f with respect to its first and second arguments respectively — not with respect to t. Keep the intermediate variables in the expression until you substitute at the end.

§ 07Practice Quiz

Test your understanding of the multivariable chain rule. For the numeric questions enter your answer to 2 decimal places where needed. The score tracker updates as you go.

Score: 0 / 0
Question 1 — Multiple Choice

If z = f(x, y), x = g(t), y = h(t), which formula gives dz/dt?

Question 2 — Numeric

Given z = x² + y², x = 3t, y = 4t. Find dz/dt.

Tip: ∂z/∂x = 2x, so (∂z/∂x)(dx/dt) = 2(3t)(3) = 18t. Similarly for y.

dz/dt = · t

Use dz/dt = (2x)(3) + (2y)(4). Substitute x = 3t, y = 4t.
  1. ∂z/∂x = 2x = 2(3t) = 6t, (∂z/∂x)(dx/dt) = 6t·3 = 18t
  2. ∂z/∂y = 2y = 2(4t) = 8t, (∂z/∂y)(dy/dt) = 8t·4 = 32t
  3. dz/dt = 18t + 32t = 50t
Question 3 — Multiple Choice

For F(x, y) = x² + y² − 25 = 0, what is dy/dx using the implicit formula?

Question 4 — Numeric

Given z = xy, x = es, y = et. What is ∂z/∂s?

∂z/∂s =

∂z/∂x = y, ∂x/∂s = es. The y branch gives ∂z/∂y·∂y/∂s = x·0 = 0 since y does not depend on s.
  1. ∂z/∂x = y, ∂x/∂s = es, ∂y/∂s = 0 (y does not depend on s)
  2. ∂z/∂s = y·es + x·0 = y·es
  3. Equivalently: z = es·et, so ∂z/∂s = es·et = yes
Question 5 — Multiple Choice

A function f(x, y) is homogeneous of degree 3. According to Euler's theorem, x·fx + y·fy equals:

Question 6 — Numeric

Given z = x² − y², x = r cos θ, y = r sin θ. Find ∂z/∂r in terms of r and θ.

Enter the coefficient of the simplified expression ∂z/∂r = ?·r (give the coefficient):

∂z/∂x = 2x, ∂z/∂y = −2y, ∂x/∂r = cos θ, ∂y/∂r = sin θ. Combine and use cos²θ − sin²θ = cos 2θ; the result simplifies to 2r·cos 2θ. The coefficient asked about is the numerical multiplier of r.
  1. ∂z/∂r = (2x)(cos θ) + (−2y)(sin θ)
  2. = 2r cos²θ − 2r sin²θ
  3. = 2r(cos²θ − sin²θ) = 2r cos 2θ
  4. The coefficient of r is 2 (times cos 2θ)
Question 7 — Multiple Choice

How many terms appear in the chain rule formula for dw/dt when w = f(x, y, z) and all three depend on t?

Question 8 — Numeric

Find dz/dt at t = π/2 given z = sin x cos y, x = t, y = π − t.

At t=π/2: x = π/2, y = π/2. ∂z/∂x = cos x cos y, ∂z/∂y = −sin x sin y. Then dx/dt = 1, dy/dt = −1.
  1. ∂z/∂x = cos x cos y, ∂z/∂y = −sin x sin y
  2. dx/dt = 1, dy/dt = −1
  3. dz/dt = cos x cos y·(1) + (−sin x sin y)(−1) = cos x cos y + sin x sin y = cos(x − y)
  4. Since y = π − t, x − y = t − (π − t) = 2t − π. At t = π/2: 2(π/2) − π = 0.
  5. dz/dt = cos(x − y) = cos(0) = 1
Question 9 — Multiple Choice

For F(x, y) = x³ − y³ + 6xy = 0, find dy/dx using the implicit formula.

Fx = 3x² + 6y, Fy = −3y² + 6x. Then dy/dx = −Fx/Fy. Simplify by dividing through by 3.
Question 10 — Multiple Choice

Which of the following is the correct chain rule formula for ∂z/∂t when z = f(x,y), x = x(s,t), y = y(s,t)?

§ 08What to Study Next

The multivariable chain rule connects every major idea in multivariable calculus. To deepen your understanding, these pages build directly on what you have learned here:

  • Partial Derivatives, the building blocks used in every chain rule computation. Ensure you are comfortable differentiating with respect to one variable while holding others constant.
  • Gradient and Directional Derivatives, the gradient vector ∇f collects all partial derivatives into a single object, and the chain rule explains why it points in the direction of steepest ascent.
  • Double Integrals, when changing variables in a double integral, the Jacobian determinant arises directly from the multivariable chain rule applied to coordinate transformations.
  • Chain Rule (single variable), revisiting the single-variable version with fresh eyes often clarifies exactly how the multivariable formula generalises it.

Cookie Settings