Generalized Chain Rule, MATH 163 Section 14.5 – Study Notes
offline

Source: MATH 163 Abridged Class Notes, University of Washington

Difficulty: Intermediate | Prerequisites: MATH 151 chain rule (single-variable), partial derivatives (MATH 163 Ch. 14.1–14.4)


Big Picture

In single-variable calculus you learned one chain rule: differentiate the outer function, multiply by the derivative of the inner. In multivariable calculus the same idea applies, but now the outer function has several inputs, each of which may depend on one or more independent variables. The generalized chain rule tells you how to combine partial derivatives of the outer function with ordinary (or partial) derivatives of the inner functions so you can differentiate the whole composition. If you are comfortable with partial derivatives (Sections 14.1 to 14.4), you have all the pieces you need here.


TL;DR

When a multivariable function's inputs are themselves functions of other variables, you differentiate the composition by taking the partial derivative with respect to each intermediate variable, multiplying by that variable's derivative with respect to the independent variable, and adding the results. A dependency diagram (the "tree method") makes it mechanical to write down the correct formula, no matter how many variables are involved.


Key Terms

Chain rule (single-variable, Calculus I review)

If y = f(g(x)), then dy/dx = f'(g(x)) · g'(x). Equivalently, dy/dx = (dy/du)(du/dx) where u = g(x). Think of it as: differentiate the outside, then multiply by the derivative of the inside.

Generalized chain rule (multivariable, Version 1)

For z = f(x, y) where x = x(t) and y = y(t), the total derivative with respect to t is dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt). In simple terms, you take one "path" through each intermediate variable, multiply the derivatives along each path, and add them all up.

Generalized chain rule (multivariable, Version 2)

When the intermediate variables themselves depend on more than one independent variable, e.g. x = x(s, t) and y = y(s, t), you get partial derivatives instead: ∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s), and similarly for ∂z/∂t. In simple terms, the formula is the same "multiply along each path and add" rule, but every derivative is now a partial derivative because there are multiple independent variables.

Tree diagram / dependency diagram ("tree method")

A visual tool for writing the chain rule formula. You draw the dependent variable at the top, the intermediate variables in the middle, and the independent variables at the bottom. Each edge represents a derivative. To find the derivative with respect to a given independent variable, you trace every path from top to bottom, multiply the derivatives along each path, and sum the results. Think of it as a map that tells you exactly which partial derivatives to multiply and add.


Core Content

Calculus I chain rule recap

  • For y = f(g(x)): d/dx f(g(x)) = f'(g(x)) · g'(x)

  • Leibniz notation: dy/dx = (dy/du)(du/dx) where u = g(x)

  • This is the foundation everything below generalises from.

Version 1: one independent variable

Suppose z = f(x, y) where x = x(t) and y = y(t). Both intermediate variables depend on a single independent variable t.

  • dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt)

  • You take the partial of z with respect to each intermediate variable, multiply by that variable's ordinary derivative with respect to t, and sum.

Worked example. Let f(x, y) = x² + y² + xy, with x(t) = sin(t) and y(t) = eᵗ.

  • Partial derivatives: f_x = 2x + y, f_y = 2y + x

  • Ordinary derivatives: x'(t) = cos(t), y'(t) = eᵗ

  • Chain rule: dz/dt = (2x + y)cos(t) + (2y + x)eᵗ

  • Substituting x = sin(t), y = eᵗ gives: 2 sin(t) cos(t) + eᵗ cos(t) + 2e²ᵗ + eᵗ sin(t)

You can verify this by substituting x(t) and y(t) into f first and differentiating directly. Both methods produce the same result.

Second worked example. f(x, y) = x²y + 3xy⁴, x(t) = sin(2t), y(t) = cos(t).

  • f_x = 2xy + 3y⁴, f_y = x² + 12xy³

  • x'(t) = 2 cos(2t), y'(t) = -sin(t)

  • dz/dt = (2xy + 3y⁴)(2 cos(2t)) - (x² + 12xy³) sin(t)

