SECTION 1
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
1755 • Euler's Systematic Use of Partial Derivatives
1797 • Lagrange's Analytic Mechanics
1870s • Rigorous Foundations by Weierstrass and Schwarz
1900s • Modern Formulation via Total Derivatives and Jacobians
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.
SECTION 2
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.
Partial Derivatives
Composite Functions in Several Variables
Dependency Trees
Differentiability Requirement
Summing Over Intermediate Variables
KEY TAKEAWAY
SECTION 3
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.
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).
SECTION 4
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
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
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
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
SECTION 5
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.
| Configuration | Setup | Chain Rule Formula | # of Terms |
|---|---|---|---|
| Case 1a | z = f(x, y), x = x(t), y = y(t) | dz/dt = fₓ · x′(t) + · y′(t) | 2 |
| Case 1b | w = f(x, y, z), x = x(t), y = y(t), z = z(t) | dw/dt = fₓ · x′ + · y′ + · z′ | 3 |
| Case 2 | z = f(x, y), x = x(s, t), y = y(s, t) | ∂z/∂s = fₓ · ∂x/∂s + · ∂y/∂s | 2 per independent var |
| General | z = f(x₁, …, xₙ), xᵢ = xᵢ(t₁, …, tₘ) | ∂z/∂tⱼ = Σᵢ (∂f/∂xᵢ)(∂xᵢ/∂tⱼ) | n per independent var |
Common multivariable chain rule configurations
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.
SECTION 6
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 Problem
Let 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 Tree
z 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 Functions
From 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.
SECTION 7
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.
| Feature | Single-Variable Chain Rule | Multivariable Chain Rule |
|---|---|---|
| Number of terms | 1 product (single path) | Sum of products (one per intermediate variable) |
| Derivative notation | Ordinary derivatives dy/dx | Partial derivatives ∂z/∂x, may mix with ordinary derivatives |
| Required condition | Both functions differentiable | Outer function differentiable (not just partials exist) |
| Result type | Single derivative | One formula per independent variable |
| Matrix form | Scalar multiplication | Jacobian matrix multiplication |
Single-variable vs. multivariable chain rule
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
SECTION 8
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.
| Advanced Topic | Role of the Chain Rule |
|---|---|
| Implicit Differentiation | When F(x, y) = 0 defines y implicitly, the chain rule applied to F yields dy/dx = −Fₓ/, the implicit function theorem's derivative formula. |
| Coordinate Transformations | Converting 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 Coordinates | The 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 Networks | The 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 & Manifolds | On smooth manifolds, the chain rule governs how tangent vectors and differential forms transform under coordinate changes, forming the foundation of modern differential geometry. |
The chain rule in advanced mathematics and applications
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.
SECTION 9
Practice Problems
Question 1: CONCEPTUAL
Show answer
Question 2: BASIC CALCULATION
Show answer
Question 3: INTERMEDIATE
Show answer
Question 4: APPLIED
Show answer
Question 5: CRITICAL THINKING
Show answer
SUMMARY
Summary & Review
Summary
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.