Lecture 15: Section 14.5 The Chain Rule

In Calculus I, the chain rule was our tool for differentiating composite functions. Now, we extend this powerful idea to multivariable functions. The core concept remains the same: we need a systematic way to find the rate of change of a function when its input variables themselves depend on other variables. This situation arises constantly in science and engineering, such as finding the rate of temperature change for a moving object or the change in pressure along a specific flight path.


Topic 1: The Chain Rule (Case 1)

The simplest case of the multivariable chain rule occurs when we have a function $z = f(x, y)$, but the coordinates $x$ and $y$ are themselves functions of a single variable, say $t$. For example, $f(x,y)$ could be the temperature at any point $(x,y)$ on a plate, and $x=g(t), y=h(t)$ could describe the path of a particle moving on that plate. We want to find how the temperature experienced by the particle changes with respect to time, $\frac{dz}{dt}$.

To keep track of how the variables depend on each other, we use a tree diagram. The final output, $z$, is at the top. It depends on the intermediate variables $x$ and $y$, which in turn depend on the independent variable $t$.

  • $z$
    • $x$
      • $t$
    • $y$
      • $t$

To find the total rate of change of $z$ with respect to $t$, we sum the influences from each path in the tree diagram. The path through $x$ contributes $\frac{\partial z}{\partial x} \frac{dx}{dt}$, and the path through $y$ contributes $\frac{\partial z}{\partial y} \frac{dy}{dt}$.

The Chain Rule (Case 1)

If $z=f(x,y)$, where $x=g(t)$ and $y=h(t)$ are differentiable functions, then $z$ is a differentiable function of $t$ and:

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

Example 1

If $z = x^2 y + 3xy^4$, where $x = \cos(t)$ and $y = \sin(t)$, find $\frac{dz}{dt}$ when $t=0$.

Solution:

We apply the chain rule formula. First, we find the necessary derivatives:

  • $\frac{\partial z}{\partial x} = 2xy + 3y^4$
  • $\frac{\partial z}{\partial y} = x^2 + 12xy^3$
  • $\frac{dx}{dt} = -\sin(t)$
  • $\frac{dy}{dt} = \cos(t)$

Now, we evaluate the $x$ and $y$ values at the given time, $t=0$:

  • $x = \cos(0) = 1$
  • $y = \sin(0) = 0$

Next, we evaluate the partial derivatives at this point $(1,0)$:

  • $\frac{\partial z}{\partial x} \bigg|_{(1,0)} = 2(1)(0) + 3(0)^4 = 0$
  • $\frac{\partial z}{\partial y} \bigg|_{(1,0)} = (1)^2 + 12(1)(0)^3 = 1$

And the derivatives with respect to $t$ at $t=0$:

  • $\frac{dx}{dt} \bigg|_{t=0} = -\sin(0) = 0$
  • $\frac{dy}{dt} \bigg|_{t=0} = \cos(0) = 1$

Finally, we assemble everything using the chain rule formula:

$$ \frac{dz}{dt} = \left(\frac{\partial z}{\partial x}\right)\left(\frac{dx}{dt}\right) + \left(\frac{\partial z}{\partial y}\right)\left(\frac{dy}{dt}\right) = (0)(0) + (1)(1) = 1 $$

So, at $t=0$, the value of $z$ is increasing at a rate of 1 unit per unit of time.

Check Your Understanding #1

Use the Chain Rule to find $\frac{dz}{dt}$ given $z = \ln(x^2 + y^2)$, $x=e^{-t}$, and $y=e^t$.


Topic 2: The Chain Rule (Case 2)

Now we consider a more general case where $z = f(x, y)$, but the intermediate variables $x$ and $y$ are functions of two independent variables, say $s$ and $t$. For instance, $f(x,y)$ could be the altitude at map coordinates $(x,y)$, and $x(s,t)$ and $y(s,t)$ could translate from a different coordinate system (like polar coordinates, where $s=r$ and $t=\theta$). We would want to find how the altitude changes with respect to $s$ and $t$, which are partial derivatives: $\frac{\partial z}{\partial s}$ and $\frac{\partial z}{\partial t}$.

The tree diagram expands to show these new dependencies. To find $\frac{\partial z}{\partial s}$, we only consider the paths that end at $s$.

  • $z$
    • $x$
      • $s$
      • $t$
    • $y$
      • $s$
      • $t$

The Chain Rule (Case 2)

If $z=f(x,y)$, where $x=g(s,t)$ and $y=h(s,t)$ are differentiable, then:

$$ \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} $$

$$ \frac{\partial z}{\partial t} = \frac{\partial z}{\partial x} \frac{\partial x}{\partial t} + \frac{\partial z}{\partial y} \frac{\partial y}{\partial t} $$

Example 2

If $z = e^x \sin(y)$, where $x = st^2$ and $y = s^2t$, find $\frac{\partial z}{\partial s}$ and $\frac{\partial z}{\partial t}$.

Solution:

We calculate all the partial derivatives we need:

  • $\frac{\partial z}{\partial x} = e^x \sin(y)$
  • $\frac{\partial z}{\partial y} = e^x \cos(y)$
  • $\frac{\partial x}{\partial s} = t^2$, $\quad \frac{\partial x}{\partial t} = 2st$
  • $\frac{\partial y}{\partial s} = 2st$, $\quad \frac{\partial y}{\partial t} = s^2$