Version 2: multiple independent variables

Now suppose z = f(x, y) where x = x(s, t) and y = y(s, t). Both intermediate variables depend on two independent variables.

  • ∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s)

  • ∂z/∂t = (∂z/∂x)(∂x/∂t) + (∂z/∂y)(∂y/∂t)

  • Notice: every derivative on the right is now partial, and you get one chain-rule equation per independent variable.

Worked example. f(x, y) = tan(xy²), x(s, t) = s² + t², y(s, t) = t² cos(s).

  • f_x = sec²(xy²) · y², f_y = sec²(xy²) · 2xy

  • x_s = 2s, x_t = 2t

  • y_s = -t² sin(s), y_t = 2t cos(s)

  • ∂z/∂s = sec²(xy²) · y² · 2s - t² sin(s) · sec²(xy²) · 2xy

  • ∂z/∂t = 2ty² sec²(xy²) + 4xyt cos(s) sec²(xy²)

Extending to more variables

The pattern scales naturally. If Q = f(x, y, z) and each of x, y, z depends on r and t, you get:

  • ∂Q/∂r = (∂Q/∂x)(∂x/∂r) + (∂Q/∂y)(∂y/∂r) + (∂Q/∂z)(∂z/∂r)

  • ∂Q/∂t = (∂Q/∂x)(∂x/∂t) + (∂Q/∂y)(∂y/∂t) + (∂Q/∂z)(∂z/∂t)

One term per intermediate variable, one equation per independent variable. The tree diagram makes the bookkeeping straightforward.

The tree method

Draw the dependent variable at the top. Branch down to each intermediate variable. From each intermediate variable, branch down to every independent variable it depends on.

  • Each edge represents a (partial) derivative.

  • To find the derivative with respect to one independent variable, trace every path from top to that variable.

  • Multiply the derivatives along each path.

  • Add the products.

This is especially useful when you have three or more layers of dependence, or when the intermediate variables depend on different subsets of the independent variables.


Formulas

\frac{d}{dx} f(g(x)) = f'(g(x)) \cdot g'(x)
\frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt}
\frac{\partial z}{\partial s} = \frac{\partial z}{\partial x}\frac{\partial x}{\partial s} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial s}

The general pattern for z = f(x₁, x₂, …, xₙ) where each xᵢ depends on independent variables s₁, s₂, …, sₘ:

\frac{\partial z}{\partial s_j} = \sum_{i=1}^{n} \frac{\partial z}{\partial x_i} \frac{\partial x_i}{\partial s_j}

Real-World Applications

The multivariable chain rule is the mathematical backbone of related-rates problems in physics and engineering. Whenever a quantity depends on several variables that each change with time (temperature, pressure, position, concentration), this rule tells you how fast the overall quantity is changing. It also underpins the backpropagation algorithm used to train neural networks, where gradients must be propagated through layers of composed functions.


Common Misconceptions

  • Students often confuse d (ordinary derivative) with ∂ (partial derivative). Use d when the intermediate variable depends on only one independent variable, ∂ when it depends on more than one.

  • A common mistake is forgetting a term. If z depends on x and y, both of which depend on t, you need both the ∂z/∂x and ∂z/∂y paths. Dropping one gives the wrong answer.

  • Some students try to "cancel" the ∂x terms in (∂z/∂x)(∂x/∂s) as though they were fractions. Partial derivative notation does not work that way, and the cancellation is only a useful mnemonic, not a rigorous operation.

  • Another error is leaving the answer in terms of the intermediate variables (x, y) when the problem asks for everything in terms of the independent variables (s, t). Always substitute back unless told otherwise.


Why It Matters / Exam Flags

⚠️ Expect to be given f(x, y), x(t), and y(t) and asked to find dz/dt. This is the bread-and-butter chain rule problem.

⚠️ Problems with two independent variables (s, t) are common. You will need to find both ∂z/∂s and ∂z/∂t.

