Skip to main content
Logo image

APEX Calculus

Section 13.5 The Multivariable Chain Rule

Consider driving an off-road vehicle along a dirt road. As you drive, your elevation likely changes. What factors determine how quickly your elevation rises and falls? After some thought, generally one recognizes that one’s velocity (speed and direction) and the terrain influence your rise and fall.
One can represent the terrain as the surface defined by a multivariable function f(x,y); one can represent the path of the off-road vehicle, as seen from above, with a vector-valued function r(t)=x(t),y(t); the velocity of the vehicle is thus r(t)=x(t),y(t).
Consider Figure 13.5.1 in which a surface z=f(x,y) is drawn, along with a dashed curve in the xy-plane. Restricting f to just the points on this circle gives the curve shown on the surface (i.e., “the path of the off-road vehicle.”) The derivative dfdt gives the instantaneous rate of change of f with respect to t. If we consider an object traveling along this path, dfdt=dzdt gives the rate at which the object rises/falls (i.e., “the rate of elevation change” of the vehicle.) Conceptually, the Multivariable Chain Rule combines terrain and velocity information properly to compute this rate of elevation change.
Figure 13.5.1. Understanding the application of the Multivariable Chain Rule
Abstractly, let z be a function of x and y; that is, z=f(x,y) for some function f, and let x and y each be functions of t. By choosing a t-value, x- and y-values are determined, which in turn determine z: this defines z as a function of t. The Multivariable Chain Rule gives a method of computing dzdt.
Figure 13.5.2. Introducing the chain rule in several variables

Subsection 13.5.1 Multivariable Chain Rule, Part I

The Chain Rule of Section 2.5 states that
ddx(f(g(x)))=f(g(x))g(x).
If t=g(x), we can express the Chain Rule as
dfdx=dfdtdtdx;
recall that the derivative notation is deliberately chosen to reflect their fraction-like properties. A similar effect is seen in Theorem 13.5.3. In the second line of equations, one can think of the dx and x as “sort of” canceling out, and likewise with dy and y.
Notice, too, the third line of equations in Theorem 13.5.3. The vector fx,fy contains information about the surface (terrain); the vector x,y can represent velocity. In the context measuring the rate of elevation change of the off-road vehicle, the Multivariable Chain Rule states it can be found through a product of terrain and velocity information.
We now practice applying the Multivariable Chain Rule.
Figure 13.5.4. Examples involving the chain rule

Example 13.5.5. Using the Multivariable Chain Rule.

Let z=x2y+x, where x=sin(t) and y=e5t. Find dzdt using the Chain Rule.
Solution.
Following Theorem 13.5.3, we find
fx(x,y)=2xy+1,fy(x,y)=x2,dxdt=cos(t),dydt=5e5t.
Applying the theorem, we have
dzdt=(2xy+1)cos(t)+5x2e5t.
This may look odd, as it seems that dzdt is a function of x, y and t. Since x and y are functions of t, dzdt is really just a function of t, and we can replace x with sin(t) and y with e5t:
dzdt=(2xy+1)cos(t)+5x2e5t=(2sin(t)e5t+1)cos(t)+5e5tsin2(t).
The previous example can make us wonder: if we substituted for x and y at the end to show that dzdt is really just a function of t, why not substitute before differentiating, showing clearly that z is a function of t?
That is, z=x2y+x=(sin(t))2e5t+sin(t). Applying the Chain and Product Rules, we have
dzdt=2sin(t)cos(t)e5t+5sin2(t)e5t+cos(t),
which matches the result from the example.
This may now make one wonder “What’s the point? If we could already find the derivative, why learn another way of finding it?” In some cases, applying this rule makes deriving simpler, but this is hardly the power of the Chain Rule. Rather, in the case where z=f(x,y), x=g(t) and y=h(t), the Chain Rule is extremely powerful when we do not know what f, g and/or h are. It may be hard to believe, but often in “the real world” we know rate-of-change information (i.e., information about derivatives) without explicitly knowing the underlying functions. The Chain Rule allows us to combine several rates of change to find another rate of change. The Chain Rule also has theoretic use, giving us insight into the behavior of certain constructions (as we’ll see in the next section).
We demonstrate this in the next example.

