CALCULUS 3 • MULTIVARIABLE FUNCTIONS & PARTIAL DERIVATIVES

Multivariable Chain Rule — Chain Rule in Multiple Variables

Extending the chain rule to functions of several variables connected by intermediate dependencies.

Historical Context & Motivation

The chain rule is one of the most fundamental techniques in differential calculus, enabling us to differentiate compositions of functions. In single-variable calculus, the rule is elegant and concise: if y depends on u and u depends on x, then dy/dx = (dy/du)(du/dx). However, as mathematicians and physicists confronted problems involving multiple interacting quantities—temperature distributions in three-dimensional bodies, gravitational potentials, fluid flow—they needed a generalization that could handle functions depending on several intermediate variables simultaneously. The quest for such a generalization drove pivotal developments in the theory of partial derivatives throughout the eighteenth and nineteenth centuries.

1684
Leibniz Publishes the Single-Variable Chain Rule
Gottfried Wilhelm Leibniz introduced the differential notation dy/dx and established the chain rule as a natural consequence of treating differentials as manipulable quantities, laying the conceptual groundwork for extending differentiation to composite functions.
1755
Euler's Systematic Use of Partial Derivatives
Leonhard Euler formalized partial differentiation in his work on multivariate functions, introducing the notation and machinery that made it possible to state chain rules involving several independent and intermediate variables.
1797
Lagrange's Analytic Mechanics
Joseph-Louis Lagrange employed generalized coordinates in his Mécanique Analytique, requiring chain rule computations with functions of multiple parameters—an early and influential application of the multivariable chain rule in physics.
1870s
Rigorous Foundations by Weierstrass and Schwarz
Karl Weierstrass and Hermann Schwarz established rigorous epsilon-delta proofs for the multivariable chain rule, clarifying the differentiability conditions under which the rule holds and resolving earlier ambiguities.
1900s
Modern Formulation via Total Derivatives and Jacobians
The chain rule was recast in terms of Jacobian matrices and linear maps, unifying all cases into a single elegant statement: the Jacobian of a composition is the product of Jacobians. This matrix form is the standard in modern analysis and differential geometry.

The central question the multivariable chain rule answers is this: if a quantity z depends on intermediate variables u and v, which themselves depend on independent variables s and t, how do we compute the rate of change of z with respect to s or t? Unlike the single-variable case, each path of dependency contributes a separate term, and the chain rule must sum over all such paths. Understanding this principle is essential for optimization, coordinate transformations, and the analysis of physical systems governed by partial differential equations.

Core Principles & Definitions

Before stating the multivariable chain rule, it is important to establish the underlying concepts that make the rule work. The single-variable chain rule succeeds because the derivative of a composition is the product of individual derivatives taken along a single path. In several variables, a function may depend on an independent variable through multiple intermediate paths, and the chain rule must account for every such pathway by summing the contributions. The following foundational ideas form the conceptual scaffolding for the general rule.

1

Partial Derivatives

A partial derivative measures how a function changes with respect to one variable while all other variables are held constant. Notation: ∂f/∂x denotes the partial derivative of f with respect to x.
2

Composite Functions in Several Variables

A composite function arises when the inputs to one function are themselves functions of other variables. For example, z = f(x, y) where x = g(t) and y = h(t) defines z as a composite function of t.
3

Dependency Trees

A dependency tree (or variable diagram) is a schematic that maps which variables depend on which. Each branch from an independent variable to the output function represents a path that contributes a term in the chain rule.
4

Differentiability Requirement

The multivariable chain rule requires that the outer function be differentiable (not merely having partial derivatives). Differentiability guarantees a good linear approximation, which is stronger than the mere existence of partials.
5

Summing Over Intermediate Variables

The fundamental principle: to find the derivative of a composite function with respect to an independent variable, sum over all intermediate variables the product of the partial derivative of the outer function times the derivative of the intermediate variable.
✦ KEY TAKEAWAY
Think of the multivariable chain rule like computing total travel time when multiple connecting flights are involved. If you want to know how a delay at the origin affects your final arrival time, you must trace every possible route through connecting airports and add up the delays accumulated along each path. Similarly, when z depends on x and y, and both x and y depend on t, the total rate of change dz/dt is the sum of the contributions from each intermediate variable—one term for the path through x and another for the path through y.