⚠️ Drawing the tree diagram is often worth partial credit and helps you avoid missing a term.

⚠️ Related-rates problems from Calculus I can reappear, solved now with the multivariable chain rule instead of implicit differentiation. The two-cars problem (distance changing at 65 mph) is a classic example.


Quick Self-Test

  1. True or false: if z = f(x, y) and x and y both depend on t, then dz/dt = (∂z/∂x)(∂x/∂t). False. You also need the (∂z/∂y)(dy/dt) term.

  1. Fill in the blank: the method of drawing a diagram with the dependent variable at the top and independent variables at the bottom is called the ______ method. Tree method (dependency diagram).

  1. True or false: when x and y each depend on two variables s and t, the chain rule gives you ordinary derivatives dz/ds and dz/dt. False. You get partial derivatives ∂z/∂s and ∂z/∂t.

  1. Fill in the blank: in the Version 1 chain rule formula for dz/dt, you need to compute ______ partial derivatives of f and ______ ordinary derivatives of the intermediate variables. Two partial derivatives (f_x and f_y) and two ordinary derivatives (dx/dt and dy/dt).

  1. True or false: once you have computed dz/dt using the chain rule, you can verify by substituting x(t) and y(t) into f first and then differentiating directly with respect to t. True.


Practice Q&A

Q: Let f(x, y) = x³y, x(t) = t², y(t) = t + 1. Find dz/dt.

A: f_x = 3x²y, f_y = x³. dx/dt = 2t, dy/dt = 1. So dz/dt = 3x²y · 2t + x³ · 1 = 6t(t²)²(t + 1) + (t²)³ = 6t⁵(t + 1) + t⁶ = 6t⁶ + 6t⁵ + t⁶ = 7t⁶ + 6t⁵.

Q: Let f(x, y) = eˣʸ, x(s, t) = s + t, y(s, t) = st. Find ∂z/∂s.

A: f_x = yeˣʸ, f_y = xeˣʸ. ∂x/∂s = 1, ∂y/∂s = t. So ∂z/∂s = yeˣʸ · 1 + xeˣʸ · t = eˣʸ(y + xt) = eˣʸ(st + (s + t)t) = eˣʸ(st + st + t²) = eˣʸ(2st + t²).

Q: Two cars leave from the same point. One heads south at 60 mph, the other heads west at 25 mph. Using the multivariable chain rule, find the rate at which the distance between them changes at t = 2 hours.

A: Let s(a, b) = sqrt(a² + b²), a(t) = 25t, b(t) = 60t. ds/dt = (∂s/∂a)(da/dt) + (∂s/∂b)(db/dt) = 25a/sqrt(a² + b²) + 60b/sqrt(a² + b²). At t = 2: a = 50, b = 120, sqrt(50² + 120²) = 130. ds/dt = 25(50)/130 + 60(120)/130 = 1250/130 + 7200/130 = 8450/130 = 65 mph.

Q: For the tree diagram of z = f(x, y), x = x(s, t), y = y(s, t), how many terms appear in the formula for ∂z/∂t?

A: Two terms, one for each path from z to t: the path through x gives (∂z/∂x)(∂x/∂t), and the path through y gives (∂z/∂y)(∂y/∂t).


Connections to Other Topics

This connects directly to directional derivatives and the gradient (Section 14.6), where the chain rule is used to show that the directional derivative equals the dot product of the gradient vector with the direction vector. It also generalises the related-rates framework from Calculus I (MATH 151): any related-rates problem can be recast as a multivariable chain rule application. Later in the course, the chain rule appears again when you change coordinate systems (e.g. polar, cylindrical, spherical) for integration.


Related Terms / Search Tags

Multivariable chain rule, generalized chain rule, chain rule for partial derivatives, total derivative, tree diagram, dependency diagram, related rates multivariable, dz/dt, partial derivative chain rule, composition of multivariable functions, Calculus III chain rule, MATH 163, Section 14.5, intermediate variables, independent variables