Differentiation of Functions of Several Variables

25 The Chain Rule

Learning Objectives

  • State the chain rules for one or two independent variables.
  • Use tree diagrams as an aid to understanding the chain rule for several independent and intermediate variables.
  • Perform implicit differentiation of a function of two or more variables.

In single-variable calculus, we found that one of the most useful differentiation rules is the chain rule, which allows us to find the derivative of the composition of two functions. The same thing is true for multivariable calculus, but this time we have to deal with more than one form of the chain rule. In this section, we study extensions of the chain rule and learn how to take derivatives of compositions of functions of more than one variable.

Chain Rules for One or Two Independent Variables

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

\frac{d}{dx}\left(f\left(g\left(x\right)\right)\right)=f\prime \left(g\left(x\right)\right)g\prime \left(x\right).

In this equation, both f\left(x\right) and g\left(x\right) are functions of one variable. 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.

Chain Rule for One Independent Variable

Suppose that x=g\left(t\right) and y=h\left(t\right) are differentiable functions of t and z=f\left(x,y\right) is a differentiable function of x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y. Then z=f\left(x\left(t\right),y\left(t\right)\right) is a differentiable function of t and

\frac{dz}{dt}=\frac{\partial z}{\partial x}·\frac{dx}{dt}+\frac{\partial z}{\partial y}·\frac{dy}{dt},

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

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\left({x}_{0},{y}_{0}\right), where {x}_{0}=g\left({t}_{0}\right) and {y}_{0}=h\left({t}_{0}\right) for a fixed value of {t}_{0}. We wish to prove that z=f\left(x\left(t\right),y\left(t\right)\right) is differentiable at t={t}_{0} and that (Figure) holds at that point as well.

Since f is differentiable at P, we know that

z\left(t\right)=f\left(x,y\right)=f\left({x}_{0},{y}_{0}\right)+{f}_{x}\left({x}_{0},{y}_{0}\right)\left(x-{x}_{0}\right)+{f}_{y}\left({x}_{0},{y}_{0}\right)\left(y-{y}_{0}\right)+E\left(x,y\right),

where \underset{\left(x,y\right)\to \left({x}_{0},{y}_{0}\right)}{\text{lim}}\frac{E\left(x,y\right)}{\sqrt{{\left(x-{x}_{0}\right)}^{2}+{\left(y-{y}_{0}\right)}^{2}}}=0. We then subtract {z}_{0}=f\left({x}_{0},{y}_{0}\right) from both sides of this equation:

\begin{array}{cc}\hfill z\left(t\right)-z\left({t}_{0}\right)& =f\left(x\left(t\right),y\left(t\right)\right)-f\left(x\left({t}_{0}\right),y\left({t}_{0}\right)\right)\hfill \\ & ={f}_{x}\left({x}_{0},{y}_{0}\right)\left(x\left(t\right)-x\left({t}_{0}\right)\right)+{f}_{y}\left({x}_{0},{y}_{0}\right)\left(y\left(t\right)-y\left({t}_{0}\right)\right)+E\left(x\left(t\right),y\left(t\right)\right).\hfill \end{array}

Next, we divide both sides by t-{t}_{0}\text{:}

\frac{z\left(t\right)-z\left({t}_{0}\right)}{t-{t}_{0}}={f}_{x}\left({x}_{0},{y}_{0}\right)\left(\frac{x\left(t\right)-x\left({t}_{0}\right)}{t-{t}_{0}}\right)+{f}_{y}\left({x}_{0},{y}_{0}\right)\left(\frac{y\left(t\right)-y\left({t}_{0}\right)}{t-{t}_{0}}\right)+\frac{E\left(x\left(t\right),y\left(t\right)\right)}{t-{t}_{0}}.

Then we take the limit as t approaches {t}_{0}\text{:}

\begin{array}{cc}\hfill \underset{t\to {t}_{0}}{\text{lim}}\frac{z\left(t\right)-z\left({t}_{0}\right)}{t-{t}_{0}}& ={f}_{x}\left({x}_{0},{y}_{0}\right)\underset{t\to {t}_{0}}{\text{lim}}\left(\frac{x\left(t\right)-x\left({t}_{0}\right)}{t-{t}_{0}}\right)+{f}_{y}\left({x}_{0},{y}_{0}\right)\underset{t\to {t}_{0}}{\text{lim}}\left(\frac{y\left(t\right)-y\left({t}_{0}\right)}{t-{t}_{0}}\right)\hfill \\ & \phantom{\rule{0.5em}{0ex}}+\underset{t\to {t}_{0}}{\text{lim}}\frac{E\left(x\left(t\right),y\left(t\right)\right)}{t-{t}_{0}}.\hfill \end{array}

The left-hand side of this equation is equal to dz\text{/}dt, which leads to

\frac{dz}{dt}={f}_{x}\left({x}_{0},{y}_{0}\right)\frac{dx}{dt}+{f}_{y}\left({x}_{0},{y}_{0}\right)\frac{dy}{dt}+\underset{t\to {t}_{0}}{\text{lim}}\frac{E\left(x\left(t\right),y\left(t\right)\right)}{t-{t}_{0}}.

The last term can be rewritten as

\begin{array}{cc}\hfill \underset{t\to {t}_{0}}{\text{lim}}\frac{E\left(x\left(t\right),y\left(t\right)\right)}{t-{t}_{0}}& =\underset{t\to {t}_{0}}{\text{lim}}\left(\frac{E\left(x,y\right)}{\sqrt{{\left(x-{x}_{0}\right)}^{2}+{\left(y-{y}_{0}\right)}^{2}}}\phantom{\rule{0.2em}{0ex}}\frac{\sqrt{{\left(x-{x}_{0}\right)}^{2}+{\left(y-{y}_{0}\right)}^{2}}}{t-{t}_{0}}\right)\hfill \\ & =\underset{t\to {t}_{0}}{\text{lim}}\left(\frac{E\left(x,y\right)}{\sqrt{{\left(x-{x}_{0}\right)}^{2}+{\left(y-{y}_{0}\right)}^{2}}}\right)\underset{t\to {t}_{0}}{\text{lim}}\left(\frac{\sqrt{{\left(x-{x}_{0}\right)}^{2}+{\left(y-{y}_{0}\right)}^{2}}}{t-{t}_{0}}\right).\hfill \end{array}

As t approaches {t}_{0}, \left(x\left(t\right),y\left(t\right)\right) approaches \left(x\left({t}_{0}\right),y\left({t}_{0}\right)\right), so we can rewrite the last product as

\underset{\left(x,y\right)\to \left({x}_{0},{y}_{0}\right)}{\text{lim}}\left(\frac{E\left(x,y\right)}{\sqrt{{\left(x-{x}_{0}\right)}^{2}+{\left(y-{y}_{0}\right)}^{2}}}\right)\underset{\left(x,y\right)\to \left({x}_{0},{y}_{0}\right)}{\text{lim}}\left(\frac{\sqrt{{\left(x-{x}_{0}\right)}^{2}+{\left(y-{y}_{0}\right)}^{2}}}{t-{t}_{0}}\right).

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

