MULTIVARIABLE CALCULUS • PARTIAL DERIVATIVES

Multivariable Chain Rule — Chain rule in multiple variables

Extend the chain rule to functions of several variables to track how changes propagate through interconnected quantities.

Historical Context & Motivation

You already know the single-variable chain rule from Calculus I: if y depends on u and u depends on x, you can find dy/dx by multiplying dy/du by du/dx. But what happens when a quantity depends on two or more intermediate variables, each of which depends on yet other variables? This is the problem the multivariable chain rule was designed to solve. Temperature on a hillside, for example, depends on your x- and y-position, and both of those positions change with time as you hike. Finding how fast the temperature changes with time requires tracking every pathway through which time influences temperature.

The development of the multivariable chain rule unfolded over centuries, paralleling the broader evolution of calculus itself. From Leibniz's early notation to the rigorous formulations of the 19th century, mathematicians steadily built the tools needed to handle functions of several variables.

1684
Leibniz Publishes the Chain Rule Idea
Gottfried Wilhelm Leibniz introduced his differential notation dy/dx. His fraction-like notation naturally suggested that derivatives could be "chained" by multiplying fractions, planting the seed of the chain rule.
1797
Lagrange Formalizes Derivative Notation
Joseph-Louis Lagrange introduced the prime notation f′(x) and studied functions of multiple variables systematically, laying groundwork for partial derivatives and their composition.
1823
Cauchy Rigorous Limits
Augustin-Louis Cauchy provided rigorous definitions of limits and continuity for functions of several variables, making formal proofs of the multivariable chain rule possible.
1860s
Weierstrass and Rigorous Analysis
Karl Weierstrass formalized epsilon-delta arguments for multivariable functions. The multivariable chain rule gained its modern, precise statement during this era of mathematical rigor.

The central question the multivariable chain rule answers is: When a function depends on several intermediate variables, and each of those depends on one or more parameters, how do we compute the overall rate of change with respect to those parameters? The answer involves summing the contributions from every pathway through which the parameter influences the function.

Core Principles & Definitions

Before diving into formulas, let's establish the foundational ideas that make the multivariable chain rule work. Each principle builds on concepts you already know from single-variable calculus and extends them into higher dimensions.

1

Partial Derivatives

A partial derivative measures how a multivariable function changes when you vary one input while holding all others constant. Written ∂f/∂x, it is the single-variable derivative taken "one direction at a time."
2

Dependent vs. Independent Variables

In a chain-rule problem, the dependent variable (like z) sits at the top. The intermediate variables (like x, y) sit in the middle, and the independent variables (like s, t) sit at the bottom.
3

Sum Over All Paths

The key idea: to find the total derivative of z with respect to an independent variable t, you sum the contributions from every pathway connecting t to z through the intermediate variables.
4

Multiply Along Each Path

Along each individual path, you multiply the partial derivatives encountered from top to bottom, just as in the single-variable chain rule. Each product represents one channel of influence.
KEY TAKEAWAY
Think of the multivariable chain rule like a road network. Suppose you want to know how a change at City A (independent variable) affects traffic at City C (dependent variable). There might be multiple routes from A to C, each passing through different towns (intermediate variables). The total effect on City C is the sum of the effects along every route. Along each route, the effects multiply together, just like tolls at consecutive toll booths.

Visual Explanation — The Dependency Tree

The most powerful tool for setting up a multivariable chain rule problem is a dependency tree (also called a tree diagram). It shows which variables depend on which, and every branch from the independent variable to the dependent variable represents one term in the chain rule sum. The diagram below illustrates the classic case where z = f(x, y), with x = x(s, t) and y = y(s, t).

The dependency tree for z = f(x, y) where x and y both depend on s and t. To find ∂z/∂s, trace every path from z down to s: the path through x contributes (∂z/∂x)(∂x/∂s), and the path through y contributes (∂z/∂y)(∂y/∂s). Sum these products to get the total derivative.

Notice how each arrow carries a partial derivative label. When you follow a complete path from the top node (z) to a bottom node (say, s), you multiply the labels along that path. Then you add up the products for all paths reaching the same bottom node. This "multiply along a path, add across paths" recipe is the heart of the multivariable chain rule.

Mathematical Framework

Let's formalize the patterns we saw in the tree diagram. We will present three increasingly general forms of the multivariable chain rule, starting from the version closest to what you already know.

Case 1: One Independent Variable

