Active Calculus · 10: Derivatives of Multivariable Functions

10.5: The Chain Rule

Motivating Questions
  • What is the Chain Rule and how do we use it to find a derivative?
  • How can we use a tree diagram to guide us in applying the Chain Rule?

In single-variable calculus, we encountered situations in which some quantity zz depends on yy and, in turn, yy depends on x.x\text{.} A change in xx produces a change in y,y\text{,} which consequently produces a change in z.z\text{.} Using the language of differentials that we saw in the previous section, these changes are naturally related by

dz=dzdy dy and dy=dydx dx. dz = \frac{dz}{dy}~dy \ \mbox{and} \ dy = \frac{dy}{dx}~dx.

In terms of instantaneous rates of change, we then have

dz=dzdydydx dx=dzdx dx dz = \frac{dz}{dy}\frac{dy}{dx}~dx = \frac{dz}{dx}~dx

and thus

dzdx=dzdydydx. \frac{dz}{dx} = \frac{dz}{dy}\frac{dy}{dx}.

This most recent equation we call the Chain Rule.

In the case of a function ff of two variables where z=f(x,y),z = f(x,y)\text{,} it might be that both xx and yy depend on another variable t.t\text{.} A change in tt then produces changes in both xx and y,y\text{,} which then cause zz to change. In this section we will see how to find the change in zz that is caused by a change in t,t\text{,} leading us to multivariable versions of the Chain Rule involving both regular and partial derivatives.

Preview Activity 10.5.110.5.1

Suppose you are driving around in the xyxy-plane in such a way that your position r(t)\mathbf{r}(t) at time tt is given by function

r(t)=⟨x(t),y(t)⟩=⟨2−t2,t3+1⟩. \mathbf{r}(t) = \langle x(t), y(t) \rangle = \langle 2-t^2, t^3 + 1\rangle.

The path taken is shown on the left of Figure 10.5.110.5.1.

fig_10_5_preview_r.svgfig_10_5_preview_h.svg

Figure 10.5.110.5.1. Left: Your position in the plane. Right: The corresponding temperature.

Suppose, furthermore, that the temperature at a point in the plane is given by

T(x,y)=10−12x2−15y2, T(x,y) = 10 - \frac12x^2 -\frac15y^2,

and note that the surface generated by TT is shown on the right of Figure 10.5.110.5.1. Therefore, as time passes, your position (x(t),y(t))(x(t), y(t)) changes, and, as your position changes, the temperature T(x,y)T(x,y) also changes.

  1. The position function r\mathbf r provides a parameterization x=x(t)x = x(t) and y=y(t)y = y(t) of the position at time t.t\text{.} By substituting x(t)x(t) for xx and y(t)y(t) for yy in the formula for T,T\text{,} we can write T=T(x(t),y(t))T = T(x(t), y(t)) as a function of t.t\text{.} Make these substitutions to write TT as a function of tt and then use the Chain Rule from single variable calculus to find dTdt.\frac{dT}{dt}\text{.} (Do not do any algebra to simplify the derivative, either before taking the derivative, nor after.)
  2. Now we want to understand how the result from part (a) can be obtained from TT as a multivariable function. Recall from the previous section that small changes in xx and yy produce a change in TT that is approximated by
    ΔT≈TxΔx+TyΔy. \Delta T \approx T_x\Delta x + T_y\Delta y.

    The Chain Rule tells us about the instantaneous rate of change of T,T\text{,} and this can be found as

    lim⁡Δt→0ΔTΔt=lim⁡Δt→0TxΔx+TyΔyΔt. \lim_{\Delta t \to 0} \frac{\Delta T}{\Delta t} = \lim_{\Delta t \to 0} \frac{T_x \Delta x + T_y \Delta y}{\Delta t}.

    Use Equation \ref{eq_PA_10_5_1} to explain why the instantaneous rate of change of TT that results from a change in tt is

    dTdt=∂T∂xdxdt+∂T∂ydydt.  \frac{dT}{dt} = \frac{\partial T}{\partial x} \frac{dx}{dt} + \frac{\partial T}{\partial y} \frac{dy}{dt}. 
  3. Using the original formulas for T,T\text{,} x,x\text{,} and yy in the problem statement, calculate all of the derivatives in Equation \ref{eq_PA_10_5_2} (with TxT_x and TyT_y in terms of xx and y,y\text{,} and x′x' and y′y' in terms of tt), and hence write the right-hand side of Equation \ref{eq_PA_10_5_2} in terms of x,x\text{,} y,y\text{,} and t.t\text{.}
  4. Compare the results of parts (a) and (c). Write a couple of sentences that identify specifically how each term in (c) relates to a corresponding terms in (a). This connection between parts (a) and (c) provides a multivariable version of the Chain Rule.