\begin{array}{cc}\hfill \underset{\left(x,y\right)\to \left({x}_{0},{y}_{0}\right)}{\text{lim}}\left(\frac{\sqrt{{\left(x-{x}_{0}\right)}^{2}+{\left(y-{y}_{0}\right)}^{2}}}{t-{t}_{0}}\right)& =\underset{\left(x,y\right)\to \left({x}_{0},{y}_{0}\right)}{\text{lim}}\left(\sqrt{\frac{{\left(x-{x}_{0}\right)}^{2}+{\left(y-{y}_{0}\right)}^{2}}{{\left(t-{t}_{0}\right)}^{2}}}\right)\hfill \\ & =\underset{\left(x,y\right)\to \left({x}_{0},{y}_{0}\right)}{\text{lim}}\left(\sqrt{{\left(\frac{x-{x}_{0}}{t-{t}_{0}}\right)}^{2}+{\left(\frac{y-{y}_{0}}{t-{t}_{0}}\right)}^{2}}\right)\hfill \\ & =\sqrt{{\left(\underset{\left(x,y\right)\to \left({x}_{0},{y}_{0}\right)}{\text{lim}}\left(\frac{x-{x}_{0}}{t-{t}_{0}}\right)\right)}^{2}+{\left(\underset{\left(x,y\right)\to \left({x}_{0},{y}_{0}\right)}{\text{lim}}\left(\frac{y-{y}_{0}}{t-{t}_{0}}\right)\right)}^{2}}.\hfill \end{array}

Since x\left(t\right) and y\left(t\right) 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 (Figure) reveals an interesting pattern. The first term in the equation is \frac{\partial f}{\partial x}·\frac{dx}{dt} and the second term is \frac{\partial f}{\partial y}·\frac{dy}{dt}. Recall that when multiplying fractions, cancelation can be used. If we treat these derivatives as fractions, then each product “simplifies” to something resembling \partial f\text{/}dt. The variables x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y that disappear in this simplification are often called intermediate variables: they are independent variables for the function f, but are dependent variables for the variable t. Two terms appear on the right-hand side of the formula, and f is a function of two variables. This pattern works with functions of more than two variables as well, as we see later in this section.

Using the Chain Rule

Calculate dz\text{/}dt for each of the following functions:

  1. z=f\left(x,y\right)=4{x}^{2}+3{y}^{2},x=x\left(t\right)=\text{sin}\phantom{\rule{0.2em}{0ex}}t,y=y\left(t\right)=\text{cos}\phantom{\rule{0.2em}{0ex}}t
  2. z=f\left(x,y\right)=\sqrt{{x}^{2}-{y}^{2}},x=x\left(t\right)={e}^{2t},y=y\left(t\right)={e}^{\text{−}t}
  1. To use the chain rule, we need four quantities—\partial z\text{/}\partial x,\partial z\text{/}\partial y,dx\text{/}dt, and dy\text{/}dt\text{:}
    \begin{array}{cccc}\frac{\partial z}{\partial x}=8x\hfill & & & \frac{\partial z}{\partial y}=6y\hfill \\ \frac{dx}{dt}=\text{cos}\phantom{\rule{0.2em}{0ex}}t\hfill & & & \frac{dy}{dt}=\text{−}\text{sin}\phantom{\rule{0.2em}{0ex}}t\hfill \end{array}


    Now, we substitute each of these into (Figure):

    \begin{array}{cc}\hfill \frac{dz}{dt}& =\frac{\partial z}{\partial x}·\frac{dx}{dt}+\frac{\partial z}{\partial y}·\frac{dy}{dt}\hfill \\ & =\left(8x\right)\left(\text{cos}\phantom{\rule{0.2em}{0ex}}t\right)+\left(6y\right)\left(\text{−}\text{sin}\phantom{\rule{0.2em}{0ex}}t\right)\hfill \\ & =8x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}t-6y\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}t.\hfill \end{array}


    This answer has three variables in it. To reduce it to one variable, use the fact that x\left(t\right)=\text{sin}\phantom{\rule{0.2em}{0ex}}t\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y\left(t\right)=\text{cos}\phantom{\rule{0.2em}{0ex}}t. We obtain

    \begin{array}{cc}\hfill \frac{dz}{dt}& =8x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}t-6y\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}t\hfill \\ & =8\left(\text{sin}\phantom{\rule{0.2em}{0ex}}t\right)\text{cos}\phantom{\rule{0.2em}{0ex}}t-6\left(\text{cos}\phantom{\rule{0.2em}{0ex}}t\right)\text{sin}\phantom{\rule{0.2em}{0ex}}t\hfill \\ & =2\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}t\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}t.\hfill \end{array}


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

    \begin{array}{cc}\hfill z& =f\left(x,y\right)\hfill \\ & =f\left(x\left(t\right),y\left(t\right)\right)\hfill \\ & =4{\left(x\left(t\right)\right)}^{2}+3{\left(y\left(t\right)\right)}^{2}\hfill \\ & =4{\text{sin}}^{2}t+3{\text{cos}}^{2}t.\hfill \end{array}


    Then

    \begin{array}{cc}\hfill \frac{dz}{dt}& =2\left(4\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}t\right)\left(\text{cos}\phantom{\rule{0.2em}{0ex}}t\right)+2\left(3\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}t\right)\left(\text{−}\text{sin}\phantom{\rule{0.2em}{0ex}}t\right)\hfill \\ & =8\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}t\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}t-6\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}t\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}t\hfill \\ & =2\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}t\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}t,\hfill \end{array}


    which is the same solution. However, it may not always be this easy to differentiate in this form.

  2. To use the chain rule, we again need four quantities—\partial z\text{/}\partial x,\partial z\text{/}dy,dx\text{/}dt, and dy\text{/}dt\text{:}
    \begin{array}{cccc}\frac{\partial z}{\partial x}=\frac{x}{\sqrt{{x}^{2}-{y}^{2}}}\hfill & & & \frac{\partial z}{\partial y}=\frac{\text{−}y}{\sqrt{{x}^{2}-{y}^{2}}}\hfill \\ \frac{dx}{dt}=2{e}^{2t}\hfill & & & \frac{dx}{dt}=\text{−}{e}^{\text{−}t}.\hfill \end{array}


    We substitute each of these into (Figure):

    \begin{array}{cc}\hfill \frac{dz}{dt}& =\frac{\partial z}{\partial x}·\frac{dx}{dt}+\frac{\partial z}{\partial y}·\frac{dy}{dt}\hfill \\ & =\left(\frac{x}{\sqrt{{x}^{2}-{y}^{2}}}\right)\left(2{e}^{2t}\right)+\left(\frac{\text{−}y}{\sqrt{{x}^{2}-{y}^{2}}}\right)\left(\text{−}{e}^{\text{−}t}\right)\hfill \\ & =\frac{2x{e}^{2t}-y{e}^{\text{−}t}}{\sqrt{{x}^{2}-{y}^{2}}}.\hfill \end{array}


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

    \begin{array}{cc}\hfill \frac{dz}{dt}& =\frac{2x{e}^{2t}+y{e}^{\text{−}t}}{\sqrt{{x}^{2}-{y}^{2}}}\hfill \\ & =\frac{2\left({e}^{2t}\right){e}^{2t}+\left({e}^{\text{−}t}\right){e}^{\text{−}t}}{\sqrt{{e}^{4t}-{e}^{-2t}}}\hfill \\ & =\frac{2{e}^{4t}+{e}^{-2t}}{\sqrt{{e}^{4t}-{e}^{-2t}}}.\hfill \end{array}


    To eliminate negative exponents, we multiply the top by {e}^{2t} and the bottom by \sqrt{{e}^{4t}}\text{:}

    \begin{array}{cc}\hfill \frac{dz}{dt}& =\frac{2{e}^{4t}+{e}^{-2t}}{\sqrt{{e}^{4t}-{e}^{-2t}}}·\frac{{e}^{2t}}{\sqrt{{e}^{4t}}}\hfill \\ & =\frac{2{e}^{6t}+1}{\sqrt{{e}^{8t}-{e}^{2t}}}\hfill \\ & =\frac{2{e}^{6t}+1}{\sqrt{{e}^{2t}\left({e}^{6t}-1\right)}}\hfill \\ & =\frac{2{e}^{6t}+1}{{e}^{t}\sqrt{{e}^{6t}-1}}.\hfill \end{array}


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

    \begin{array}{cc}\hfill z& =f\left(x,y\right)\hfill \\ & =f\left(x\left(t\right),y\left(t\right)\right)\hfill \\ & =\sqrt{{\left(x\left(t\right)\right)}^{2}-{\left(y\left(t\right)\right)}^{2}}\hfill \\ & =\sqrt{{e}^{4t}-{e}^{-2t}}\hfill \\ & ={\left({e}^{4t}-{e}^{-2t}\right)}^{1\text{/}2}.\hfill \end{array}


    Then

    \begin{array}{cc}\hfill \frac{dz}{dt}& =\frac{1}{2}{\left({e}^{4t}-{e}^{-2t}\right)}^{\text{−}1\text{/}2}\left(4{e}^{4t}+2{e}^{-2t}\right)\hfill \\ & =\frac{2{e}^{4t}+{e}^{-2t}}{\sqrt{{e}^{4t}-{e}^{-2t}}}.\hfill \end{array}


    This is the same solution.