CHAIN RULE — CASE 1
dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt)
Here z = f(x, y), and both x and y are functions of a single variable t. Since there is only one independent variable, we use the ordinary derivative dz/dt on the left side.

Case 2: Two Independent Variables

CHAIN RULE — CASE 2
∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s)
Here z = f(x, y), x = x(s, t), and y = y(s, t). Because there are two independent variables s and t, we write partial derivatives ∂z/∂s and ∂z/∂t on the left side. An analogous formula holds for ∂z/∂t.

General Case

GENERAL MULTIVARIABLE CHAIN RULE
∂z/∂tⱼ = Σᵢ (∂z/∂xᵢ)(∂xᵢ/∂tⱼ)
Here z = f(x₁, x₂, …, xₙ) and each xᵢ depends on independent variables t₁, t₂, …, tₘ. The sum runs over all intermediate variables i = 1, 2, …, n. This compact form covers every scenario you will encounter.
⚠️ Ordinary vs. Partial on the Left Side
A common point of confusion: when there is only one independent variable, the left side is an ordinary derivative (d/dt). When there are two or more independent variables, the left side is a partial derivative (∂/∂s). Always check your dependency tree to determine which symbol to use.

Building the Chain Rule Step by Step

Let's walk through the systematic procedure for applying the multivariable chain rule. The process always follows the same four stages, regardless of how many variables are involved.

The four-step procedure for using the multivariable chain rule, with a quick example and verification shown at the bottom. Notice that the chain rule answer matches the result from direct substitution — the chain rule is a shortcut, not a different answer.

You might wonder: why not just substitute first and then differentiate directly? For simple cases you can, but the chain rule becomes essential when substitution is impractical — for instance, when the intermediate functions are defined implicitly, or when you only have numerical data rather than explicit formulas. The chain rule also reveals the structural relationship between variables, showing exactly how each intermediate variable contributes to the overall rate of change.

Common scenarios and their chain rule formulas
ScenarioChain Rule FormulaNumber of Terms
z = f(x), x = x(t)dz/dt = (dz/dx)(dx/dt)1 (single-variable case)
z = f(x, y), x = x(t), y = y(t)dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt)2 terms
z = f(x, y), x = x(s, t), y = y(s, t)∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s)2 terms per independent variable
w = f(x, y, z), each depends on tdw/dt = (∂w/∂x)(dx/dt) + (∂w/∂y)(dy/dt) + (∂w/∂z)(dz/dt)3 terms

Worked Example

Let's apply the multivariable chain rule to a complete problem with two independent variables. Suppose z = ex sin(y), where x = s² + t and y = 2st. We want to find ∂z/∂s.

Finding ∂z/∂s Using the Multivariable Chain Rule
1
Step 1 — Identify the Variable RolesThe dependent variable is z = eˣ sin(y). The intermediate variables are x and y. The independent variables are s and t. We want ∂z/∂s, which means we hold t constant and differentiate with respect to s.
Dependent: z | Intermediate: x, y | Independent: s, t
2
Step 2 — Write the Chain Rule FormulaSince z depends on two intermediate variables x and y, and we want the derivative with respect to s, the chain rule gives us: ∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s). There are two paths from z to s in the dependency tree — one through x and one through y.
∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s)
3
Step 3 — Compute Each Partial DerivativeWe need four partial derivatives. From z = eˣ sin(y): ∂z/∂x = eˣ sin(y) and ∂z/∂y = eˣ cos(y). From x = s² + t: ∂x/∂s = 2s. From y = 2st: ∂y/∂s = 2t.
∂z/∂x = eˣ sin(y), ∂z/∂y = eˣ cos(y), ∂x/∂s = 2s, ∂y/∂s = 2t
4
Step 4 — Substitute into the Chain RulePlugging the partial derivatives into the formula: ∂z/∂s = (eˣ sin(y))(2s) + (eˣ cos(y))(2t). We can factor out eˣ to simplify.
∂z/∂s = eˣ [2s sin(y) + 2t cos(y)]
5
Step 5 — Express in Terms of s and t (Optional)If we need the answer purely in terms of s and t, substitute x = s² + t and y = 2st back in: ∂z/∂s = e^(s²+t) [2s sin(2st) + 2t cos(2st)]. This form is useful for evaluating at specific (s, t) values.
∂z/∂s = e^(s²+t) [2s sin(2st) + 2t cos(2st)]
💡 Verification Tip
You can verify your answer by substituting x = s² + t and y = 2st into z = eˣ sin(y) first, getting z = e^(s²+t) sin(2st), and then differentiating directly with respect to s using the product rule. Both methods should yield the same result. Try it!

