12.5: The Multivariable Chain Rule
( \newcommand{\kernel}{\mathrm{null}\,}\)
The Chain Rule, as learned in 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.
In this section we extend the Chain Rule to functions of more than one variable.
theorem 107 Multivariable Chain Rule, Part I
Let z=f(x,y), x=g(t) and y=h(t), where f, g and h are differentiable functions. Then z=f(x,y)=f(g(t),h(t)) is a function of t, and
dzdt=dfdt=fx(x,y)dxdt+fy(x,y)dydt=∂f∂xdxdt+∂f∂ydydt.
It is good to understand what the situation of z=f(x,y), x=g(t) and y=h(t) describes. We know that z=f(x,y) describes a surface; we also recognize that x=g(t) and y=h(t) are parametric equations for a curve in the x-y plane. Combining these together, we are describing a curve that lies on the surface described by f. The parametric equations for this curve are x=g(t), y=h(t) and z=f(g(t),h(t)).
Consider Figure 12.14 in which a surface is drawn, along with a dashed curve in the x-y plane. Restricting f to just the points on this circle gives the curve shown on the surface. 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 gives the rate at which the object rises/falls.
We now practice applying the Multivariable Chain Rule.
Example 12.5.1: Using the Multivariable Chain Rule
Let z=x2y+x, where x=sint and y=e5t. Find dzdt using the Chain Rule.
Solution
Following Theorem 107, we find
fx(x,y)=2xy+1,fy(x,y)=x2,dxdt=cost,dydt=5e5t.
Applying the theorem, we have
dzdt=(2xy+1)cost+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 sint and y with e5t:
dzdt=(2xy+1)cost+5x2e5t=(2sin(t)e5t+1)cost+5e5tsin2t.
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=(sint)2e5t+sint. Applying the Chain and Product Rules, we have
dzdt=2sintcoste5t+5sin2te5t+cost,
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 12.5.2: Applying the Multivarible 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 :
∂z∂x=5,∂z∂y=−2,dxdt=3anddydt=7.
Find dzdt at time t0.
Solution
The Multivariable Chain Rule states that
dzdt=∂z∂xdxdt+∂z∂ydydt=5(3)+(−2)(7)=1.
By knowing certain rates--of--change information about the surface and about the path of the particle in the x-y plane, we can determine how quickly the object is rising/falling.
We next apply the Chain Rule to solve a max/min problem.
Example 12.5.3: Applying the Multivariable Chain Rule
Consider the surface z=x2+y2−xy, a paraboloid, on which a particle moves with x and y coordinates given by x=cost and y=sint. 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)=2x−y,fy(x,y)=2y−x,dxdt=−sint,dydt=cost.
Combining these according to the Chain Rule gives:
dzdt=−(2x−y)sint+(2y−x)cost.
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 12.15.
To find where z-value is maximized/minimized on the particle's path, we set dzdt=0 and solve for t:
dzdt=0=−(2x−y)sint+(2y−x)cost0=−(2cost−sint)sint+(2sint−cost)cost0=sin2t−cos2tcos2t=sin2tt=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 12.15.
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.
THEOREM 108 Multivariable Chain Rule, Part II
- Let z=f(x,y), x=g(s,t) and y=h(s,t), where f, g and h are differentiable functions. Then z is a function of s and t, and
-∂z∂s=∂f∂x∂x∂s+∂f∂y∂y∂s, and
-∂z∂t=∂f∂x∂x∂t+∂f∂y∂y∂t.
- Let z=f(x1,x2,…,xm) be a differentiable function of m variables, where each of the xi is a differentiable function of the variables t1,t2,…,tn. Then z is a function of the ti, and
∂z∂ti=∂f∂x1∂x1∂ti+∂f∂x2∂x2∂ti+⋯+∂f∂xm∂xm∂ti.
Example 12.5.4: Using the Multivarible Chain Rule, Part II
Let z=x2y+x, x=s2+3t and y=2s−t. Find ∂z∂s and ∂z∂t, and evaluate each when s=1 and t=2.
Solution
Following Theorem 108, we compute the following partial derivatives:
∂f∂x=2xy+1∂f∂y=x2,
∂x∂s=2s∂x∂t=3∂y∂s=2∂y∂t=−1.
Thus
∂z∂s=(2xy+1)(2s)+(x2)(2)=4xys+2s+2x2,and
∂z∂t=(2xy+1)(3)+(x2)(−1)=6xy−x2+3.
When s=1 and t=2, x=7 and y=0, so
∂z∂s=100and∂z∂t=−46.
Example 12.5.5: Using the Multivarible Chain Rule, Part II
Let w=xy+z2, where x=t2es, y=tcoss, and z=ssint. Find ∂w∂t when s=0 and t=π.
Solution
Following Theorem 108, we compute the following partial derivatives:
∂f∂x=y∂f∂y=x∂f∂z=2z,
∂x∂t=2tes∂y∂t=coss∂z∂t=scost.
Thus ∂w∂t=y(2tes)+x(coss)+2z(scost).
When s=0 and t=π, we have x=π2, y=π and z=0. Thus
∂w∂t=π(2π)+π2=3π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 x2y−xy3=3. We learned to use the following steps to find dydx:
ddx(x2y−xy3)=ddx(3)2xy+x2dydx−y3−3xy2dydx=0dydx=−2xy−y3x2−3xy2.
Instead of using this method, consider z=x2y−xy3. The implicit function above describes the level curve z=3. Considering x and y as functions of x, the Multivariable Chain Rule states that
dzdx=∂z∂xdxdx+∂z∂ydydx.
Since z is constant (in our example, z=3), dzdx=0. We also know dxdx=1. Equation ??? becomes
0=∂z∂x(1)+∂z∂ydydx⇒dydx=−∂z∂x/∂z∂y=−fxfy.
Note how our solution for dydx in Equation 12.5.22 is just the partial derivative of z with respect to x, divided by the partial derivative of z with respect to y.
We state the above as a theorem.
THEOREM 109 Implicit Differentiation
Let f be a differentiable function of x and y, where f(x,y)=c defines y as an implicit function of x, for some constant c. Then
dydx=−fx(x,y)fy(x,y).
We practice using Theorem 109 by applying it to a problem from Section 2.6.
Example 12.5.6: 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.4 from Section 2.6, where the solution took about a full page to find.
Solution
Let f(x,y)=sin(x2y2)+y3−x−y; the implicitly defined function above is equivalent to f(x,y)=0. We find dydx by applying Theorem 109. We find
fx(x,y)=2xy2cos(x2y2)−1andfy(x,y)=2x2ycos(x2y2)+3y2−1,
so
dydx=−2xy2cos(x2y2)−12x2ycos(x2y2)+3y2−1,
which matches our solution from Example 2.6.4.