Calculate dz\text{/}dt given the following functions. Express the final answer in terms of t.

z=f\left(x,y\right)={x}^{2}-3xy+2{y}^{2},x=x\left(t\right)=3\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}2t,y=y\left(t\right)=4\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}2t

\begin{array}{cc}\hfill \frac{dz}{dt}& =\frac{\partial f}{\partial x}\phantom{\rule{0.2em}{0ex}}\frac{dx}{dt}+\frac{\partial f}{\partial y}\phantom{\rule{0.2em}{0ex}}\frac{dy}{dt}\hfill \\ & =\left(2x-3y\right)\left(6\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}2t\right)+\left(-3x+4y\right)\left(-8\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}2t\right)\hfill \\ & =-92\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}2t\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}2t-72\left({\text{cos}}^{2}2t-{\text{sin}}^{2}2t\right)\hfill \\ & =-46\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}4t-72\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}4t.\hfill \end{array}

Hint

Calculate \partial z\text{/}\partial x,\partial z\text{/}dy,dx\text{/}dt, and dy\text{/}dt, then use (Figure).

It is often useful to create a visual representation of (Figure) for 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 ((Figure)). This diagram can be expanded for functions of more than one variable, as we shall see very shortly.

Tree diagram for the case \frac{dz}{dt}=\frac{\partial z}{\partial x}·\frac{dx}{dt}+\frac{\partial z}{\partial y}·\frac{dy}{dt}.

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.

In this diagram, the leftmost corner corresponds to z=f\left(x,y\right). 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 \left(\partial z\text{/}\partial x\right)\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}\left(dx\text{/}dt\right). The bottom branch is similar: first the y branch, then the t branch. This branch is labeled \left(\partial z\text{/}\partial y\right)\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}\left(dy\text{/}dt\right). To get the formula for dz\text{/}dt, add all the terms that appear on the rightmost side of the diagram. This gives us (Figure).

In (Figure), z=f\left(x,y\right) is a function of x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y, and both x=g\left(u,v\right) and y=h\left(u,v\right) are functions of the independent variables u\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}v.

Chain Rule for Two Independent Variables

Suppose x=g\left(u,v\right) and y=h\left(u,v\right) are differentiable functions of u and v, and z=f\left(x,y\right) is a differentiable function of x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y. Then, z=f\left(g\left(u,v\right),h\left(u,v\right)\right) is a differentiable function of u\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}v, and

\frac{\partial z}{\partial u}=\frac{\partial z}{\partial x}\phantom{\rule{0.2em}{0ex}}\frac{\partial x}{\partial u}+\frac{\partial z}{\partial y}\phantom{\rule{0.2em}{0ex}}\frac{\partial x}{\partial u}

and

\frac{\partial z}{\partial v}=\frac{\partial z}{\partial x}\phantom{\rule{0.2em}{0ex}}\frac{\partial x}{\partial v}+\frac{\partial z}{\partial y}\phantom{\rule{0.2em}{0ex}}\frac{\partial y}{\partial v}.

We can draw a tree diagram for each of these formulas as well as follows.

Tree diagram for \frac{\partial z}{\partial u}=\frac{\partial z}{\partial x}·\frac{\partial x}{\partial u}+\frac{\partial z}{\partial y}·\frac{\partial y}{\partial u} and \frac{\partial z}{\partial v}=\frac{\partial z}{\partial x}·\frac{\partial x}{\partial v}+\frac{\partial z}{\partial y}·\frac{\partial y}{\partial v}.

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.

To derive the formula for \partial z\text{/}\partial 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 \partial z\text{/}\partial v, follow only the branches that end with v and add the terms that appear at the end of those branches.

There is an important difference between these two chain rule theorems. In (Figure), the left-hand side of the formula for the derivative is not a partial derivative, but in (Figure) it is. The reason is that, in (Figure), z is ultimately a function of t alone, whereas in (Figure), z is a function of both u\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}v.

Using the Chain Rule for Two Variables

Calculate \partial z\text{/}\partial u and \partial z\text{/}\partial v using the following functions:

z=f\left(x,y\right)=3{x}^{2}-2xy+{y}^{2},x=x\left(u,v\right)=3u+2v,y=y\left(u,v\right)=4u-v.

To implement the chain rule for two variables, we need six partial derivatives—\partial z\text{/}\partial x,\partial z\text{/}\partial y,\partial x\text{/}\partial u,\partial x\text{/}\partial v,\partial y\text{/}\partial u, and \partial y\text{/}\partial v\text{:}

\begin{array}{cccc}\frac{\partial z}{\partial x}=6x-2y\hfill & & & \frac{\partial z}{\partial y}=-2x+2y\hfill \\ \frac{\partial x}{\partial u}=3\hfill & & & \frac{\partial x}{\partial v}=2\hfill \\ \frac{\partial y}{\partial u}=4\hfill & & & \frac{\partial y}{\partial v}=-1.\hfill \end{array}

To find \partial z\text{/}\partial u, we use (Figure):