Visual Explanation — Dependency Trees

The most effective way to set up a multivariable chain rule problem is to draw a dependency tree (also called a tree diagram or variable diagram). This diagram makes the structure of the composition visually explicit, so you can read off the chain rule formula directly: for each path from the independent variable at the bottom to the dependent variable at the top, multiply the partial derivatives along the path, then sum over all paths.

The dependency tree shows z at the top depending on intermediate variables x and y (middle level), which in turn depend on independent variables s and t (bottom level). Each edge is labeled with the corresponding partial derivative. To compute ∂z/∂s, follow every path from s up to z: the path s → x → z contributes (∂z/∂x)(∂x/∂s), and the path s → y → z contributes (∂z/∂y)(∂y/∂s). Sum these to get the chain rule formula shown at the bottom.

Notice that the structure of the tree dictates the formula. Each path from an independent variable to the output contributes one summand, and each summand is the product of partial derivatives along the edges of that path. This 'multiply along edges, sum over paths' principle is the heart of the multivariable chain rule and remains valid regardless of how many levels of intermediate variables are present. When the tree has only one intermediate level and one independent variable (the single-variable case), the sum collapses to a single product and we recover the familiar dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt).

Mathematical Framework

We now state the multivariable chain rule precisely for the two most common configurations, then present the fully general Jacobian formulation. In every case the essential requirement is that the outer function f be differentiable (not merely possessing partial derivatives) and the inner functions be differentiable as well.

Case 1: One Independent Variable

CHAIN RULE — CASE 1
dz/dt = (∂f/∂x)(dx/dt) + (∂f/∂y)(dy/dt)
Here z = f(x, y), x = g(t), y = h(t). The function z depends on the single independent variable t through two intermediate variables x and y. Each partial derivative ∂f/∂x and ∂f/∂y is evaluated at (g(t), h(t)).

Case 2: Two Independent Variables

CHAIN RULE — CASE 2
∂z/∂s = (∂f/∂x)(∂x/∂s) + (∂f/∂y)(∂y/∂s)
Here z = f(x, y), x = g(s, t), y = h(s, t). An analogous formula holds for ∂z/∂t by replacing s with t in each inner derivative. When the independent variables are themselves multivariable, all derivatives become partial derivatives.

General Case: Jacobian Matrix Formulation

JACOBIAN CHAIN RULE
J(f ∘ g)(a) = Jf(g(a)) · Jg(a)
If f : ℝⁿ → ℝᵐ and g : ℝᵖ → ℝⁿ are differentiable, then the Jacobian of the composition f ∘ g at a point a equals the matrix product of the Jacobian of f (evaluated at g(a)) and the Jacobian of g (evaluated at a). Every specific chain rule case is a special instance of this matrix multiplication.
📐 Derivation Sketch
The proof rests on the definition of differentiability. If f is differentiable at (x₀, y₀), then Δf = (∂f/∂x)Δx + (∂f/∂y)Δy + ε₁Δx + ε₂Δy where ε₁, ε₂ → 0 as (Δx, Δy) → (0, 0). Dividing by Δt and taking the limit, the error terms vanish because Δx/Δt and Δy/Δt remain bounded (they converge to dx/dt and dy/dt), yielding dz/dt = (∂f/∂x)(dx/dt) + (∂f/∂y)(dy/dt). This is precisely why mere existence of partials is insufficient—differentiability ensures the error is controlled.

Detailed Breakdown — Common Configurations

In practice, chain rule problems come in a variety of configurations depending on the number of dependent, intermediate, and independent variables. The table below catalogs the most frequently encountered setups, and the second diagram illustrates how the chain rule formula scales when the number of intermediate variables increases.