Now, we assemble the formulas. For $\frac{\partial z}{\partial s}$:

$$ \frac{\partial z}{\partial s} = \left(e^x \sin(y)\right)(t^2) + \left(e^x \cos(y)\right)(2st) $$

Substitute $x=st^2$ and $y=s^2t$ back in for a final answer in terms of $s$ and $t$:

$$ \frac{\partial z}{\partial s} = t^2 e^{st^2} \sin(s^2t) + 2st e^{st^2} \cos(s^2t) $$

Similarly, for $\frac{\partial z}{\partial t}$:

$$ \frac{\partial z}{\partial t} = \left(e^x \sin(y)\right)(2st) + \left(e^x \cos(y)\right)(s^2) $$

$$ \frac{\partial z}{\partial t} = 2st e^{st^2} \sin(s^2t) + s^2 e^{st^2} \cos(s^2t) $$

Check Your Understanding #2

If $w = x^2 + y^2 + z^2$, $x = st$, $y=s\cos(t)$, and $z=s\sin(t)$, find $\frac{\partial w}{\partial s}$ when $s=1, t=0$.


Topic 3: Implicit Differentiation

One of the most elegant applications of the chain rule is in simplifying implicit differentiation. An equation of the form $F(x,y)=0$ can define $y$ as an implicit function of $x$. In Calculus I, we found $\frac{dy}{dx}$ by differentiating the whole equation. With the chain rule, we can derive a direct formula.

If we differentiate $F(x,y)=0$ with respect to $x$, remembering that $y$ is a function of $x$, we are in a Case 1 scenario. We treat $F$ as our function and $x$ as our independent variable. The chain rule gives:

$$ \frac{\partial F}{\partial x}\frac{dx}{dx} + \frac{\partial F}{\partial y}\frac{dy}{dx} = 0 $$

Since $\frac{dx}{dx}=1$, we can solve for $\frac{dy}{dx}$. This logic extends to surfaces defined by $F(x,y,z)=0$, which implicitly defines $z$ as a function of $x$ and $y$.

Formulas for Implicit Differentiation

If $F(x,y)=0$ defines $y$ as a function of $x$, then:

$$ \frac{dy}{dx} = - \frac{F_x}{F_y} = - \frac{\partial F / \partial x}{\partial F / \partial y} $$

If $F(x,y,z)=0$ defines $z$ as a function of $x$ and $y$, then:

$$ \frac{\partial z}{\partial x} = - \frac{F_x}{F_z} \quad \text{and} \quad \frac{\partial z}{\partial y} = - \frac{F_y}{F_z} $$

Example 3

Find $\frac{dy}{dx}$ for the equation $x^3 + y^3 = 6xy$.

Solution:

First, we define $F(x,y)$ by moving all terms to one side:

$F(x,y) = x^3 + y^3 - 6xy = 0$

Next, we find the partial derivatives of $F$:

  • $F_x = \frac{\partial}{\partial x}(x^3 + y^3 - 6xy) = 3x^2 - 6y$
  • $F_y = \frac{\partial}{\partial y}(x^3 + y^3 - 6xy) = 3y^2 - 6x$

Now we apply the formula:

$$ \frac{dy}{dx} = - \frac{F_x}{F_y} = - \frac{3x^2 - 6y}{3y^2 - 6x} = \frac{-(3(x^2 - 2y))}{-(3(2x - y^2))} = \frac{x^2 - 2y}{2x - y^2} $$

This is the same result we would get using the longer method from Calculus I, but often this formula is faster and less prone to algebraic errors.

Check Your Understanding #3

If $x^2 + 2y^2 + 3z^2 = 1$, find $\frac{\partial z}{\partial x}$.


Final Practice

Final Practice Problem #1

The radius $r$ of a right circular cone is increasing at a rate of $2$ cm/s while its height $h$ is decreasing at a rate of $4$ cm/s. At what rate is the volume $V$ changing when the radius is $r=10$ cm and the height is $h=20$ cm? (Recall $V = \frac{1}{3}\pi r^2 h$)

Final Practice Problem #2

Use the Chain Rule to find $\frac{\partial z}{\partial u}$ and $\frac{\partial z}{\partial v}$ if $z = \tan^{-1}(xy)$, $x=u+v$, and $y=u-v$.

Final Practice Problem #3

Find $\frac{\partial z}{\partial y}$ for the implicitly defined surface $e^z = xyz$.


Conclusion

The multivariable chain rule is a fundamental tool that generalizes differentiation to complex systems where variables depend on each other in layers. By using tree diagrams, we can systematically construct the correct derivative formula for any combination of variables. This method not only allows us to solve new types of rate-of-change problems but also provides a more powerful and efficient way to handle implicit differentiation. Understanding this rule is key to mastering the calculus of multivariable functions.

Learning Objectives

After this lecture, you should be able to:

  • Use a tree diagram to model the dependencies between variables.
  • State and apply the chain rule for functions of one or more intermediate variables, each depending on a single independent variable.
  • State and apply the chain rule for functions of one or more intermediate variables, each depending on multiple independent variables.
  • Derive and use the formulas for implicit differentiation for functions of two and three variables.