Strengths, Limitations & Common Pitfalls

The multivariable chain rule is an incredibly versatile tool, but like any powerful technique, it has situations where it shines and situations where students commonly make mistakes. Understanding both will help you use it with confidence.

Strengths and limitations of the multivariable chain rule
StrengthsLimitations / Pitfalls
Works even when substitution is impractical or impossible (implicit functions, numerical data)Requires all intermediate functions to be differentiable; fails at points where derivatives don't exist
Reveals the structural contribution of each intermediate variable separatelyStudents often forget to include all paths in the tree — missing a term means a wrong answer
Scales naturally to any number of intermediate and independent variablesNotation can become confusing; mixing up d and ∂ is a very common error
Foundation for gradient, directional derivatives, and optimizationFor simple explicit functions, direct substitution may actually be faster
⚠️ AVOID THE #1 MISTAKE
The most common error is forgetting a term. Always draw the dependency tree before writing any formulas. If z depends on three intermediate variables x, y, and w, then the formula for dz/dt must have three terms. Count the branches in your tree and make sure you have that many terms in your sum.

Connection to Advanced Topics

The multivariable chain rule is not an isolated technique — it is the engine behind many of the most important ideas in higher mathematics and science. Understanding these connections helps you see why the chain rule is so widely applicable.

How the multivariable chain rule connects to advanced topics
This LessonAdvanced Extension
dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt)Gradient & Directional Derivative: The chain rule formula is actually the dot product ∇f · r′(t), connecting the gradient vector to rates of change along curves.
Summing contributions from multiple pathsTotal Derivative (Jacobian): When organized into matrix form, the chain rule becomes matrix multiplication of Jacobian matrices — the foundation for transformations in higher dimensions.
Tracking how a parameter affects a functionBackpropagation in Machine Learning: Neural networks train by applying the multivariable chain rule in reverse through layers of the network to update weights. This is literally the chain rule at scale.
Changing independent variablesChange of Variables in Integration: Converting integrals from Cartesian to polar coordinates uses the multivariable chain rule to transform partial derivatives, leading to the Jacobian determinant.

Perhaps the most exciting modern application is in artificial intelligence. Every time a neural network learns from data, it uses the multivariable chain rule — applied through thousands of interconnected nodes — to figure out how to adjust its internal parameters. The algorithm, called backpropagation, is nothing more than the chain rule applied systematically from output to input. So when you master this topic, you are learning the same mathematics that powers modern AI.

Practice Problems

PROBLEM 1CONCEPTUAL
Suppose w = f(x, y, z) and each of x, y, z depends on a single variable t. How many terms will appear in the chain rule formula for dw/dt? Explain your reasoning using the dependency tree concept.
PROBLEM 2BASIC CALCULATION
Let z = x² + 3y, where x = 2t and y = t³. Use the chain rule to find dz/dt.
PROBLEM 3INTERMEDIATE
Let z = ln(x + y), where x = se^t and y = s²t. Find ∂z/∂t.
PROBLEM 4APPLIED
The temperature at a point on a flat surface is T(x, y) = 100 − x² − 2y² degrees. A bug walks along the path x(t) = cos(t), y(t) = sin(t). How fast is the temperature changing at time t = π/4?
PROBLEM 5CRITICAL THINKING
Let z = f(x, y) where x = r cos(θ) and y = r sin(θ) (polar coordinates). Show that (∂z/∂r)² + (1/r²)(∂z/∂θ)² = (∂f/∂x)² + (∂f/∂y)². This identity says the squared gradient magnitude is the same in both coordinate systems.

Lesson Summary

The multivariable chain rule extends the familiar single-variable chain rule to functions of several variables. When a dependent variable z = f(x, y) depends on intermediate variables that themselves depend on independent variables, the total rate of change is found by the rule: multiply partial derivatives along each path and sum across all paths in the dependency tree.

For a function of two intermediate variables, the formula is ∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s). The systematic approach — identify variables, draw the tree, write the formula, compute and simplify — works for any number of variables. This rule is the backbone of the gradient, directional derivatives, coordinate transformations, and even the backpropagation algorithm used in machine learning.

Varsity Tutors • Multivariable Calculus • Multivariable Chain Rule — Chain rule in multiple variables