Common multivariable chain rule configurations
ConfigurationSetupChain Rule Formula# of Terms
Case 1az = f(x, y), x = x(t), y = y(t)dz/dt = fₓ · x′(t) + f_y · y′(t)2
Case 1bw = f(x, y, z), x = x(t), y = y(t), z = z(t)dw/dt = fₓ · x′ + f_y · y′ + f_z · z′3
Case 2z = f(x, y), x = x(s, t), y = y(s, t)∂z/∂s = fₓ · ∂x/∂s + f_y · ∂y/∂s2 per independent var
Generalz = f(x₁, …, xₙ), xᵢ = xᵢ(t₁, …, tₘ)∂z/∂tⱼ = Σᵢ (∂f/∂xᵢ)(∂xᵢ/∂tⱼ)n per independent var
Case 1b dependency tree for w = f(x, y, z) with three intermediate variables x, y, z, each depending on a single independent variable t. Three branches produce three terms in the chain rule. This pattern extends naturally: n intermediate variables yield n terms.

The general pattern is now clear. The number of terms in the chain rule formula for ∂z/∂tⱼ equals the number of intermediate variables through which z depends on tⱼ. Each term is the product of the partial derivative of the outer function with respect to one intermediate variable and the partial derivative of that intermediate variable with respect to tⱼ. When the composition involves three or more levels of nesting, the same 'multiply along edges, sum over paths' principle applies recursively—the chain rule composes just as functions do.

Worked Example

Let us work through a complete example that exercises Case 2 of the multivariable chain rule. We will compute both ∂z/∂s and ∂z/∂t for a specific function.

Finding ∂z/∂s and ∂z/∂t via the Chain Rule
1
Step 1 — State the ProblemLet z = x²y + xy³, where x = s·cos(t) and y = s·sin(t). Find ∂z/∂s and ∂z/∂t.
2
Step 2 — Draw the Dependency Treez depends on x and y (intermediate variables), and both x and y depend on s and t (independent variables). The chain rule gives: ∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s), and ∂z/∂t = (∂z/∂x)(∂x/∂t) + (∂z/∂y)(∂y/∂t).
3
Step 3 — Compute the Partial Derivatives of the Outer Function∂z/∂x = 2xy + y³ (differentiate z with respect to x, holding y constant). ∂z/∂y = x² + 3xy² (differentiate z with respect to y, holding x constant).
∂z/∂x = 2xy + y³, ∂z/∂y = x² + 3xy²
4
Step 4 — Compute the Partial Derivatives of the Inner FunctionsFrom x = s·cos(t): ∂x/∂s = cos(t), ∂x/∂t = −s·sin(t). From y = s·sin(t): ∂y/∂s = sin(t), ∂y/∂t = s·cos(t).
∂x/∂s = cos(t), ∂x/∂t = −s·sin(t), ∂y/∂s = sin(t), ∂y/∂t = s·cos(t)
5
Step 5 — Assemble ∂z/∂s∂z/∂s = (2xy + y³)·cos(t) + (x² + 3xy²)·sin(t). Substitute x = s·cos(t) and y = s·sin(t) carefully, term by term: 2xy = 2(s·cos t)(s·sin t) = 2s²cos(t)sin(t), and y³ = (s·sin t)³ = s³sin³(t), so (2xy + y³) = 2s²cos(t)sin(t) + s³sin³(t). Likewise x² = s²cos²(t), and 3xy² = 3(s·cos t)(s·sin t)² = 3(s·cos t)(s²sin²t) = 3s³cos(t)sin²(t) — note the extra factor of s that comes from squaring y = s·sin(t). So (x² + 3xy²) = s²cos²(t) + 3s³cos(t)sin²(t). Substituting these into the formula: ∂z/∂s = [2s²cos(t)sin(t) + s³sin³(t)]·cos(t) + [s²cos²(t) + 3s³cos(t)sin²(t)]·sin(t). Expanding each product: ∂z/∂s = 2s²cos²(t)sin(t) + s³cos(t)sin³(t) + s²cos²(t)sin(t) + 3s³cos(t)sin³(t). Combining the matching s²cos²(t)sin(t) terms: 2s²cos²(t)sin(t) + s²cos²(t)sin(t) = 3s²cos²(t)sin(t). Combining the matching s³cos(t)sin³(t) terms: s³cos(t)sin³(t) + 3s³cos(t)sin³(t) = 4s³cos(t)sin³(t).
∂z/∂s = 3s²cos²(t)sin(t) + 4s³cos(t)sin³(t)
6
Step 6 — Assemble ∂z/∂t∂z/∂t = (2xy + y³)·(−s·sin(t)) + (x² + 3xy²)·(s·cos(t)). Using the same correctly substituted expressions from Step 5, (2xy + y³) = 2s²cos(t)sin(t) + s³sin³(t) and (x² + 3xy²) = s²cos²(t) + 3s³cos(t)sin²(t): ∂z/∂t = [2s²cos(t)sin(t) + s³sin³(t)]·(−s·sin(t)) + [s²cos²(t) + 3s³cos(t)sin²(t)]·(s·cos(t)). Expanding the first bracket: −s·sin(t)·2s²cos(t)sin(t) = −2s³cos(t)sin²(t), and −s·sin(t)·s³sin³(t) = −s⁴sin⁴(t). Expanding the second bracket: s·cos(t)·s²cos²(t) = s³cos³(t), and s·cos(t)·3s³cos(t)sin²(t) = 3s⁴cos²(t)sin²(t). Collecting all four terms gives the result below; the powers of s differ from term to term, so no further simplification via the Pythagorean identity is possible.
∂z/∂t = s³cos³(t) − 2s³cos(t)sin²(t) + 3s⁴cos²(t)sin²(t) − s⁴sin⁴(t)
7
Step 7 — Verify (Direct Differentiation)We verify by substituting x = s·cos(t) and y = s·sin(t) directly into z before differentiating. z = x²y + xy³ = (s·cos(t))²(s·sin(t)) + (s·cos(t))(s·sin(t))³ = s³cos²(t)sin(t) + s⁴cos(t)sin³(t). Differentiating this expression with respect to s (treating t as constant) gives ∂z/∂s = 3s²cos²(t)sin(t) + 4s³cos(t)sin³(t), which matches Step 5 exactly. Differentiating the same expression with respect to t: ∂z/∂t = s³·d/dt[cos²(t)sin(t)] + s⁴·d/dt[cos(t)sin³(t)]. Using the product rule, d/dt[cos²(t)sin(t)] = −2cos(t)sin²(t) + cos³(t), and d/dt[cos(t)sin³(t)] = −sin⁴(t) + 3cos²(t)sin²(t). Substituting back: ∂z/∂t = s³(cos³(t) − 2cos(t)sin²(t)) + s⁴(3cos²(t)sin²(t) − sin⁴(t)) = s³cos³(t) − 2s³cos(t)sin²(t) + 3s⁴cos²(t)sin²(t) − s⁴sin⁴(t), which matches Step 6 exactly. Both results are confirmed by direct differentiation.