As Preview Activity 10.5.110.5.1 suggests, the following version of the Chain Rule holds in general.

Chain Rule

Let z=f(x,y),z = f(x,y)\text{,} where ff is a differentiable function of the independent variables xx and y,y\text{,} and let xx and yy each be differentiable functions of an independent variable t.t\text{.} Then

dzdt=∂z∂xdxdt+∂z∂ydydt. \frac{dz}{dt} = \frac{\partial z}{\partial x} \frac{dx}{dt} + \frac{\partial z}{\partial y} \frac{dy}{dt}.

It is important to note the differences among the derivatives in Equation \ref{E_10_5_chain_rule}. Since zz is a function of the two variables xx and y,y\text{,} the derivatives in the Chain Rule for zz with respect to xx and yy are partial derivatives. However, since x=x(t)x = x(t) and y=y(t)y = y(t) are functions of the single variable t,t\text{,} their derivatives are the standard derivatives of functions of one variable. When we compose zz with x(t)x(t) and y(t),y(t)\text{,} we then have zz as a function of the single variable t,t\text{,} making the derivative of zz with respect to tt a standard derivative from single variable calculus as well.

To understand why this Chain Rule works in general, suppose that some quantity zz depends on xx and yy so that

dz=∂z∂x dx+∂z∂y dy. dz = \frac{\partial z}{\partial x}~dx + \frac{\partial z}{\partial y}~dy.

Next, suppose that xx and yy each depend on another quantity t,t\text{,} so that

dx=dxdt dt and dy=dydt dt.  dx = \frac{dx}{dt}~dt \ \mbox{and} \ dy = \frac{dy}{dt}~dt. 

Combining Equations \ref{E_10_5_1} and \ref{E_10_5_2}, we find that

dz=∂z∂xdxdt dt+∂z∂ydydt dt=dzdt dt, dz = \frac{\partial z}{\partial x}\frac{dx}{dt}~dt + \frac{\partial z}{\partial y}\frac{dy}{dt}~dt = \frac{dz}{dt}~dt,

which is the Chain Rule in this particular context, as expressed in Equation \ref{E_10_5_chain_rule}.

Activity 10.5.210.5.2

In the following questions, we apply the Chain Rule in several different contexts.

  1. Suppose that we have a function zz defined by z(x,y)=x2+xy3.z(x,y) = x^2+xy^3\text{.} In addition, suppose that xx and yy are restricted to points that move around the plane by following a circle of radius 22 centered at the origin that is parameterized by
    x(t)=2cos⁡(t), and  y(t)=2sin⁡(t). x(t) = 2\cos(t), \ \mbox{and } \ y(t) = 2\sin(t).
    1. Use the Chain Rule to find the resulting instantaneous rate of change dzdt.\frac{dz}{dt}\text{.}
    2. Substitute x(t)x(t) for xx and y(t)y(t) for yy in the rule for zz to write zz in terms of tt and calculate dzdt\frac{dz}{dt} directly. Compare to the result of part (i.).
  2. Suppose that the temperature on a metal plate is given by the function TT with
    T(x,y)=100−(x2+4y2), T(x,y) = 100-(x^2 + 4y^2),

    where the temperature is measured in degrees Fahrenheit and xx and yy are each measured in feet.

    1. Find TxT_x and Ty.T_y\text{.} What are the units on these partial derivatives?
    2. Suppose an ant is walking along the xx-axis at the rate of 2 feet per minute toward the origin. When the ant is at the point (2,0),(2,0)\text{,} what is the instantaneous rate of change in the temperature dT/dtdT/dt that the ant experiences. Include units on your response.
    3. Suppose instead that the ant walks along an ellipse with x=6cos⁡(t)x = 6\cos(t) and y=3sin⁡(t),y = 3\sin(t)\text{,} where tt is measured in minutes. Find dTdt\frac{dT}{dt} at t=π/6,t = \pi/6\text{,} t=π/4,t=\pi/4\text{,} and t=π/3.t = \pi/3\text{.} What does this seem to tell you about the path along which the ant is walking?
  3. Suppose that you are walking along a surface whose elevation is given by a function f.f\text{.} Furthermore, suppose that if you consider how your location corresponds to points in the xyxy-plane, you know that when you pass the point (2,1),(2,1)\text{,} your velocity vector is v=⟨−1,2⟩.\mathbf v=\langle -1,2\rangle\text{.} If some contours of ff are as shown in Figure 10.5.210.5.2, estimate the rate of change df/dtdf/dt when you pass through (2,1).(2,1)\text{.}