\begin{array}{cc}\hfill \frac{\partial z}{\partial u}& =\frac{\partial z}{\partial x}·\frac{\partial x}{\partial u}+\frac{\partial z}{\partial y}·\frac{\partial y}{\partial u}\hfill \\ & =3\left(6x-2y\right)+4\left(-2x+2y\right)\hfill \\ & =10x+2y.\hfill \end{array}

Next, we substitute x\left(u,v\right)=3u+2v and y\left(u,v\right)=4u-v\text{:}

\begin{array}{cc}\hfill \frac{\partial z}{\partial u}& =10x+2y\hfill \\ & =10\left(3u+2v\right)+2\left(4u-v\right)\hfill \\ & =38u+18v.\hfill \end{array}

To find \partial z\text{/}\partial v, we use (Figure):

\begin{array}{cc}\hfill \frac{\partial z}{\partial v}& =\frac{\partial z}{\partial x}\phantom{\rule{0.2em}{0ex}}\frac{\partial x}{\partial v}+\frac{\partial z}{\partial y}\phantom{\rule{0.2em}{0ex}}\frac{\partial y}{\partial v}\hfill \\ & =2\left(6x-2y\right)+\left(-1\right)\left(-2x+2y\right)\hfill \\ & =14x-6y.\hfill \end{array}

Then we substitute x\left(u,v\right)=3u+2v and y\left(u,v\right)=4u-v\text{:}

\begin{array}{cc}\hfill \frac{\partial z}{\partial v}& =14x-6y\hfill \\ & =14\left(3u+2v\right)-6\left(4u-v\right)\hfill \\ & =18u+34v.\hfill \end{array}

Calculate \partial z\text{/}\partial u and \partial z\text{/}\partial v given the following functions:

z=f\left(x,y\right)=\frac{2x-y}{x+3y},x\left(u,v\right)={e}^{2u}\text{cos}\phantom{\rule{0.2em}{0ex}}3v,y\left(u,v\right)={e}^{2u}\text{sin}\phantom{\rule{0.2em}{0ex}}3v.

\frac{\partial z}{\partial u}=0,\phantom{\rule{1em}{0ex}}\frac{\partial z}{\partial v}=\frac{-21}{{\left(3\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}3v+\text{cos}\phantom{\rule{0.2em}{0ex}}3v\right)}^{2}}

Hint

Calculate \partial z\text{/}\partial x,\partial z\text{/}\partial y,\partial x\text{/}\partial u,\partial x\text{/}\partial v,\partial y\text{/}\partial u, and \partial y\text{/}\partial v, then use (Figure) and (Figure).

The Generalized Chain Rule

Now that we’ve see 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.

Generalized Chain Rule

Let w=f\left({x}_{1},{x}_{2}\text{,…,}\phantom{\rule{0.2em}{0ex}}{x}_{m}\right) be a differentiable function of m independent variables, and for each i\in \left\{1\text{,…,}\phantom{\rule{0.2em}{0ex}}m\right\}, let {x}_{i}={x}_{i}\left({t}_{1},{t}_{2}\text{,…,}\phantom{\rule{0.2em}{0ex}}{t}_{n}\right) be a differentiable function of n independent variables. Then

\frac{\partial w}{\partial {t}_{j}}=\frac{\partial w}{\partial {x}_{1}}\phantom{\rule{0.2em}{0ex}}\frac{\partial {x}_{1}}{\partial {t}_{j}}+\frac{\partial w}{\partial {x}_{2}}\phantom{\rule{0.2em}{0ex}}\frac{\partial {x}_{2}}{\partial {t}_{j}}+\text{⋯}+\frac{\partial w}{\partial {x}_{m}}\phantom{\rule{0.2em}{0ex}}\frac{\partial {x}_{m}}{\partial {t}_{j}}

for any j\in \left\{1,2\text{,…,}\phantom{\rule{0.2em}{0ex}}n\right\}.

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.

Using the Generalized Chain Rule

Calculate \partial w\text{/}\partial u and \partial w\text{/}\partial v using the following functions:

\begin{array}{}\\ \hfill w& =\hfill & f\left(x,y,z\right)=3{x}^{2}-2xy+4{z}^{2}\hfill \\ \hfill x& =\hfill & x\left(u,v\right)={e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v\hfill \\ \hfill y& =\hfill & y\left(u,v\right)={e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v\hfill \\ \hfill z& =\hfill & z\left(u,v\right)={e}^{u}.\hfill \end{array}

The formulas for \partial w\text{/}\partial u and \partial w\text{/}\partial v are

\begin{array}{c}\frac{\partial w}{\partial u}=\frac{\partial w}{\partial x}·\frac{\partial x}{\partial u}+\frac{\partial w}{\partial y}·\frac{\partial y}{\partial u}+\frac{\partial w}{\partial z}·\frac{\partial z}{\partial u}\hfill \\ \frac{\partial w}{\partial v}=\frac{\partial w}{\partial x}·\frac{\partial x}{\partial v}+\frac{\partial w}{\partial y}·\frac{\partial y}{\partial v}+\frac{\partial w}{\partial z}·\frac{\partial z}{\partial v}.\hfill \end{array}

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

\begin{array}{ccccccccccccc}\hfill \frac{\partial w}{\partial x}& =\hfill & 6x-2y\hfill & & & \hfill \frac{\partial w}{\partial y}& =\hfill & -2x\hfill & & & \hfill \frac{\partial w}{\partial z}& =\hfill & 8z\hfill \\ \hfill \frac{\partial x}{\partial u}& =\hfill & {e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v\hfill & & & \hfill \frac{\partial y}{\partial u}& =\hfill & {e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v\hfill & & & \hfill \frac{\partial z}{\partial u}& =\hfill & {e}^{u}\hfill \\ \hfill \frac{\partial x}{\partial v}& =\hfill & {e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v\hfill & & & \hfill \frac{\partial y}{\partial v}& =\hfill & \text{−}{e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v\hfill & & & \hfill \frac{\partial z}{\partial v}& =\hfill & 0.\hfill \end{array}

Now, we substitute each of them into the first formula to calculate \partial w\text{/}\partial u\text{:}

\begin{array}{cc}\hfill \frac{\partial w}{\partial u}& =\frac{\partial w}{\partial x}·\frac{\partial x}{\partial u}+\frac{\partial w}{\partial y}·\frac{\partial y}{\partial u}+\frac{\partial w}{\partial z}·\frac{\partial z}{\partial u}\hfill \\ & =\left(6x-2y\right){e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v-2x{e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v+8z{e}^{u},\hfill \end{array}

then substitute x\left(u,v\right)={e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v,y\left(u,v\right)={e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v, and z\left(u,v\right)={e}^{u} into this equation:

\begin{array}{cc}\hfill \frac{\partial w}{\partial u}& =\left(6x-2y\right){e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v-2x{e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v+8z{e}^{u}\hfill \\ & =\left(6{e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v-2{e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v\right){e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v-2\left({e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v\right){e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v+8{e}^{2u}\hfill \\ & =6{e}^{2u}{\text{sin}}^{2}v-4{e}^{2u}\text{sin}\phantom{\rule{0.2em}{0ex}}v\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}v+8{e}^{2u}\hfill \\ & =2{e}^{2u}\left(3\phantom{\rule{0.2em}{0ex}}{\text{sin}}^{2}v-2\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}v\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}v+4\right).\hfill \end{array}

Next, we calculate \partial w\text{/}\partial v\text{:}

\begin{array}{cc}\hfill \frac{\partial w}{\partial v}& =\frac{\partial w}{\partial x}·\frac{\partial x}{\partial v}+\frac{\partial w}{\partial y}·\frac{\partial y}{\partial v}+\frac{\partial w}{\partial z}·\frac{\partial z}{\partial v}\hfill \\ & =\left(6x-2y\right){e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v-2x\left(\text{−}{e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v\right)+8z\left(0\right),\hfill \end{array}

then we substitute x\left(u,v\right)={e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v,y\left(u,v\right)={e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v, and z\left(u,v\right)={e}^{u} into this equation:

\begin{array}{cc}\hfill \frac{\partial w}{\partial v}& =\left(6x-2y\right){e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v-2x\left(\text{−}{e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v\right)\hfill \\ & =\left(6{e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v-2{e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v\right){e}^{u}\text{cos}\phantom{\rule{0.2em}{0ex}}v+2\left({e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v\right)\left({e}^{u}\text{sin}\phantom{\rule{0.2em}{0ex}}v\right)\hfill \\ & =2{e}^{2u}{\text{sin}}^{2}v+6{e}^{2u}\text{sin}\phantom{\rule{0.2em}{0ex}}v\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}v-2{e}^{2u}{\text{cos}}^{2}v\hfill \\ & =2{e}^{2u}\left({\text{sin}}^{2}v+\text{sin}\phantom{\rule{0.2em}{0ex}}v\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}v-{\text{cos}}^{2}v\right).\hfill \end{array}

Calculate \partial w\text{/}\partial u and \partial w\text{/}\partial v given the following functions:

\begin{array}{}\\ \\ \hfill w& =\hfill & f\left(x,y,z\right)=\frac{x+2y-4z}{2x-y+3z}\hfill \\ \hfill x& =\hfill & x\left(u,v\right)={e}^{2u}\text{cos}\phantom{\rule{0.2em}{0ex}}3v\hfill \\ \hfill y& =\hfill & y\left(u,v\right)={e}^{2u}\text{sin}\phantom{\rule{0.2em}{0ex}}3v\hfill \\ \hfill z& =\hfill & z\left(u,v\right)={e}^{2u}.\hfill \end{array}

\begin{array}{c}\frac{\partial w}{\partial u}=0\hfill \\ \frac{\partial w}{\partial v}=\frac{15-33\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}3v+6\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}3v}{{\left(3+2\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}3v-\text{sin}\phantom{\rule{0.2em}{0ex}}3v\right)}^{2}}\hfill \end{array}

Hint

Calculate nine partial derivatives, then use the same formulas from (Figure).

Drawing a Tree Diagram

Create a tree diagram for the case when

w=f\left(x,y,z\right),x=x\left(t,u,v\right),y=y\left(t,u,v\right),z=z\left(t,u,v\right)

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,\text{and}\phantom{\rule{0.2em}{0ex}}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,\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}v.

Tree diagram for a function of three variables, each of which is a function of three independent variables.

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{array}{c}\frac{\partial w}{\partial t}=\frac{\partial w}{\partial x}\phantom{\rule{0.2em}{0ex}}\frac{\partial x}{\partial t}+\frac{\partial w}{\partial y}\phantom{\rule{0.2em}{0ex}}\frac{\partial y}{\partial t}+\frac{\partial w}{\partial z}\phantom{\rule{0.2em}{0ex}}\frac{\partial z}{\partial t}\hfill \\ \frac{\partial w}{\partial u}=\frac{\partial w}{\partial x}\phantom{\rule{0.2em}{0ex}}\frac{\partial x}{\partial u}+\frac{\partial w}{\partial y}\phantom{\rule{0.2em}{0ex}}\frac{\partial y}{\partial u}+\frac{\partial w}{\partial z}\phantom{\rule{0.2em}{0ex}}\frac{\partial z}{\partial u}\hfill \\ \frac{\partial w}{\partial v}=\frac{\partial w}{\partial x}\phantom{\rule{0.2em}{0ex}}\frac{\partial x}{\partial v}+\frac{\partial w}{\partial y}\phantom{\rule{0.2em}{0ex}}\frac{\partial y}{\partial v}+\frac{\partial w}{\partial z}\phantom{\rule{0.2em}{0ex}}\frac{\partial z}{\partial v}.\hfill \end{array}

Create a tree diagram for the case when

w=f\left(x,y\right),x=x\left(t,u,v\right),y=y\left(t,u,v\right)

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

\begin{array}{c}\frac{\partial w}{\partial t}=\frac{\partial w}{\partial x}\phantom{\rule{0.2em}{0ex}}\frac{\partial x}{\partial t}+\frac{\partial w}{\partial y}\phantom{\rule{0.2em}{0ex}}\frac{\partial y}{\partial t}\hfill \\ \frac{\partial w}{\partial u}=\frac{\partial w}{\partial x}\phantom{\rule{0.2em}{0ex}}\frac{\partial x}{\partial u}+\frac{\partial w}{\partial y}\phantom{\rule{0.2em}{0ex}}\frac{\partial y}{\partial u}\hfill \\ \frac{\partial w}{\partial v}=\frac{\partial w}{\partial x}\phantom{\rule{0.2em}{0ex}}\frac{\partial x}{\partial v}+\frac{\partial w}{\partial y}\phantom{\rule{0.2em}{0ex}}\frac{\partial y}{\partial v}\hfill \end{array}

A diagram that starts with w = f(x, y). 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.

Hint

Determine the number of branches that emanate from each node in the tree.

Implicit Differentiation

Recall from Implicit Differentiation that implicit differentiation provides a method for finding dy\text{/}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 dy\text{/}dx. Partial derivatives provide an alternative to this method.

Consider the ellipse defined by the equation {x}^{2}+3{y}^{2}+4y-4=0 as follows.

Graph of the ellipse defined by {x}^{2}+3{y}^{2}+4y-4=0.

An ellipse with center near (0, –0.7), major axis horizontal and of length roughly 4.5, and minor axis of length roughly 3.

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

\begin{array}{ccc}\hfill \frac{d}{dx}\left({x}^{2}+3{y}^{2}+4y-4\right)& =\hfill & \frac{d}{dx}\left(0\right)\hfill \\ \hfill 2x+6y\frac{dy}{dx}+4\frac{dy}{dx}& =\hfill & 0\hfill \\ \hfill \left(6y+4\right)\frac{dy}{dx}& =\hfill & -2x\hfill \\ \hfill \frac{dy}{dx}& =\hfill & -\frac{x}{3y+2}.\hfill \end{array}

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

Implicit Differentiation of a Function of Two or More Variables

Suppose the function z=f\left(x,y\right) defines y implicitly as a function y=g\left(x\right) of x via the equation f\left(x,y\right)=0. Then

\frac{dy}{dx}=-\frac{\partial f\text{/}\partial x}{\partial f\text{/}\partial y}

provided {f}_{y}\left(x,y\right)\ne 0.

If the equation f\left(x,y,z\right)=0 defines z implicitly as a differentiable function of x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y, then

\frac{\partial z}{\partial x}=-\frac{\partial f\text{/}\partial x}{\partial f\text{/}\partial z}\phantom{\rule{1em}{0ex}}\text{and}\phantom{\rule{1em}{0ex}}\frac{\partial z}{\partial y}=-\frac{\partial f\text{/}\partial y}{\partial f\text{/}\partial z}

as long as {f}_{z}\left(x,y,z\right)\ne 0.

(Figure) is a direct consequence of (Figure). In particular, if we assume that y is defined implicitly as a function of x via the equation f\left(x,y\right)=0, we can apply the chain rule to find dy\text{/}dx\text{:}

\begin{array}{ccc}\hfill \frac{d}{dx}f\left(x,y\right)& =\hfill & \frac{d}{dx}\left(0\right)\hfill \\ \hfill \frac{\partial f}{\partial x}·\frac{dx}{dx}+\frac{\partial f}{\partial y}·\frac{dy}{dx}& =\hfill & 0\hfill \\ \hfill \frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}·\frac{dy}{dx}& =\hfill & 0.\hfill \end{array}

Solving this equation for dy\text{/}dx gives (Figure). (Figure) can be derived in a similar fashion.

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

\begin{array}{c}\frac{\partial f}{\partial x}=2x\hfill \\ \frac{\partial f}{\partial y}=6y+4.\hfill \end{array}

Then (Figure) gives

\frac{dy}{dx}=-\frac{\partial f\text{/}\partial x}{\partial f\text{/}\partial y}=-\frac{2x}{6y+4}=-\frac{x}{3y+2},

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

Implicit Differentiation by Partial Derivatives
  1. Calculate dy\text{/}dx if y is defined implicitly as a function of x via the equation 3{x}^{2}-2xy+{y}^{2}+4x-6y-11=0. What is the equation of the tangent line to the graph of this curve at point \left(2,1\right)?
  2. Calculate \partial z\text{/}\partial x and \partial z\text{/}\partial y, given {x}^{2}{e}^{y}-yz{e}^{x}=0.
  1. Set f\left(x,y\right)=3{x}^{2}-2xy+{y}^{2}+4x-6y-11=0, then calculate {f}_{x} and {f}_{y}\text{:} \begin{array}{c}{f}_{x}=6x-2y+4\hfill \\ {f}_{y}=-2x+2y-6.\hfill \end{array}
    The derivative is given by
    \frac{dy}{dx}=-\frac{\partial f\text{/}\partial x}{\partial f\text{/}\partial y}=-\frac{6x-2y+4}{-2x+2y-6}=\frac{3x-y+2}{x-y+3}.


    The slope of the tangent line at point \left(2,1\right) is given by

    {\frac{dy}{dx}|}_{\left(x,y\right)=\left(2,1\right)}=\frac{3\left(2\right)-1+2}{2-1+3}=\frac{7}{4}.


    To find the equation of the tangent line, we use the point-slope form ((Figure)):

    \begin{array}{ccc}\hfill y-{y}_{0}& =\hfill & m\left(x-{x}_{0}\right)\hfill \\ \hfill y-1& =\hfill & \frac{7}{4}\left(x-2\right)\hfill \\ \hfill y& =\hfill & \frac{7}{4}x-\frac{7}{2}+1\hfill \\ \hfill y& =\hfill & \frac{7}{4}x-\frac{5}{2}.\hfill \end{array}


    Graph of the rotated ellipse defined by 3{x}^{2}-2xy+{y}^{2}+4x-6y-11=0.

    A rotated ellipse with equation 3x2 – 2xy + y2 + 4x – 6y – 11 = 0 and with tangent at (2, 1). The equation for the tangent is given by y = 7/4 x – 5/2. The ellipse’s major axis is parallel to the tangent line.

  2. We have f\left(x,y,z\right)={x}^{2}{e}^{y}-yz{e}^{x}. Therefore,
    \begin{array}{c}\frac{\partial f}{\partial x}=2x{e}^{y}-yz{e}^{x}\hfill \\ \frac{\partial f}{\partial y}={x}^{2}{e}^{y}-z{e}^{x}\hfill \\ \frac{\partial f}{\partial z}=\text{−}y{e}^{x}.\hfill \end{array}


    Using (Figure),

    \begin{array}{ccccccc}\begin{array}{cc}\hfill \frac{\partial z}{\partial x}& =-\frac{\partial f\text{/}\partial x}{\partial f\text{/}\partial y}\hfill \\ & =-\frac{2x{e}^{y}-yz{e}^{x}}{\text{−}y{e}^{x}}\hfill \\ & =\frac{2x{e}^{y}-yz{e}^{x}}{y{e}^{x}}\hfill \end{array}\hfill & & & \text{and}\hfill & & & \begin{array}{cc}\hfill \frac{\partial z}{\partial y}& =-\frac{\partial f\text{/}\partial y}{\partial f\text{/}\partial z}\hfill \\ & =-\frac{{x}^{2}{e}^{y}-z{e}^{x}}{\text{−}y{e}^{x}}\hfill \\ & =\frac{{x}^{2}{e}^{y}-z{e}^{x}}{y{e}^{x}}.\hfill \end{array}\hfill \end{array}

Find dy\text{/}dx if y is defined implicitly as a function of x by the equation {x}^{2}+xy-{y}^{2}+7x-3y-26=0. What is the equation of the tangent line to the graph of this curve at point \left(3,-2\right)?

\frac{dy}{dx}={\frac{2x+y+7}{2y-x+3}|}_{\left(3,-2\right)}=\frac{2\left(3\right)+\left(-2\right)+7}{2\left(-2\right)-\left(3\right)+3}=-\frac{11}{4}
Equation of the tangent line: y=-\frac{11}{4}x+\frac{25}{4}

Hint

Calculate \partial f\text{/}dx and \partial f\text{/}dy, then use (Figure).

Key Concepts

  • The chain rule for functions of more than one variable involves the partial derivatives with respect to all the independent variables.
  • Tree diagrams are useful for deriving formulas for the chain rule for functions of more than one variable, where each independent variable also depends on other variables.

Key Equations

  • Chain rule, one independent variable
    \frac{dz}{dt}=\frac{\partial z}{\partial x}·\frac{dx}{dt}+\frac{\partial z}{\partial y}·\frac{dy}{dt}
  • Chain rule, two independent variables
    \frac{dz}{du}=\frac{\partial z}{\partial x}·\frac{\partial x}{\partial u}+\frac{\partial z}{\partial y}·\frac{\partial y}{\partial u}
    \frac{dz}{dv}=\frac{\partial z}{\partial x}·\frac{\partial x}{\partial v}+\frac{\partial z}{\partial y}·\frac{\partial y}{\partial v}
  • Generalized chain rule
    \frac{\partial w}{\partial {t}_{j}}=\frac{\partial w}{\partial {x}_{1}}\phantom{\rule{0.2em}{0ex}}\frac{\partial {x}_{1}}{\partial {t}_{j}}+\frac{\partial w}{\partial {x}_{2}}\phantom{\rule{0.2em}{0ex}}\frac{\partial {x}_{1}}{\partial {t}_{j}}+\text{⋯}+\frac{\partial w}{\partial {x}_{m}}\phantom{\rule{0.2em}{0ex}}\frac{\partial {x}_{m}}{\partial {t}_{j}}

For the following exercises, use the information provided to solve the problem.

Let w\left(x,y,z\right)=xy\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}z, where x=t,y={t}^{2}, and z=\text{arcsin}\phantom{\rule{0.2em}{0ex}}t. Find \frac{dw}{dt}.

\frac{dw}{dt}=y\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}z+x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}z\left(2t\right)-\frac{xy\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}z}{\sqrt{1-{t}^{2}}}

Let w\left(t,v\right)={e}^{tv} where t=r+s and v=rs. Find \frac{\partial w}{\partial r} and \frac{\partial w}{\partial s}.

If w=5{x}^{2}+2{y}^{2},x=-3s+t, and y=s-4t, find \frac{\partial w}{\partial s} and \frac{\partial w}{\partial t}.

\frac{\partial w}{\partial s}=-30x+4y,\frac{\partial w}{\partial t}=10x-16y

If w=x{y}^{2},x=5\phantom{\rule{0.2em}{0ex}}\text{cos}\left(2t\right), and y=5\phantom{\rule{0.2em}{0ex}}\text{sin}\left(2t\right), find \frac{\partial w}{\partial t}.

If f\left(x,y\right)=xy,x=r\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta , and y=r\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta , find \frac{\partial f}{\partial r} and express the answer in terms of r and \theta .

\frac{\partial f}{\partial r}=r\phantom{\rule{0.2em}{0ex}}\text{sin}\left(2\theta \right)

Suppose f\left(x,y\right)=x+y,u={e}^{x}\text{sin}\phantom{\rule{0.2em}{0ex}}y,x={t}^{2}, and y=\pi t, where x=r\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta and y=r\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta . Find \frac{\partial f}{\partial \theta }.

For the following exercises, find \frac{df}{dt} using the chain rule and direct substitution.

f\left(x,y\right)={x}^{2}+{y}^{2},x=t,y={t}^{2}

\frac{df}{dt}=2t+4{t}^{3}

f\left(x,y\right)=\sqrt{{x}^{2}+{y}^{2}},y={t}^{2},x=t

f\left(x,y\right)=xy,x=1-\sqrt{t},y=1+\sqrt{t}

\frac{df}{dt}=-1

f\left(x,y\right)=\frac{x}{y},x={e}^{t},y=2{e}^{t}

f\left(x,y\right)=\text{ln}\left(x+y\right),x={e}^{t},y={e}^{t}

\frac{df}{dt}=1

f\left(x,y\right)={x}^{4},x=t,y=t

Let w\left(x,y,z\right)={x}^{2}+{y}^{2}+{z}^{2}, x=\text{cos}\phantom{\rule{0.2em}{0ex}}t,y=\text{sin}\phantom{\rule{0.2em}{0ex}}t, and z={e}^{t}. Express w as a function of t and find \frac{dw}{dt} directly. Then, find \frac{dw}{dt} using the chain rule.

\frac{dw}{dt}=2{e}^{2t} in both cases

Let z={x}^{2}y, where x={t}^{2} and y={t}^{3}. Find \frac{dz}{dt}.

Let u={e}^{x}\text{sin}\phantom{\rule{0.2em}{0ex}}y, where x={t}^{2} and y=\pi t. Find \frac{du}{dt} when x=\text{ln}\phantom{\rule{0.2em}{0ex}}2 and y=\frac{\pi }{4}.

2\sqrt{2}t+\sqrt{2}\pi =\frac{du}{dt}

For the following exercises, find \frac{dy}{dx} using partial derivatives.

\text{sin}\left(6x\right)+\text{tan}\left(8y\right)+5=0

{x}^{3}+{y}^{2}x-3=0

\frac{dy}{dx}=-\frac{3{x}^{2}+{y}^{2}}{2xy}

\text{sin}\left(x+y\right)+\text{cos}\left(x-y\right)=4

{x}^{2}-2xy+{y}^{4}=4

\frac{dy}{dx}=\frac{y-x}{\text{−}x+2{y}^{3}}

x{e}^{y}+y{e}^{x}-2{x}^{2}y=0

{x}^{2\text{/}3}+{y}^{2\text{/}3}={a}^{2\text{/}3}

\frac{dy}{dx}=\text{−}\sqrt[3]{\frac{y}{x}}

x\phantom{\rule{0.2em}{0ex}}\text{cos}\left(xy\right)+y\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}x=2

{e}^{xy}+y{e}^{y}=1

\frac{dy}{dx}=-\frac{y{e}^{xy}}{x{e}^{xy}+{e}^{y}\left(1+y\right)}

{x}^{2}{y}^{3}+\text{cos}\phantom{\rule{0.2em}{0ex}}y=0

Find \frac{dz}{dt} using the chain rule where z=3{x}^{2}{y}^{3},x={t}^{4}, and y={t}^{2}.

\frac{dz}{dt}=42{t}^{13}

Let z=3\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}x-\text{sin}\left(xy\right),x=\frac{1}{t}, and y=3t. Find \frac{dz}{dt}.

Let z={e}^{1-xy},x={t}^{1\text{/}3}, and y={t}^{3}. Find \frac{dz}{dt}.

\frac{dz}{dt}=-\frac{10}{3}{t}^{7\text{/}3}\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}{e}^{1-{t}^{10\text{/}3}}

Find \frac{dz}{dt} by the chain rule where z={\text{cosh}}^{2}\left(xy\right),x=\frac{1}{2}t, and y={e}^{t}.

Let z=\frac{x}{y},x=2\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}u, and y=3\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}v. Find \frac{\partial z}{\partial u} and \frac{\partial z}{\partial v}.

\frac{\partial z}{\partial u}=\frac{-2\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}u}{3\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}v} and \frac{\partial z}{\partial v}=\frac{-2\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}u\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}v}{3\phantom{\rule{0.2em}{0ex}}{\text{sin}}^{2}v}

Let z={e}^{{x}^{2}y}, where x=\sqrt{uv} and y=\frac{1}{v}. Find \frac{\partial z}{\partial u} and \frac{\partial z}{\partial v}.

If z=xy{e}^{x\text{/}y}, x=r\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta , and y=r\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta , find \frac{\partial z}{\partial r} and \frac{\partial z}{\partial \theta } when r=2 and \theta =\frac{\pi }{6}.

\frac{\partial z}{\partial r}=\sqrt{3}{e}^{\sqrt{3}},\frac{\partial z}{\partial \theta }=\left(2-4\sqrt{3}\right){e}^{\sqrt{3}}

Find \frac{\partial w}{\partial s} if w=4x+{y}^{2}+{z}^{3},x={e}^{r{s}^{2}},y=\text{ln}\left(\frac{r+s}{t}\right), and z=rs{t}^{2}.

If w=\text{sin}\left(xyz\right),x=1-3t,y={e}^{1-t}, and z=4t, find \frac{\partial w}{\partial t}.

\frac{\partial w}{\partial t}=\text{cos}\left(xyz\right)\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}yz\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}\left(-3\right)-\text{cos}\left(xyz\right)xz{e}^{1-t}+\text{cos}\left(xyz\right)xy\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}4