Comparisons & Common Pitfalls

Students frequently encounter difficulties when applying the multivariable chain rule, often because they conflate it with the single-variable version or misidentify dependent and independent variables. The following comparison highlights the key distinctions between the single-variable and multivariable chain rules, and the pitfall table identifies errors to avoid.

Single-variable vs. multivariable chain rule
FeatureSingle-Variable Chain RuleMultivariable Chain Rule
Number of terms1 product (single path)Sum of products (one per intermediate variable)
Derivative notationOrdinary derivatives dy/dxPartial derivatives ∂z/∂x, may mix with ordinary derivatives
Required conditionBoth functions differentiableOuter function differentiable (not just partials exist)
Result typeSingle derivativeOne formula per independent variable
Matrix formScalar multiplicationJacobian matrix multiplication

Common Pitfalls

  • Forgetting a term: Always draw the dependency tree. If z depends on x and y, and both depend on t, you need two terms—one for each intermediate variable. Missing the y-path is the single most common error.
  • Confusing ∂ and d: Use ∂ (partial) when multiple independent variables exist at that level; use d (ordinary) only when the function ultimately depends on a single independent variable.
  • Evaluating at the wrong point: The partial derivatives ∂f/∂x and ∂f/∂y must be evaluated at the intermediate variable values (g(s,t), h(s,t)), not at the independent variable values directly.
  • Applying to non-differentiable functions: The rule requires differentiability of f, which is strictly stronger than the existence of partial derivatives. Functions that have partials everywhere but aren't differentiable (e.g., f(x,y) = xy/√(x²+y²) at the origin) can give incorrect results.
✦ KEY TAKEAWAY
The multivariable chain rule is not a separate, exotic formula—it is the natural extension of the single-variable chain rule to functions with multiple inputs. Just as the single-variable rule says 'derivative of the outer times derivative of the inner,' the multivariable rule says 'sum over all inner variables of (partial of outer with respect to that inner variable) times (derivative of that inner variable with respect to the independent variable).' If you can draw the tree, you can write the formula.

