Skip to content

15. The Chain Rule

mike nicholas edited this page Sep 11, 2026 · 25 revisions

Function dependencies can get complicated. Say we want to track the temperature throughout the day at a point $\large (x,y,z)$. We have the multivariable function:

$$\large T=T(x,y,z,t)$$

But what if, instead, we are tracking the temperature at our location throughout the day? Our $\large (x,y,z)$ location changes as we go about our daily routine. The function instead is:

$$\large T=T(x(t),y(t),z(t),t)$$

This is a composition of functions. For a derivative, we will need the chain rule.

Quick recap of the single variable chain rule

With $\large y = f(x)$, a $\large \displaystyle \frac{dy}{dx}$ measures a response in $\large y$ to a change in $\large x$..."if we increase $\large x$ slightly, how does $\large y$ change?"

When we have a composition $\large y = f(g(x))$, a $\large \displaystyle \frac{dy}{dx}$ still measures the same thing, but the dependencies are more interesting. The chain rule:

$$\large y'(x)=f'(g(x))g'(x)$$

This product can the thought of as "the change in $\large f$ causes by a change in $\large g$, amplified by how quickly $\large g$ changes in response to a change in $\large x$".

With multivariable functions, there are more possible dependencies. The chain rule tracks all the ways a dependent variable can change and adds them together for a total rate of change. There are infinitely many possible combinations of variables, but all cases fall into one of two main categories.

Chain rule with a single independent variable

The first category: $\large f(t) = f\left(x(t),y(t),z(t)\right)$:

  • $\large t$ is an independent variable.
  • $\large x$, $\large y$, and $\large z$ are intermediate variables.
  • $\large f$ is the dependent variable.

In this situation, the function ultimately depends on a single independent variable. The question is "If we increase $\large t$ slightly, what happens to $\large f$?" The chain rule in this situation:

$$\large \frac{df}{dt}=\frac{\partial f}{\partial x}\frac{dx}{dt}+\frac{\partial f}{\partial y}\frac{dy}{dt}+\frac{\partial f}{\partial z}\frac{dz}{dt}$$

Notes:

  • This is $\large \displaystyle \frac{df}{dt}$ or $\large f'(t)$ and not $\large \displaystyle \frac{\partial f}{\partial t}$ or $\large f_t$. There is ultimately only one independent variable, so we a looking for a single variable derivative.
  • The term $\large \displaystyle \frac{\partial f}{\partial x}\frac{\partial x}{\partial t}$ is "How $\large f$ changes in response to a change in $\large x$, amplified by how $\large x$ changes with $\large t$".
  • The Leibniz notation is very helpful here because if we pretend the derivatives are fractions, each term on the right cancels to give us $\large \displaystyle \frac{df}{dt}$, the term on the left. This is a quick, easy way to make sure our chain rule terms are correct.
  • In prime notation, the above is: $\large f'(t)=f_x\left(x(t),y(t),z(t)\right)x'(t)+f_y\left(x(t),y(t),z(t)\right)y'(t)+f_z\left(x(t),y(t),z(t)\right)z'(t)$

Chain rule with multiple independent variables

The other possibility is a function dependent on multiple independent variables:

$$\large f(x,y) = f(u(x,y),v(x,y))$$
  • $\large x$ and $\large y$ are independent variables.
  • $\large u$ and $\large v$ are intermediate variables.
  • $\large f$ is the dependent variable. In this situation, the function depends on two independent variables. The question is "If we increase $\large x$ slightly while holding $\large y$ constant, what happens to $\large f$?" The chain rule in this situation:
$$\large \begin{split} \frac{\partial f}{\partial x}&=\frac{\partial f}{\partial u}\frac{\partial u}{\partial x}+\frac{\partial f}{\partial v}\frac{\partial v}{\partial x}\\\ \frac{\partial f}{\partial y}&=\frac{\partial f}{\partial u}\frac{\partial u}{\partial y}+\frac{\partial f}{\partial v}\frac{\partial v}{\partial y}\\\ \end{split}$$

Notes:

  • This is $\large \displaystyle \frac{\partial f}{\partial x}$ or $\large f_x(x,y)$ and not $\large \displaystyle \frac{df}{dx}$ or $\large f'(x)$. There are two independent variables, so we need to specify which is the variable of differentiation.
  • The term $\large \displaystyle \frac{\partial f}{\partial u}\frac{\partial u}{\partial y}$ is "How $\large f$ changes in response to a change in $\large u$, amplified by how $\large u$ changes with $\large y$".
  • The Leibniz notation is once again very helpful here. If we pretend all these derivatives are fractions, we can easily check that we have the right combination of stuff on the right hand side.
  • In subscript notation, the first derivative above is: $\large f_x=f_u\left(u(x,y),v(x,y)\right)u_x(x,y)+f_v\left(u(x,y),v(x,y)\right)v_x(x,y)$

Here's a video of a chain rule problem:

There a infinitely many combinations of independent variables and intermediate variables, but the two cases above cover all of them. If we think of these as patterns rather than rules to memorize, things will be easier.

Tomorrow's class:

  • Practice using the chain rule
  • The chain rule on implicitly defined surfaces

Section Outcomes:

I can:

  • Use the chain rule to find derivatives of multivariable functions.
  • Use the chain rule to find slopes on implicitly defined surfaces.

Other resources

For more on the chain rule, see https://openstax.org/books/calculus-volume-3/pages/4-5-the-chain-rule

Clone this wiki locally