For the following exercises, use this information: A function f\left(x,y\right) is said to be homogeneous of degree n if f\left(tx,ty\right)={t}^{n}f\left(x,y\right). For all homogeneous functions of degree n, the following equation is true: x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=nf\left(x,y\right). Show that the given function is homogeneous and verify that x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=nf\left(x,y\right).

f\left(x,y\right)=3{x}^{2}+{y}^{2}

f\left(x,y\right)=\sqrt{{x}^{2}+{y}^{2}}

f\left(tx,ty\right)=\sqrt{{t}^{2}{x}^{2}+{t}^{2}{y}^{2}}={t}^{1}f\left(x,y\right),\frac{\partial f}{\partial y}=x\frac{1}{2}{\left({x}^{2}+{y}^{2}\right)}^{\text{−}1\text{/}2}\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}2x+y\frac{1}{2}{\left({x}^{2}+{y}^{2}\right)}^{\text{−}1\text{/}2}\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}2y=1f\left(x,y\right)

f\left(x,y\right)={x}^{2}y-2{y}^{3}

The volume of a right circular cylinder is given by V\left(x,y\right)=\pi {x}^{2}y, where x is the radius of the cylinder and y is the cylinder height. Suppose x and y are functions of t given by x=\frac{1}{2}t and y=\frac{1}{3}t so that x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y are both increasing with time. How fast is the volume increasing when x=2 and y=5?

