2.4: The Chain Rule for Multivariable Functions

Math 4A: Multivariable Calculus · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    2.4: The Chain Rule for Multivariable Functions

    Recall that the chain rule for the derivative of a composite of two functions can be written in the form

    \[\dfrac{d}{dx}\Big(f(g(x))\Big)=f′\big(g(x)\big)g′(x) \nonumber \]

    In this equation, both \(f(x)\) and \(g(x)\) are functions of one variable. For some intuition as to why this formula works, consider the function \(h(x)=2\sin(3x)\). It is easy to see that we have \(h(x)=f(g(x))\) where \(f(x)=2\sin(x)\) and \(g(x)=3x\). Since \(f'(x)=2\cos(x)\) and \(g'(x)=3\) the chain rule says that \(h'(x)=2\cos(3x)\cdot 3 =6\cos(3x)\). At \(x=\pi\) notice that we have \(g'(\pi)=3, g(\pi)=3\pi\), and \(f'(3\pi)=f'(g(\pi))=-2\) which is why we have \(h'(\pi)=-6\).

    clipboard_e5152a89c17e4656178eae46e9eb9daa7.pngclipboard_e45c08a7ed054238adc3d23c82fa14b79.png clipboard_ec376857c4f6488431e3704a50fde920c.png

    Figure \(\PageIndex{1}\): A visualization of the single variable form of the chain rule.

    If \(x\) is changing but "close" to \(\pi\), then \(g(x)\) is changing by a factor of \(g'(\pi)=3\) times as far away from \(g(\pi)=3\pi \). In turn this means \(f(x)\) is changing by a factor of \(f'(3\pi)=-2\) times as far away from \(h(\pi)=f(3\pi)=0\). Thus a small perturbation in \(x\) near \(\pi\) yields six times as big of a perturbation in \(h(x)\) from \(h(\pi)\). These factors multiply as a chain reaction because of the composition of these functions, which is the origin of the name of the rule!

    Now suppose that \(f\) is a function of two variables and \(g\) is a function of one variable. Or perhaps they are both functions of two variables, or even more. How would we calculate the derivative in these cases? The following theorem gives us the answer for the case of one independent variable.

    Theorem \(\PageIndex{1}\): Chain Rule for One Independent Variable

    Suppose that \(x=g(t)\) and \(y=h(t)\) are differentiable functions of \(t\) and \(z=f(x,y)\) is a differentiable function of \(x\) and \(y\). Then \(z=f(x(t),y(t))\) is a differentiable function of \(t\) and

    \[\dfrac{dz}{dt}=\dfrac{∂z}{∂x}⋅\dfrac{dx}{dt}+\dfrac{∂z}{∂y}⋅\dfrac{dy}{dt} \nonumber \]

    where the ordinary derivatives are evaluated at \(t\) and the partial derivatives are evaluated at \((x,y)\).

    Proof

    The proof of this theorem uses the definition of differentiability of a function of two variables. Suppose that \(f\) is differentiable at the point \(P(x_0,y_0),\) where \(x_0=g(t_0)\) and \(y_0=h(t_0)\) for a fixed value of \(t_0\). We wish to prove that \(z=f\big(x(t),y(t)\big)\) is differentiable at \(t=t_0\) and that the chain rule formula holds at that point as well.

    Since \(f\) is differentiable at \(P\), we know that

    \[z(t)=f(x,y)=f(x_0,y_0)+f_x(x_0,y_0)(x−x_0)+f_y(x_0,y_0)(y−y_0)+E(x,y) \nonumber \]

    where \( \lim_{(x,y)→(x_0,y_0)}\dfrac{E(x,y)}{\sqrt{(x−x_0)^2+(y−y_0)^2}}=0\)

    We then subtract \(z_0=f(x_0,y_0)\) from both sides of this equation:

    \[ z(t)−z(t_0) =f(x(t),y(t))−f(x(t_0),y(t_0)) =f_x(x_0,y_0)(x(t)−x(t_0))+f_y(x_0,y_0)(y(t)−y(t_0))+E(x(t),y(t)) \nonumber \]

    Next, we divide both sides by \(t−t_0\):

    \[\frac{z(t)−z(t_0)}{t−t_0}=f_x(x_0,y_0)\frac{x(t)−x(t_0)}{t−t_0}+f_y(x_0,y_0)\frac{y(t)−y(t_0)}{t−t_0}+\frac{E(x(t),y(t))}{t−t_0} \nonumber \]

    Then we take the limit as \(t\) approaches \(t_0\):

    \[\lim_{t→t_0}\dfrac{z(t)−z(t_0)}{t−t_0} = f_x(x_0,y_0)\lim_{t→t_0} \left (\dfrac{x(t)−x(t_0)}{t−t_0} \right) +f_y(x_0,y_0)\lim_{t→t_0}\left (\dfrac{y(t)−y(t_0)}{t−t_0}\right)+\lim_{t→t_0}\dfrac{E(x(t),y(t))}{t−t_0}\nonumber \]

    The left-hand side of this equation is equal to \(\dfrac{dz}{dt}\), which leads to

    \[\dfrac{dz}{dt}=f_x(x_0,y_0)\dfrac{dx}{dt}+f_y(x_0,y_0)\dfrac{dy}{dt}+\lim_{t→t_0}\dfrac{E(x(t),y(t))}{t−t_0} \nonumber \]

    The last term can be rewritten as

    \[\begin{align*} \lim_{t→t_0}\dfrac{E(x(t),y(t))}{t−t_0} &=\lim_{t→t_0}\dfrac{E(x,y)}{\sqrt{(x−x_0)^2+(y−y_0)^2}}\dfrac{\sqrt{(x−x_0)^2+(y−y_0)^2}}{t−t_0} \\[4pt] &=\lim_{t→t_0}\left(\dfrac{E(x,y)}{\sqrt{(x−x_0)^2+(y−y_0)^2}}\right)\lim_{t→t_0}\left(\dfrac{\sqrt{(x−x_0)^2+(y−y_0)^2}}{t−t_0}\right) \end{align*} \nonumber \]

    As \(t\) approaches \(t_0, \big(x(t),y(t)\big)\) approaches \(\big(x(t_0),y(t_0)\big),\) so we can rewrite the last product as

    \[\lim_{(x,y)→(x_0,y_0)}\dfrac{E(x,y)}{\sqrt{(x−x_0)^2+(y−y_0)^2}}=\lim_{(x,y)→(x_0,y_0)}\left(\dfrac{\sqrt{(x−x_0)^2+(y−y_0)^2}}{t−t_0}\right) \nonumber \]

    Since the first limit is equal to zero, we need only show that the second limit is finite:

    \[ \lim_{(x,y)→(x_0,y_0)} \dfrac{\sqrt{ (x−x_0)^2+(y−y_0)^2 }} {t−t_0} =\lim_{(x,y)→(x_0,y_0)} \sqrt{ \dfrac { (x−x_0)^2+(y−y_0)^2 } {(t−t_0)^2} } \nonumber \]
    \[=\lim_{(x,y)→(x_0,y_0)}\sqrt{ \left(\dfrac{x−x_0}{t−t_0}\right)^2+\left(\dfrac{y−y_0}{t−t_0}\right)^2} \\[4pt] =\sqrt{ \left[\lim_{(x,y)→(x_0,y_0)} \left(\dfrac{x−x_0}{t−t_0}\right)\right]^2+\left[\lim_{(x,y)→(x_0,y_0)} \left(\dfrac{y−y_0}{t−t_0}\right)\right]^2} \nonumber \]

    Since \(x(t)\) and \(y(t)\) are both differentiable functions of \(t\), both limits inside the last radical exist. Therefore, this value is finite. This proves the chain rule at \(t=t_0\); the rest of the theorem follows from the assumption that all functions are differentiable over their entire domains.

    Closer examination of the chain rule formula above reveals the same pattern we had in the single variable chain rule: a small change in \(t\) results in a change in both intermediate variables \(x\) and \(y\) by the factors \(x'(t)\) and \(y'(t)\) respectively. Each of these changes propagates to a change in the output of the function \(f(x,y)\) by the factors \(\dfrac{\partial f}{\partial x}\) and \(\dfrac{\partial f}{\partial y}\). This is why there are two chain rule terms, since changing the variable \(t\) results in two different types of change for the eventual function \(f\).

    Example \(\PageIndex{1}\): Using the Chain Rule

    Calculate \(\dfrac{dz}{dt}\) for each of the following functions:

    (a) \(z=f(x,y)=4x^2+3y^2,\quad x=x(t)=\sin (t),\quad y=y(t)=\cos (t)\)

    (b) \(z=f(x,y)=\sqrt{x^2−y^2},\quad x=x(t)=e^{2t},\quad y=y(t)=e^{−t}\)

    Solution

    (a) To use the chain rule, we need four quantities:

    \[ \dfrac{∂z}{∂x}=8x,\quad \dfrac{dx}{dt}=\cos (t),\quad \dfrac{∂z}{∂y}=6y,\quad \dfrac{dy}{dt}=−\sin (t)\nonumber \]

    Now, we substitute each of these into the Chain Rule for One Independent Variable formula:

    \[\dfrac{dz}{dt}=\dfrac{\partial z}{\partial x} \cdot \dfrac{dx}{dt}+\dfrac{\partial z}{\partial y} \cdot \dfrac{dy}{dt}=(8x)(\cos (t))+(6y)(−\sin (t))=8x\cos (t)−6y\sin (t) \nonumber \]

    This answer has three variables in it. To reduce it to one variable, use the fact that \(x(t)=\sin (t)\) and \(y(t)=\cos (t)\). We obtain

    \[\dfrac{dz}{dt}=8x\cos (t)−6y\sin (t)=8(\sin (t))\cos (t)−6(\cos (t))\sin (t)=\boxed{2\sin (t)\cos (t)} \nonumber \]

    This derivative can also be calculated by first substituting \(x(t)\) and \(y(t)\) into \(f(x,y),\) then differentiating with respect to \(t\):

    \[z(t) =f\big(x(t),y(t)\big)=4(x(t))^2+3(y(t))^2=4\sin^2 (t)+3\cos^2 (t) \nonumber \]

    Then \( \dfrac{dz}{dt}=2(4\sin (t))(\cos (t))+2(3\cos (t))(−\sin (t))=2\sin (t)\cos (t) \) which is the same solution.

    Note that it may not always be this easy to differentiate in this form.

    (b) To use the chain rule, we again need four quantities:

    \[ \dfrac{∂z}{∂x}=\dfrac{x}{\sqrt{x^2−y^2}},\quad \dfrac{dx}{dt}=2e^{2t},\quad \dfrac{∂z}{∂y}=\dfrac{−y}{\sqrt{x^2−y^2}} ,\quad\dfrac{dy}{dt}=−e^{−t} \nonumber \]

    We substitute each of these into the Chain Rule for One Independent Variable formula:

    \[\dfrac{dz}{dt} =\dfrac{ \partial z}{ \partial x} \cdot \dfrac{dx}{dt}+\dfrac{ \partial z}{ \partial y}\cdot \dfrac{dy}{dt}=\left(\dfrac{x}{\sqrt{x^2−y^2}}\right) (2e^{2t})+\left(\dfrac{−y}{\sqrt{x^2−y^2}} \right) (−e^{−t})=\dfrac{2xe^{2t}+ye^{−t}}{\sqrt{x^2−y^2}} \nonumber \]

    To reduce this to one variable, we use the fact that \(x(t)=e^{2t}\) and \(y(t)=e^{−t}\). Therefore,

    \[ \dfrac{dz}{dt} =\dfrac{2xe^2t+ye^{−t}}{\sqrt{x^2−y^2}}=\dfrac{2(e^{2t})e^{2t}+(e^{−t})e^{−t}}{\sqrt{e^{4t}−e^{−2t}}} =\boxed{\dfrac{2e^{4t}+e^{−2t}}{\sqrt{e^{4t}−e^{−2t}}}} \nonumber \]

    Again, this derivative can also be calculated by first substituting \(x(t)\) and \(y(t)\) into \(f(x,y),\) then differentiating with respect to \(t\):

    \[ z(t) =f(x(t),y(t))=\sqrt{(x(t))^2−(y(t))^2}=\sqrt{e^{4t}−e^{−2t}}=(e^{4t}−e^{−2t})^{\frac{1}{2} } \nonumber \]

    Then \( \dfrac{dz}{dt} = \dfrac{1}{2} (e^{4t}−e^{−2t})^{−1/2} \left(4e^{4t}+2e^{−2t} \right) =\dfrac{2e^{4t}+e^{−2t}}{\sqrt{e^{4t}−e^{−2t}}} \) which is the same solution.

    It is often useful to create a visual representation of the chain rule. This is called a tree diagram for the chain rule for functions of one variable and it provides a way to remember the formula. This diagram helps to see how a change in any variable affects another variable or the end function.

    A diagram that starts with z = f(x, y). Along the first branch, it is written ∂z/∂x, then x = x(t), then dx/dt, then t, and finally it says ∂z/∂x dx/dt. Along the other branch, it is written ∂z/∂y, then y = y(t), then dy/dt, then t, and finally it says ∂z/∂y dy/dt.
    Figure \(\PageIndex{2}\): Tree diagram for the case \(\dfrac{dz}{dt}=\dfrac{∂z}{∂x}⋅\dfrac{dx}{dt}+\dfrac{∂z}{∂y}⋅\dfrac{dy}{dt}.\)

    In this diagram, the leftmost corner corresponds to \(z=f(x,y)\). Since \(f\) has two independent variables, there are two lines coming from this corner. The upper branch corresponds to the variable \(x\) and the lower branch corresponds to the variable \(y\). Since each of these variables is then dependent on one variable \(t\), one branch then comes from \(x\) and one branch comes from \(y\). Last, each of the branches on the far right has a label that represents the path traveled to reach that branch.

    The top branch is reached by following the \(x\) branch, then the t branch; therefore, it is labeled \(\dfrac{\partial z}{\partial x} \dfrac{dx}{dt}\). This product represents the factor which a perturbation of \(t\) multiplies by to change the output of \(z\) through its effect on \(x\). The bottom branch is similar: first the \(y\) branch, then the \(t\) branch. This branch is labeled \(\dfrac{\partial z}{\partial y} \dfrac{dy}{dt}\), which is the factor which a change in \(t\) multiplies by to change \(f\) through its effect on \(y\). To get the formula for \( \dfrac{dz}{dt}\), add all the terms that appear on the rightmost side of the diagram. This gives us chain rule formula we saw above.

    The Chain Rule for two independent variables, where \(z=f(x,y)\) is a function of \(x\) and \(y\), and both \(x=g(u,v)\) and \(y=h(u,v)\) are functions of the independent variables \(u\) and \(v\) stems from a similar tree diagram:

    A diagram that starts with z = f(x, y). Along the first branch, it is written ∂z/∂x, then x = g(u, v), at which point it breaks into another two branches: the first subbranch says ∂x/∂u, then u, and finally it says ∂z/∂x ∂x/∂u; the second subbranch says ∂x/∂v, then v, and finally it says ∂z/∂x ∂x/∂v. Along the other branch, it is written ∂z/∂y, then y = h(u, v), at which point it breaks into another two branches: the first subbranch says ∂y/∂u, then u, and finally it says ∂z/∂y ∂y/∂u; the second subbranch says ∂y/∂v, then v, and finally it says ∂z/∂y ∂y/∂v.
    Figure \(\PageIndex{3}\): Tree diagram for \(\dfrac{∂z}{∂u}\) and \(\dfrac{∂z}{∂v}\)

    To derive the formula for \(∂z/∂u\), start from the left side of the diagram, then follow only the branches that end with \(u\) and add the terms that appear at the end of those branches. For the formula for \(∂z/∂v\), follow only the branches that end with \(v\) and add the terms that appear at the end of those branches.

    Theorem \(\PageIndex{2}\): Chain Rule for Two Independent Variables

    Suppose \(x=g(u,v)\) and \(y=h(u,v)\) are differentiable functions of \(u\) and \(v\), and \(z=f(x,y)\) is a differentiable function of \(x\) and \(y\). Then, \(z=f(g(u,v),h(u,v))\) is a differentiable function of \(u\) and \(v\), and

    \[\dfrac{∂z}{∂u}=\dfrac{∂z}{∂x}\dfrac{∂x}{∂u}+\dfrac{∂z}{∂y}\dfrac{∂y}{∂u} \nonumber \]

    and

    \[\dfrac{∂z}{∂v}=\dfrac{∂z}{∂x}\dfrac{∂x}{∂v}+\dfrac{∂z}{∂y}\dfrac{∂y}{∂v} \nonumber \]

    There is an important difference between these two chain rule theorems. In Chain Rule for One Independent Variable, the left-hand side of the formula for the derivative is not a partial derivative, but in Chain Rule for Two Independent Variables it is. The reason is that, in Chain Rule for One Independent Variable, \(z\) is ultimately a function of \(t\) alone, whereas in Chain Rule for Two Independent Variables, \(z\) is a function of both \(u\) and \(v\).

    Example \(\PageIndex{2}\): Using the Chain Rule for Two Variables

    Calculate \(\dfrac{∂z}{∂u}\) and \(\dfrac{∂z}{∂v}\) using the following functions:

    \[z=f(x,y)=3x^2−2xy+y^2,\quad x=x(u,v)=3u+2v,\quad y=y(u,v)=4u−v^2 \nonumber \]

    Solution

    To implement the chain rule for two variables, we need six partial derivatives:

    \[\dfrac{∂z}{∂x}=6x−2y,\quad \dfrac{∂z}{∂y}=−2x+2y,\quad \dfrac{∂x}{∂u}=3,\quad \dfrac{∂x}{∂v}=2,\quad \dfrac{∂y}{∂u} =4,\quad \dfrac{∂y}{∂v}=−2v \nonumber\]

    To find \(\dfrac{∂z}{∂u}\) we use the Chain Rule for Two Independent Variables formula:

    \[ \dfrac{∂z}{∂u} =\dfrac{∂z}{∂x}⋅\dfrac{∂x}{∂u}+\dfrac{∂z}{∂y}⋅\dfrac{∂y}{∂u}=3(6x−2y)+4(−2x+2y) =10x+2y \nonumber \]

    Next, we substitute \(x(u,v)=3u+2v\) and \(y(u,v)=4u−v^2:\)

    \[\dfrac{∂z}{∂u} =10x+2y=10(3u+2v)+2(4u−v^2) =38u+20v-2v^2 \nonumber \]

    To find \(\dfrac{∂z}{∂v}\) we again use the Chain Rule for Two Independent Variables formula:

    \[ \dfrac{∂z}{∂v} =\dfrac{∂z}{∂x}\dfrac{∂x}{∂v}+\dfrac{∂z}{∂y}\dfrac{∂y}{∂v} =2(6x−2y)+(−2v)(−2x+2y)=(12+4v)x-(4+4v)y \nonumber \]

    Then we substitute \(x(u,v)=3u+2v\) and \(y(u,v)=4u−v^2:\)

    \[ \dfrac{∂z}{∂v} =(12+4v)x-(4+4v)y = (12+4v)(3u+2v)-(4+4v)(4u-v^2)=\boxed{-4uv+20u+4v^3+12v^2+24v} \nonumber \]

    Again, this can be found through direct substitution instead of the chain rule if the reader wishes to check the answer!

    Now that we’ve seen how to extend the original chain rule to functions of two variables, it is natural to ask: Can we extend the rule to more than two variables? The answer is yes, as the generalized chain rule states.

    Theorem \(\PageIndex{3}\): Generalized Chain Rule

    Let \(w=f(x_1,x_2,…,x_m)\) be a differentiable function of \(m\) independent variables, and for each \(i∈{1,…,m},\) let \(x_i=x_i(t_1,t_2,…,t_n)\) be a differentiable function of \(n\) independent variables. Then

    \[\dfrac{∂w}{∂t_j}=\dfrac{∂w}{∂x_1}\dfrac{∂x_1}{∂t_j}+\dfrac{∂w}{∂x_2}\dfrac{∂x_2}{∂t_j}+⋯+\dfrac{∂w}{∂x_m}\dfrac{∂x_m}{∂t_j} \nonumber \]

    for any \(j∈{1,2,…,n}.\)

    Illustration \(\PageIndex{1}\): Drawing a Tree Diagram

    Create a tree diagram for the case when

    \[ w=f(x,y,z),\quad x=x(t,u,v),\quad y=y(t,u,v),\quad z=z(t,u,v) \nonumber \]

    and write out the formulas for the three partial derivatives of \(w\).

    Starting from the left, the function \(f\) has three independent variables: \(x,\, y\), and \(z\). Therefore, three branches must be emanating from the first node. Each of these three branches also has three branches, for each of the variables \(t,\, u,\) and \(v\).

    A diagram that starts with w = f(x, y, z). Along the first branch, it is written ∂w/∂x, then x = x(t, u, v), at which point it breaks into another three subbranches: the first subbranch says t and then ∂w/∂x ∂x/∂t; the second subbranch says u and then ∂w/∂x ∂x/∂u; and the third subbranch says v and then ∂w/∂x ∂x/∂v. Along the second branch, it is written ∂w/∂y, then y = y(t, u, v), at which point it breaks into another three subbranches: the first subbranch says t and then ∂w/∂y ∂y/∂t; the second subbranch says u and then ∂w/∂y ∂y/∂u; and the third subbranch says v and then ∂w/∂y ∂y/∂v. Along the third branch, it is written ∂w/∂z, then z = z(t, u, v), at which point it breaks into another three subbranches: the first subbranch says t and then ∂w/∂z ∂z/∂t; the second subbranch says u and then ∂w/∂z ∂z/∂u; and the third subbranch says v and then ∂w/∂z ∂z/∂v.

    The three formulas are:

    \[\begin{align*} \dfrac{∂w}{∂t} &=\dfrac{∂w}{∂x}\dfrac{∂x}{∂t}+\dfrac{∂w}{∂y}\dfrac{∂y}{∂t}+\dfrac{∂w}{∂z}\dfrac{∂z}{∂t} \\[4pt] \dfrac{∂w}{∂u} &=\dfrac{∂w}{∂x}\dfrac{∂x}{∂u}+\dfrac{∂w}{∂y}\dfrac{∂y}{∂u}+\dfrac{∂w}{∂z}\dfrac{∂z}{∂u} \\[4pt] \dfrac{∂w}{∂v} &=\dfrac{∂w}{∂x}\dfrac{∂x}{∂v}+\dfrac{∂w}{∂y}\dfrac{∂y}{∂v}+\dfrac{∂w}{∂z}\dfrac{∂z}{∂v} \end{align*}\]

    In the next example we calculate the derivative of a function of three independent variables in which each of the three variables is dependent on two other variables.

    Illustration \(\PageIndex{2}\): Using the Generalized Chain Rule

    Calculate \(\dfrac{∂w}{∂u}\) and \(\dfrac{∂w}{∂v}\) using the following functions:

    \[\begin{align*} w &=f(x,y,z)=3x^2−2xy+4z^2 \\[4pt] x &=x(u,v)=e^u\sin (v) \\[4pt] y &=y(u,v)=e^u\cos (v) \\[4pt] z &=z(u,v)=e^u \end{align*}\]

    Solution

    The formulas for \(\dfrac{∂w}{∂u}\) and \(\dfrac{∂w}{∂v}\) are

    \[\begin{align*} \dfrac{∂w}{∂u} =\dfrac{∂w}{∂x}⋅\dfrac{∂x}{∂u}+\dfrac{∂w}{∂y}⋅\dfrac{∂y}{∂u}+\dfrac{∂w}{∂z}⋅\dfrac{∂z}{∂u} \\[4pt] \dfrac{∂w}{∂v} =\dfrac{∂w}{∂x}⋅\dfrac{∂x}{∂v}+\dfrac{∂w}{∂y}⋅\dfrac{∂y}{∂v}+\dfrac{∂w}{∂z}⋅\dfrac{∂z}{∂v} \end{align*}\]

    Therefore, there are nine different partial derivatives that need to be calculated and substituted. We need to calculate each of them:

    \[\begin{align*} \dfrac{∂w}{∂x}&=6x−2y,\quad \dfrac{∂w}{∂y}=−2x,\quad \dfrac{∂w}{∂z}=8z \\[4pt] \dfrac{∂x}{∂u}&=e^u\sin (v),\quad \dfrac{∂y}{∂u}=e^u\cos (v),\quad \dfrac{∂z}{∂u}=e^u \\[4pt] \dfrac{∂x}{∂v}&=e^u\cos (v),\quad \dfrac{∂y}{∂v}=−e^u\sin (v),\quad \dfrac{∂z}{∂v}=0 \end{align*}\]

    Now, we substitute each of them into the first formula to calculate \(\dfrac{∂w}{∂u}\):

    \[ \dfrac{∂w}{∂u} =\dfrac{∂w}{∂x}⋅\dfrac{∂x}{∂u}+\dfrac{∂w}{∂y}⋅\dfrac{∂y}{∂u}+\dfrac{∂w}{∂z}⋅\dfrac{∂z}{∂u}
    =(6x−2y)e^u\sin (v)−2xe^u\cos (v)+8ze^u \nonumber \]

    then substitute \(x(u,v)=e^u \sin (v), \, y(u,v)=e^u\cos (v),\) and \(z(u,v)=e^u\) into this equation:

    \[\begin{align*} \dfrac{∂w}{∂u} &=(6x−2y)e^u\sin (v)−2xe^u\cos (v)+8ze^u \\[4pt] &=(6e^u\sin (v)−2e^u\cos (v))e^u\sin (v)−2(e^u\sin (v))e^u\cos (v)+8e^{2u} \\[4pt] &=6e^{2u}\sin^2 (v)−4e^{2u}\sin (v)\cos (v)+8e^{2u} \\[4pt] &=2e^{2u}(3\sin^2 (v)−2\sin (v)\cos (v)+4) \end{align*}\]

    Next, we calculate \(\dfrac{∂w}{∂v}\):

    \[ \dfrac{∂w}{∂v}=\dfrac{∂w}{∂x}⋅\dfrac{∂x}{∂v}+\dfrac{∂w}{∂y}⋅\dfrac{∂y}{∂v}+\dfrac{∂w}{∂z}⋅\dfrac{∂z}{∂v} =(6x−2y)e^u\cos (v)−2x(−e^u\sin (v))+8z(0) \nonumber \]

    then we substitute \(x(u,v)=e^u\sin (v),\, y(u,v)=e^u\cos (v),\) and \(z(u,v)=e^u\) into this equation:

    \[\begin{align*} \dfrac{∂w}{∂v} &=(6x−2y)e^u\cos (v)−2x(−e^u\sin (v)) \\[4pt] &=(6e^u \sin (v)−2e^u\cos (v))e^u\cos (v)+2(e^u\sin (v))(e^u\sin (v)) \\[4pt] &=2e^{2u}\sin^2 (v)+6e^{2u}\sin (v)\cos (v)−2e^{2u}\cos^2 (v) \\[4pt] &=2e^{2u}(\sin^2 (v)+3\sin (v)\cos (v)−\cos^2 (v)) \end{align*}\]

    Recall implicit differentiation provides a method for finding \(\dfrac{dy}{dx}\) when \(y\) is defined implicitly as a function of \(x\). The method involves differentiating both sides of the equation defining the function with respect to \(x\), then solving for \(\dfrac{dy}{dx}\). Partial derivatives provide an alternative to this method.

    Consider the ellipse defined by the equation \(x^2+3y^2+4y−4=0\) as follows.

    An ellipse with center near (0, –0.7), major axis horizontal and of length roughly 4.5, and minor axis of length roughly 3.
    Figure \(\PageIndex{4}\): Graph of the ellipse defined by \(x^2+3y^2+4y−4=0\)

    This equation implicitly defines \(y\) as a function of \(x\). As such, we can find the derivative \(dy/dx\) using the method of implicit differentiation:

    \[\begin{align*} \dfrac{d}{dx}(x^2+3y^2+4y−4) &=\dfrac{d}{dx}(0) \\[4pt] 2x+6y\dfrac{dy}{dx}+4\dfrac{dy}{dx} &=0 \\[4pt] (6y+4)\dfrac{dy}{dx} &=−2x\\[4pt] \dfrac{dy}{dx} &=-\dfrac{2x}{6y+4}=−\dfrac{x}{3y+2}\end{align*}\]

    We can also define a function \(z=f(x,y)\) by using the left-hand side of the equation defining the ellipse. Then \(f(x,y)=x^2+3y^2+4y−4.\) The ellipse \(x^2+3y^2+4y−4=0\) can then be described by the equation \(f(x,y)=0\). Using this function and the following theorem gives us an alternative approach to calculating \(\dfrac{dy}{dx}\).

    Theorem \(\PageIndex{4}\): Implicit Differentiation of a Function of Two or More Variables

    Suppose the function \(z=f(x,y)\) defines \(y\) implicitly as a function \(y=g(x)\) of \(x\) via the equation \(f(x,y)=0.\) Then when \(f_y(x,y)≠0\):

    \[\dfrac{dy}{dx}=−\dfrac{\frac{∂f}{∂x}}{\frac{∂f}{∂y}} \nonumber\]

    If the equation \(f(x,y,z)=0\) defines \(z\) implicitly as a differentiable function of \(x\) and \(y\), then as long as \(f_z(x,y,z)≠0\):

    \[\dfrac{\partial z}{\partial x}=−\dfrac{\frac{∂f}{∂x}}{\frac{∂f}{∂z}} \quad \text{and} \quad \dfrac{\partial z}{\partial y}=−\dfrac{\frac{∂f}{∂y}}{\frac{∂f}{∂z}} \nonumber \]

    These implicit derivative formulas are a direct result of the Chain Rules we have discussed in this section. In particular, if we assume that \(y\) is defined implicitly as a function of \(x\) via the equation \(f(x,y)=0\), we can apply the chain rule to find \(\dfrac{dy}{dx}\):

    \[\begin{align*} \dfrac{d}{dx}f(x,y) &=\dfrac{d}{dx}(0) \\[4pt] \dfrac{∂f}{∂x}⋅\dfrac{dx}{dx}+\dfrac{∂f}{∂y}⋅\dfrac{dy}{dx} &=0 \\[4pt]\dfrac{∂f}{∂x}+\dfrac{∂f}{∂y}⋅\dfrac{dy}{dx} &=0. \end{align*}\]

    Solving this equation for \(\dfrac{dy}{dx}\) gives the first of the two implicit formulas above. The second can be derived in a similar fashion.

    Let’s now return to the problem that we started before the previous theorem. Using Theorem \(\PageIndex{4}\) and the function \(f(x,y)=x^2+3y^2+4y−4,\) we obtain

    \[ \dfrac{∂f}{∂x} =2x \quad \text{ and } \quad \dfrac{∂f}{∂y} =6y+4 \nonumber \]

    Therefore

    \[\dfrac{dy}{dx}=-\dfrac{\frac{∂f}{∂x}}{\frac{∂f}{∂y}}=−\dfrac{2x}{6y+4}=−\dfrac{x}{3y+2} \nonumber \]

    which is the same result obtained by the earlier use of implicit differentiation.

    Example \(\PageIndex{3}\): Implicit Differentiation by Partial Derivatives

    Calculate the desired derivative by using the implicit differentiation formulas:

    (a) Find \(\dfrac{dy}{dx}\) for \(3x^2−2xy+y^2+4x−6y−11=0\)

    (b) Find \(\dfrac{∂z}{∂x}\) and \(\dfrac{∂z}{∂y}\) for \(x^2e^y−yze^x=0.\)

    Solution

    (a) Set \(f(x,y)=3x^2−2xy+y^2+4x−6y−11=0,\) then calculate \(f_x\) and \(f_y\):

    \[ f_x(x,y)=6x−2y+4\quad \text{ and } \quad f_y(x,y)=−2x+2y−6 \nonumber \]

    Therefore,

    \[\dfrac{dy}{dx}=−\dfrac{\frac{∂f}{∂x}}{\frac{∂f}{∂y}}=-\dfrac{6x−2y+4}{−2x+2y−6}=\boxed{\dfrac{3x−y+2}{x−y+3}} \nonumber \]

    (b) We have \(f(x,y,z)=x^2e^y−yze^x.\) Therefore,

    \[\dfrac{∂f}{∂x} =2xe^y−yze^x, \quad\dfrac{∂f}{∂y} =x^2e^y−ze^x, \quad \dfrac{∂f}{∂z} =−ye^x \nonumber \]

    Therefore, the partial derivatives are:

    \[ \dfrac{∂z}{∂x}=−\dfrac{\frac{∂f}{∂x}}{\frac{∂f}{∂z}}=−\dfrac{2xe^y−yze^x}{−ye^x}=\boxed{\dfrac{2xe^y−yze^x}{ye^x}} \nonumber \]

    \[ \dfrac{∂z}{∂y} =−\dfrac{\frac{∂f}{∂y}}{\frac{∂f}{∂z}} =−\dfrac{x^2e^y−ze^x}{−ye^x} =\boxed{\dfrac{x^2e^y−ze^x}{ye^x}} \nonumber \]


    This page titled 2.4: The Chain Rule for Multivariable Functions was last modified on Wed, 15 Apr 2026 12:07:02 GMT and is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Kenn Huber via source content that was edited to the style and standards of the LibreTexts platform.