Connections to Advanced Theory

The multivariable chain rule is far more than a computational tool—it is a gateway to several of the deepest ideas in advanced mathematics and physics. The Jacobian matrix formulation, in particular, connects the chain rule to linear algebra, differential geometry, and dynamical systems. Below we sketch how the chain rule reappears in these advanced settings.

The chain rule in advanced mathematics and applications
Advanced TopicRole of the Chain Rule
Implicit DifferentiationWhen F(x, y) = 0 defines y implicitly, the chain rule applied to F yields dy/dx = −Fₓ/F_y, the implicit function theorem's derivative formula.
Coordinate TransformationsConverting between Cartesian, polar, cylindrical, or spherical coordinates requires the chain rule to express partial derivatives in the new coordinate system. The Jacobian determinant gives the volume scaling factor.
Gradient in Curvilinear CoordinatesThe gradient, divergence, and curl operators in non-Cartesian coordinates are derived using the chain rule to relate ∂/∂r, ∂/∂θ, etc. to ∂/∂x, ∂/∂y, ∂/∂z.
Backpropagation in Neural NetworksThe backpropagation algorithm is precisely the multivariable chain rule applied recursively through layers of a computational graph. Each layer is an intermediate variable, and gradients are propagated by summing over all paths.
Differential Forms & ManifoldsOn smooth manifolds, the chain rule governs how tangent vectors and differential forms transform under coordinate changes, forming the foundation of modern differential geometry.

Perhaps the most striking modern application is in machine learning. When training a deep neural network, the loss function depends on the weights through a long chain of compositions—one for each layer. Computing the gradient of the loss with respect to each weight is exactly a multivariable chain rule computation. The efficiency of backpropagation comes from recognizing that intermediate partial derivatives can be cached and reused, mirroring the structure of the dependency tree. In this sense, every gradient descent step in deep learning is powered by the same chain rule you learn in Calculus 3, applied at massive scale.

Practice Problems

PROBLEM 1 — CONCEPTUAL
Suppose w = f(x, y, z) where x, y, and z are all functions of a single variable t. Without computing anything, explain why dw/dt has exactly three terms and describe what each term represents geometrically or physically.
PROBLEM 2 — BASIC CALCULATION
Let z = x² − 3xy, where x = 2t and y = t². Use the chain rule to find dz/dt.
PROBLEM 3 — INTERMEDIATE
Let z = eˣʸ, where x = s² + t and y = s − t². Find ∂z/∂s and ∂z/∂t.
PROBLEM 4 — APPLIED
The temperature at a point in the xy-plane is T(x, y) = 100 − x² − 2y². A particle moves along the path x(t) = 3cos(t), y(t) = 2sin(t). At what rate is the temperature experienced by the particle changing at t = π/4?
PROBLEM 5 — CRITICAL THINKING
Prove that if z = f(x − y, y − x), then ∂z/∂x + ∂z/∂y = 0 for any differentiable function f of two variables. (Hint: Let u = x − y and v = y − x and apply the chain rule.)

Summary & Review

The multivariable chain rule extends the single-variable chain rule to functions of several variables by summing contributions from every intermediate variable. The core formula for z = f(x, y) with x = g(s, t), y = h(s, t) is ∂z/∂s = (∂f/∂x)(∂x/∂s) + (∂f/∂y)(∂y/∂s), with an analogous formula for each independent variable. The essential technique is to draw a dependency tree, then apply the principle: multiply partial derivatives along each path from the independent variable to the output, then sum over all paths.

In its most general form, the chain rule is expressed as a Jacobian matrix product: J(f ∘ g) = Jf · Jg. This elegant formulation unifies every specific case and extends to functions between spaces of any dimension. The rule requires differentiability of the outer function (not merely the existence of partial derivatives). Mastery of the multivariable chain rule is essential for implicit differentiation, coordinate transformations, Lagrangian mechanics, and backpropagation in machine learning—making it one of the most widely applied tools in all of mathematics.

Varsity Tutors • Calculus 3 • Multivariable Chain Rule — Chain Rule in Multiple Variables