fig_10_3_activity_contour-2.svg

Figure 10.5.210.5.2. Some contours of f.f\text{.}

Tree Diagrams

Up to this point, we have applied the Chain Rule to situations where we have a function zz of variables xx and y,y\text{,} with both xx and yy depending on another single quantity t.t\text{.} We may apply the Chain Rule, however, when xx and yy each depend on more than one quantity, or when zz is a function of more than two variables. It can be challenging to keep track of all the dependencies among the variables, and thus a tree diagram can be a useful tool to organize our work. For example, suppose that zz depends on xx and y,y\text{,} and xx and yy both depend on t.t\text{.} We may represent these relationships using the tree diagram shown at left Figure 10.5.310.5.3. We place the dependent variable at the top of the tree and connect it to the variables on which it depends one level below. We then connect each of those variables to the variable on which each depends.

fig_10_5_tree_3.svg fig_10_5_tree_1.svg

Figure 10.5.310.5.3. A tree diagram illustrating dependencies.

To represent the Chain Rule, we label every edge of the diagram with the appropriate derivative or partial derivative, as seen above in Figure 10.5.310.5.3. To calculate an overall derivative according to the Chain Rule, we construct the product of the derivatives along all paths connecting the variables and then add all of these products. For example, the diagram above in Figure 10.5.310.5.3 illustrates the Chain Rule

dzdt=∂z∂xdxdt+∂z∂ydydt. \frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt}.
Activity 10.5.310.5.3
  1. Figure 10.5.410.5.4 shows the tree diagram we construct when (a) zz depends on w,w\text{,} x,x\text{,} and y,y\text{,} (b) w,w\text{,} x,x\text{,} and yy each depend on uu and v,v\text{,} and (c) uu and vv depend on t.t\text{.}
    fig_10_5_tree_2.svg

    Figure 10.5.410.5.4. Three levels of dependencies

    1. Label the edges with the appropriate derivatives.
    2. Use the Chain Rule to write dzdt.\frac{dz}{dt}\text{.}
  2. Suppose that z=x2−2xy2z=x^2 - 2xy^2 and that
    x=rcos⁡(θ)y=rsin⁡(θ).\begin{align*} x& =r\cos(\theta)\\[4pt] y& =r\sin(\theta). \end{align*}
    1. Construct a tree diagram representing the dependencies of zz on xx and yy and xx and yy on rr and θ.\theta\text{.}
    2. Use the tree diagram to find ∂z∂r.\frac{\partial z}{\partial r}\text{.}
    3. Now suppose that r=3r = 3 and θ=π/6.\theta=\pi/6\text{.} Find the values of xx and yy that correspond to these given values of rr and θ,\theta\text{,} and then use the Chain Rule to find the value of the partial derivative ∂z∂θ∣(3,π6).\frac{\partial z}{\partial \theta}|_{(3,\frac{\pi}{6})}\text{.}

Summary

  • The Chain Rule is a tool for differentiating a composite for functions. In its simplest form, it says that if f(x,y)f(x,y) is a function of two variables and x(t)x(t) and y(t)y(t) depend on t,t\text{,} then
    dfdt=∂f∂xdxdt+∂f∂ydydt. \frac{df}{dt} = \frac{\partial f}{\partial x}\frac{dx}{dt} + \frac{\partial f}{\partial y}\frac{dy}{dt}.
  • A tree diagram can be used to represent the dependence of variables on other variables. By following the links in the tree diagram, we can form chains of partial derivatives or derivatives that can be combined to give a desired partial derivative.

Credit and licence

This page titled 10.5: The Chain Rule was last modified on Fri, 29 Sep 2023 18:59:37 GMT and is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Matthew Boelkins, David Austin, and Steven Schlicker ( ScholarWorks @Grand Valley State University ) via source content that was edited to the style and standards of the LibreTexts platform.

Source: https://math.libretexts.org/Bookshelves/Calculus/Active_Calculus_(Boelkins_et_al.)/10%3A_Derivatives_of_Multivariable_Functions/10.05%3A_The_Chain_Rule

Licence: CC BY-SA 4.0 (creativecommons.org/licenses/by-sa/4.0/). You may share and adapt it under the same licence, with this credit. WorldClass adapted the formatting only: the text is the authors', with interactive parts and links to other sites left out.

Build status · Flash Infinity AI™ is a trademark of AI-Flash Inc.. WorldClass is not affiliated with, approved or accredited by any exam board, curriculum provider or university unless a page says so.