\frac{34\pi }{3}

The pressure P of a gas is related to the volume and temperature by the formula PV=kT, where temperature is expressed in kelvins. Express the pressure of the gas as a function of both V and T. Find \frac{dP}{dt} when k=1, \frac{dV}{dt}=2 cm3/min, \frac{dT}{dt}=\frac{1}{2} K/min, V=20 cm3, and T=20\text{°}\text{F}.

The radius of a right circular cone is increasing at 3 cm/min whereas the height of the cone is decreasing at 2 cm/min. Find the rate of change of the volume of the cone when the radius is 13 cm and the height is 18 cm.

\frac{dV}{dt}=\frac{1066\pi }{3}{\text{cm}}^{3}\text{/}\text{min}

The volume of a frustum of a cone is given by the formula V=\frac{1}{3}\pi z\left({x}^{2}+{y}^{2}+xy\right), where x is the radius of the smaller circle, y is the radius of the larger circle, and z is the height of the frustum (see figure). Find the rate of change of the volume of this frustum when x=10\phantom{\rule{0.2em}{0ex}}\text{in}\text{.,}\phantom{\rule{0.2em}{0ex}}y=12\phantom{\rule{0.2em}{0ex}}\text{in.,}\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}z=18\phantom{\rule{0.2em}{0ex}}\text{in}.