Example 13.5.6. Applying the Multivariable Chain Rule.

An object travels along a path on a surface. The exact path and surface are not known, but at time t=t0 it is known that :
zx=5,zy=2,dxdt=3 and dydt=7.
Find dzdt at time t0.
Solution.
The Multivariable Chain Rule states that
dzdt=zxdxdt+zydydt=5(3)+(2)(7)=1.
By knowing certain rates-of-change information about the surface and about the path of the particle in the xy-plane, we can determine how quickly the object is rising/falling.
We next apply the Chain Rule to solve a max/min problem.

Example 13.5.7. Applying the Multivariable Chain Rule.

Consider the surface z=x2+y2xy, a paraboloid, on which a particle moves with x and y coordinates given by x=cos(t) and y=sin(t). Find dzdt when t=0, and find where the particle reaches its maximum/minimum z-values.
Solution.
It is straightforward to compute
fx(x,y)=2xyfy(x,y)=2yxdxdt=sin(t)dydt=cos(t).
Combining these according to the Chain Rule gives:
dzdt=(2xy)sin(t)+(2yx)cos(t).
Figure 13.5.8. Plotting the path of a particle on a surface in Example 13.5.7
When t=0, x=1 and y=0. Thus dzdt=(2)(0)+(1)(1)=1. When t=0, the particle is moving down, as shown in Figure 13.5.8.
To find where z-value is maximized/minimized on the particle’s path, we set dzdt=0 and solve for t:
dzdt=0=(2xy)sin(t)+(2yx)cos(t)0=(2cos(t)sin(t))sin(t)+(2sin(t)cos(t))cos(t)0=sin2(t)cos2(t)cos2(t)=sin2(t)t=nπ4 (for odd n
We can use the First Derivative Test to find that on [0,2π], z has reaches its absolute minimum at t=π/4 and 5π/4; it reaches its absolute maximum at t=3π/4 and 7π/4, as shown in Figure 13.5.8.
We can extend the Chain Rule to include the situation where z is a function of more than one variable, and each of these variables is also a function of more than one variable. The basic case of this is where z=f(x,y), and x and y are functions of two variables, say s and t.

Example 13.5.10. Using the Multivariable Chain Rule, Part II.

Let z=x2y+x, x=s2+3t and y=2st. Find zs and zt, and evaluate each when s=1 and t=2.
Solution.
Following Theorem 13.5.9, we compute the following partial derivatives:
fx=2xy+1fy=x2,
xs=2sxt=3ys=2yt=1.
Thus
zs=(2xy+1)(2s)+(x2)(2)=4xys+2s+2x2, and 
zt=(2xy+1)(3)+(x2)(1)=6xyx2+3.
When s=1 and t=2, x=7 and y=0, so
zs=100 and zt=46.

Example 13.5.11. Using the Multivariable Chain Rule, Part II.

Let w=xy+z2, where x=t2es, y=tcos(s), and z=ssin(t). Find wt when s=0 and t=π.
Solution.
Following Theorem 13.5.9, we compute the following partial derivatives:
fx=yfy=xfz=2zxt=2tesyt=cos(s)zt=scos(t).
Thus
wt=y(2tes)+x(cos(s))+2z(scos(t)).
When s=0 and t=π, we have x=π2, y=π and z=0. Thus
wt=π(2π)+π2=3π2.

Subsection 13.5.2 Implicit Differentiation

We studied finding dydx when y is given as an implicit function of x in detail in Section 2.6. We find here that the Multivariable Chain Rule gives a simpler method of finding dydx.
For instance, consider the implicit function x2yxy3=3. We learned to use the following steps to find dydx:
ddx(x2yxy3)=ddx(3)2xy+x2dydxy33xy2dydx=0dydx=2xyy3x23xy2.
Instead of using this method, consider z=x2yxy3. The implicit function above describes the level curve z=3. Considering x and y as functions of x, the Multivariable Chain Rule states that
(13.5.1)dzdx=zxdxdx+zydydx.
Since z is constant (in our example, z=3), dzdx=0. We also know dxdx=1. Equation (13.5.1) becomes
0=zx(1)+zydydxdydx=zx/zy(13.5.2)=fxfy.
Note how our solution for dydx in Equation (13.5.2) is just the partial derivative of z with respect to x, divided by the partial derivative of z with respect to y, all multiplied by (1).
We state the above as a theorem.
We practice using Theorem 13.5.12 by applying it to a problem from Section 2.6.

Example 13.5.13. Implicit Differentiation.

Given the implicitly defined function sin(x2y2)+y3=x+y, find y. Note: this is the same problem as given in Example 2.6.8 of Section 2.6, where the solution took about a full page to find.
Solution.
Let f(x,y)=sin(x2y2)+y3xy; the implicitly defined function above is equivalent to f(x,y)=0. We find dydx by applying Theorem 13.5.12. We find
fx(x,y)=2xy2cos(x2y2)1fy(x,y)=2x2ycos(x2y2)+3y21,
so
dydx=2xy2cos(x2y2)12x2ycos(x2y2)+3y21,
which matches our solution from Example 2.6.8.
Figure 13.5.14. Examples with implicit differentiation
We can also do implicit differentiation for functions of three variables. In the same way that a level curve f(x,y)=c is used to implicitly define y as a function of x, a level surface f(x,y,z)=c can be viewed as implicitly defining z as a function of x and y.
Suppose the equation f(x,y,z)=c, where c is a constant, defines the function z=g(x,y). Then we can use the chain rule to compute the derivatives of f(x,y,z) with respect to x and y, where we set x=x, y=y, and z=g(x,y). Since f(x,y,z) is constant, we have
0=xf(x,y,z)=fx(x,y,z)xx+fy(x,y,z)yx+fz(x,y,z)zx=fx(x,y,z)(1)+fy(x,y,z)(0)+fz(x,y,z)zx.
Solving for zx gives us
zx=fx(x,y,z)fz(x,y,z),
and similarly,
zy=fy(x,y,z)fz(x,y,z).
In Subsection 13.3.2 we saw that we can use partial derivatives to determine the equation of the tangent plane to a graph z=f(x,y). Using implicit differentiation, we can do the same for a level surface f(x,y,z)=c.

Example 13.5.15. Implicit Differentiation with three variables.

Given that the equation
(13.5.3)x2yz3sin(x3z)+4xy23yz=0
defines z implicitly as a function of x and y, compute zx and zy using implicit differentiation. Then, determine the equation of the tangent plane to the surface at the point (3,0,1).
Solution.
There are two ways to proceed. One is to use implicit differentiation as before, but using partial derivatives. Whenever we differentiate a function of z, we multiply by the appropriate partial derivative of z. The other option is to use the formula derived above. We will use the first method for the x derivative, and the second for y.
We first take the partial derivative of both sides of Equation (13.5.3) with respect to x:
x(x2yz3sin(x3z)+4xy23yz)=02xyz3+x2y(3z2)zxcos(x3z)(13zx)+4y23yzx=0.
Note that we treated y as a constant, since the derivative is with respect to x. Next, we collect terms:
zx(3x2yz2+3cos(x3z)3y)=2xyz3+cos(x3z)4y2.
Lastly, we solve for zx:
zx=2xyz3+cos(x3z)4y23x2yz2+3cos(x3z)3y.
For the y derivative, we will use the result given above. Setting f(x,y,z)=x2yz3sin(x3z)+4xy23yz, we have zy=fy(x,y,z)fz(x,y,z). Therefore,
zy=x2z3+8xy3z3x2yz2+3cos(x3z)3y.
The second method certainly seems simpler! The reader is invited to try each part with the other method, and compare answers.
Finally, we consider the problem of the tangent plane. First, we check that the point (3,0,1) is indeed on the surface: f(3,0,1)=0, as required. Next we note that z=1 is given to us from this point. So if f(x,y,z)=c implicitly defines the graph z=g(x,y), then we must have g(3,0)=1. Next, we have
gx(3,0)=zx|(3,0)=0+100+30=13gy(3,0)=zy|(3,0)=9+030+30=2.
The equation of the tangent plane is therefore
z=g(3,0)+gx(3,0)(x3)+gy(3,0)(y0)=1+13(x3)2y.
In Section 13.3 we learned how partial derivatives give certain instantaneous rate of change information about a function f(x,y). In that section, we measured the rate of change of f by holding one variable constant and letting the other vary (such as, holding y constant and letting x vary gives fx). We can visualize this change by considering the surface defined by f at a point and moving parallel to the x-axis.
What if we want to move in a direction that is not parallel to a coordinate axis? Can we still measure instantaneous rates of change? Yes; we find out how in Section 13.6. In doing so, we’ll see how the Multivariable Chain Rule informs our understanding of these directional derivatives.

Exercises 13.5.3 Exercises

Terms and Concepts

1.
Let a level curve of z=f(x,y) be described by x=g(t), y=h(t). Explain why dzdt=0.
2.
3.
Put the blocks in order to form a correct chain rule statement.
4.
    If z=f(x,y), where x=g(t) and y=h(t), we can substitute and write z as an explicit function of t.
    Using the Multivariable Chain Rule to find dzdt is sometimes easier than first substituting and then taking the derivative.
  • True.

  • False.

5.
The Multivariable Chain Rule is only useful when all the related functions are known explicitly.
6.

Problems

Exercise Group.
Given the functions z=f(x,y), x=g(t) and y=h(t):
  1. Use the Multivariable Chain Rule to compute dzdt.
  2. Evaluate dzdt at the indicated t-value.
8.
z=x2y2, x=t, and y=t21; t=1
9.
z=5x+2y, x=2cos(t)+1, y=sin(t)3; t=π/4
10.
z=xy2+1, x=cos(t), and y=sin(t); t=π/2
11.
z=x2+2y2, x=sin(t), y=3sin(t); t=π/4
12.
z=cos(x)sin(y), x=πt, and y=2πt+π/2; t=3
Exercise Group.
In the following exercises, functions z=f(x,y), x=g(t) and y=h(t) are given. Find the values of t where dzdt=0. Note: these are the same surfaces/curves as found in Exercises 7–12.
14.
Given z=x2y2, x=t, and y=t21, at what values of t does dzdt=0?
15.
z=5x+2y, x=2cos(t)+1, y=sin(t)3
16.
Given z=xy2+1, x=cos(t), and y=sin(t), at what values of t in [0,2π) does dzdt=0?
17.
z=x2+2y2, x=sin(t), y=3sin(t)
18.
Given z=cos(x)sin(y), x=πt, and y=2πt+π/2, at what values of t in [0,2) does dzdt=0?
Exercise Group.
Given the functions z=f(x,y), x=g(s,t) and y=h(s,t):
  1. Use the Multivariable Chain Rule to compute zs and zt.
  2. Evaluate zs and zt at the indicated s and t values.
19.
z=x2y, x=st, y=2s+4t; s=1, t=0
20.
z=cos(πx+π2y), x=st2, and y=s2t; s=1, t=0
21.
z=x2+y2, x=scos(t), and y=ssin(t); s=2, t=π/4
22.
z=e(x2+y2), x=t, and y=st2, s=1, t=1
Exercise Group.
The given equation defines y implicitly as a function of x. Find dydx using Implicit Differentiation and Theorem 13.5.12.
Exercise Group.
Find dzdt, or zs and zt, using the supplied information.
27.
zx=2,zy=1,dxdt=4,dydt=5
28.
zx=1, zy=3, dxdt=6, and dydt=2.
29.
zx=4,zy=9,
xs=5,xt=7,ys=2,yt=6
30.
zx=2, zy=1, xs=2, xt=3, ys=2 and yt=1
You have attempted 1 of 22 activities on this page.