A conical frustum (that is, a cone with the pointy end cut off) with height x, larger radius y, and smaller radius x.

A closed box is in the shape of a rectangular solid with dimensions x,y,\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}z. (Dimensions are in inches.) Suppose each dimension is changing at the rate of 0.5 in./min. Find the rate of change of the total surface area of the box when x=2\phantom{\rule{0.2em}{0ex}}\text{in}\text{.,}\phantom{\rule{0.2em}{0ex}}y=3\phantom{\rule{0.2em}{0ex}}\text{in.,}\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}z=1\phantom{\rule{0.2em}{0ex}}\text{in}.

\frac{dA}{dt}=12\phantom{\rule{0.2em}{0ex}}\text{in}{.}^{2}\text{/}\text{min}

The total resistance in a circuit that has three individual resistances represented by x,y, and z is given by the formula R\left(x,y,z\right)=\frac{xyz}{yz+xz+xy}. Suppose at a given time the x resistance is 100\text{Ω}, the y resistance is 200\text{Ω}, and the z resistance is 300\text{Ω}. Also, suppose the x resistance is changing at a rate of 2\text{Ω}\text{/}\text{min}, the y resistance is changing at the rate of 1\text{Ω}\text{/}\text{min}, and the z resistance has no change. Find the rate of change of the total resistance in this circuit at this time.

The temperature T at a point \left(x,y\right) is T\left(x,y\right) and is measured using the Celsius scale. A fly crawls so that its position after t seconds is given by x=\sqrt{1+t} and y=2+\frac{1}{3}t, where x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y are measured in centimeters. The temperature function satisfies {T}_{x}\left(2,3\right)=4 and {T}_{y}\left(2,3\right)=3. How fast is the temperature increasing on the fly’s path after 3 sec?

2\text{°}\text{C/sec}

The x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y components of a fluid moving in two dimensions are given by the following functions: u\left(x,y\right)=2y and v\left(x,y\right)=-2x; x\ge 0;y\ge 0. The speed of the fluid at the point \left(x,y\right) is s\left(x,y\right)=\sqrt{u{\left(x,y\right)}^{2}+v{\left(x,y\right)}^{2}}. Find \frac{\partial s}{\partial x} and \frac{\partial s}{\partial y} using the chain rule.

Let u=u\left(x,y,z\right), where x=x\left(w,t\right),y=y\left(w,t\right),z=z\left(w,t\right),w=w\left(r,s\right),\text{and}\phantom{\rule{0.2em}{0ex}}t=t\left(r,s\right). Use a tree diagram and the chain rule to find an expression for \frac{\partial u}{\partial r}.

\begin{array}{cc}\frac{\partial u}{\partial r}\hfill & =\frac{\partial u}{\partial x}\left(\frac{\partial x}{\partial w}\phantom{\rule{0.2em}{0ex}}\frac{\partial w}{\partial r}+\frac{\partial x}{\partial t}\phantom{\rule{0.2em}{0ex}}\frac{\partial t}{\partial r}\right)+\frac{\partial u}{\partial y}\left(\frac{\partial y}{\partial w}\phantom{\rule{0.2em}{0ex}}\frac{\partial w}{\partial r}+\frac{\partial y}{\partial t}\phantom{\rule{0.2em}{0ex}}\frac{\partial t}{\partial r}\right)\hfill \\ & \phantom{\rule{0.5em}{0ex}}+\frac{\partial u}{\partial z}\left(\frac{\partial z}{\partial w}\phantom{\rule{0.2em}{0ex}}\frac{\partial w}{\partial r}+\frac{\partial z}{\partial t}\phantom{\rule{0.2em}{0ex}}\frac{\partial t}{\partial r}\right)\hfill \end{array}

Glossary

generalized chain rule
the chain rule extended to functions of more than one independent variable, in which each independent variable may depend on one or more other variables
intermediate variable
given a composition of functions (e.g., f\left(x\left(t\right),y\left(t\right)\right)\right), the intermediate variables are the variables that are independent in the outer function but dependent on other variables as well; in the function f\left(x\left(t\right),y\left(t\right)\right), the variables x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y are examples of intermediate variables
tree diagram
illustrates and derives formulas for the generalized chain rule, in which each independent variable is accounted for

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Calculus Volume 3 by OSCRiceUniversity is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book