{"id":616,"date":"2025-10-09T15:25:28","date_gmt":"2025-10-09T15:25:28","guid":{"rendered":"https:\/\/content.one.lumenlearning.com\/calculus3\/?post_type=chapter&#038;p=616"},"modified":"2025-10-27T20:21:31","modified_gmt":"2025-10-27T20:21:31","slug":"the-chain-rule-learn-it-1","status":"publish","type":"chapter","link":"https:\/\/content.one.lumenlearning.com\/calculus3\/chapter\/the-chain-rule-learn-it-1\/","title":{"raw":"The Chain Rule: Learn It 1","rendered":"The Chain Rule: Learn It 1"},"content":{"raw":"<section class=\"textbox learningGoals\" aria-label=\"Learning Goals\">\r\n<ul>\r\n \t<li>Use the chain rule when you have one independent variable<\/li>\r\n \t<li>Apply the chain rule with multiple changing variables<\/li>\r\n \t<li>Find derivatives implicitly when working with functions of multiple variables<\/li>\r\n<\/ul>\r\n<\/section>\r\n<h2 data-type=\"title\">Chain Rules for One or Two Independent Variables<\/h2>\r\n<p class=\"whitespace-normal break-words\">In single-variable calculus, the chain rule was one of the most useful differentiation rules. It allowed us to find the derivative of the composition of two functions. The same thing is true for multivariable calculus, but now we have to deal with more than one form of the chain rule.<\/p>\r\n\r\n<section class=\"textbox recall\" aria-label=\"Recall\">\r\n<p class=\"whitespace-normal break-words\"><strong>Chain Rule for Single-Variable Functions<\/strong><\/p>\r\n<p class=\"whitespace-normal break-words\">For the derivative of a composite of two functions:<\/p>\r\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]\\frac{d}{dx}(f(g(x)))=f'(g(x))g'(x)[\/latex]<\/p>\r\n<p class=\"whitespace-pre-wrap break-words\">where both [latex]f(x)[\/latex] and [latex]g(x)[\/latex] are functions of one variable.<\/p>\r\n\r\n<\/section>\r\n<p class=\"whitespace-normal break-words\">In the above equation, both [latex]f(x)[\/latex] and [latex]g(x)[\/latex] are functions of one variable. What happens when [latex]f[\/latex] is a function of two variables and [latex]g[\/latex] is a function of one variable? Or when they're both functions of two variables? The following theorem gives us the answer when we have one independent variable.<\/p>\r\n\r\n<section class=\"textbox keyTakeaway\" aria-label=\"Key Takeaway\">\r\n<h3>chain rule for one independent variable<\/h3>\r\n<p id=\"fs-id1167794143923\">Suppose that <span style=\"white-space: nowrap;\">[latex]x=g(t)[\/latex]\u00a0<\/span>and [latex]y=h(t)[\/latex] are differentiable functions of [latex]t[\/latex] and [latex]z=f(x, y)[\/latex] is a differentiable function of [latex]x[\/latex] and [latex]y[\/latex]. Then [latex]z=f(x(t), y(t))[\/latex] is a differentiable function of [latex]t[\/latex] and<\/p>\r\n<p style=\"text-align: center;\">[latex]\\dfrac{dz}{dt}=\\dfrac{\\partial{z}}{\\partial{x}}\\cdot\\dfrac{dx}{dt}+\\dfrac{\\partial{z}}{\\partial{y}}\\cdot\\dfrac{dy}{dt},[\/latex]<\/p>\r\nwhere the ordinary derivatives are evaluated at [latex]t[\/latex] and the partial derivatives are evaluated at [latex](x, y)[\/latex].\r\n\r\n<\/section><section class=\"textbox connectIt\">\r\n<p style=\"text-align: center;\"><strong>Proof<\/strong><\/p>\r\n\r\n\r\n<hr \/>\r\n<p id=\"fs-id1167793901389\">The proof of this theorem uses the definition of differentiability of a function of two variables. Suppose that [latex]f[\/latex] is differentiable at the point\u00a0[latex]P(x_0, y_0)[\/latex], where [latex]x_0=g(t_0)[\/latex] and [latex]y_0=h(t_0)[\/latex] for a fixed value of [latex]t_0[\/latex]. We wish to prove that [latex]z=f(x(t), y(t))[\/latex] is differentiable at [latex]t=t_0[\/latex] and that\u00a0the Chain Rule for One Independent Variable\u00a0holds at that point as well.<\/p>\r\n<p id=\"fs-id1167793264165\">Since [latex]f[\/latex] is differentiable at [latex]P[\/latex], we know that<\/p>\r\n<p style=\"text-align: center;\">[latex]\\large{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)},[\/latex]<\/p>\r\nwhere [latex]\\displaystyle{\\lim_{(x,y)\\to(x_0,y_0)}}\\frac{E(x,y)}{\\sqrt{(x-x_0)^2+(y-y_0)^2}}=0[\/latex]. We then subtract\u00a0[latex]z_0=f(x_0,y_0)[\/latex] from both sides of this equation:\r\n<p style=\"text-align: center;\">[latex]\\begin{alignat}{2}\r\nz(t)-z(t_0) &amp;= f(x(t),y(t))-f(x(t_0),y(t_0)) \\\\\r\n&amp;= 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)). \\\\\r\n\\end{alignat}[\/latex]<\/p>\r\nNext, we divide both sides by\u00a0[latex]t-t_0[\/latex]:\r\n<p style=\"text-align: center;\">[latex]\\frac{z(t)-z(t_0)}{t-t_0}=f_x(x_0,y_0)\\left(\\frac{x(t)-x(t_0)}{t-t_0}\\right)+f_y(x_0,y_0)\\left(\\frac{y(t)-y(t_0)}{t-t_0}\\right)+\\frac{E(x(t),y(t))}{t-t_0}.[\/latex]<\/p>\r\nThen we take the limit as\u00a0[latex]t[\/latex] approaches\u00a0[latex]t_0[\/latex]:\r\n<p style=\"text-align: center;\">[latex]\\displaystyle\\lim_{t\\to t_0}\\frac{z(t)-z(t_0)}{t-t_0} = f_x(x_0,y_0)\\displaystyle\\lim_{t\\to t_0}\\left(\\frac{x(t)-x(t_)}{t-t_0}\\right)+f_y(x_0,y_0)\\displaystyle\\lim_{t\\to t_0}\\left(\\frac{y(t)-y(t_0)}{t-t_0}\\right)+ \\displaystyle\\lim_{t\\to t_0}\\frac{E(x(t),y(t))}{t-t_0}.[\/latex]<\/p>\r\nThe left-hand side of this equation is equal to\u00a0[latex]dz\/dt[\/latex], which leads to\r\n<p style=\"text-align: center;\">[latex]\\frac{dz}{dt}=f_x(x_0,y_0)\\frac{dx}{dt}+f_y(x_0,y_0)\\frac{dy}{dt}+\\displaystyle\\lim_{t\\to t_0}\\frac{E(x(t),y(t))}{t-t_0}.[\/latex]<\/p>\r\nThe last term can be rewritten as\r\n<p style=\"text-align: center;\">[latex]\\begin{alignat}{2}\r\n\\displaystyle\\lim_{t\\to t_0}\\frac{E(x(t),y(t))}{t-t_0} &amp;= \\displaystyle\\lim_{t\\to t_0}\\left(\\frac{E(x,y)}{\\sqrt{(x-x_0)^2+(y-y_0)^2}}\\frac{\\sqrt{(x-x_0)^2+(y-y_0)^2}}{t-t_0}\\right) \\\\\r\n&amp;= \\displaystyle\\lim_{t\\to t_0}\\left(\\frac{E(x,y)}{\\sqrt{(x-x_0)^2+(y-y_0)^2}}\\right)\\displaystyle\\lim_{t\\to t_0}\\left(\\frac{\\sqrt{(x-x_0)^2+(y-y_0)^2}}{t-t_0}\\right). \\\\\r\n\\end{alignat}[\/latex]<\/p>\r\nAs [latex]t[\/latex] approaches [latex]t_0, (x(t), y(t))[\/latex] approaches [latex](x(t_0), y(t_0))[\/latex], so we can rewrite the last product as\r\n<p style=\"text-align: center;\">[latex]\\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\frac{E(x,y)}{\\sqrt{(x-x_0)^2+(y-y_0)^2}}\\right)\\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\frac{\\sqrt{(x-x_0)^2+(y-y_0)^2}}{t-t_0}\\right)[\/latex]<\/p>\r\nSince the first limit is equal to zero, we need only show that the second limit is finite:\r\n<p style=\"text-align: center;\">[latex]\\begin{alignat}{2}\r\n\\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\frac{\\sqrt{(x-x_0)^2+(y-y_0)^2}}{t-t_0}\\right) &amp;= \\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\sqrt{\\frac{(x-x_0)^2+(y-y_0)^2}{(t-t_0)^2}}\\right) \\\\\r\n&amp;= \\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\sqrt{\\left(\\frac{x-x_0}{t-t_0}\\right)^2+\\left(\\frac{y-y_0}{t-t_0}\\right)^2}\\right) \\\\\r\n&amp;= \\sqrt{\\left(\\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\frac{x-x_0}{t-t_0}\\right)\\right)^2+\\left( \\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\frac{y-y_0}{t-t_0}\\right)\\right)^2}.\r\n\\end{alignat}[\/latex]<\/p>\r\nSince [latex]x(t)[\/latex] and [latex]y(t)[\/latex] are both differentiable functions of [latex]t[\/latex], both limits inside the last radical exist. Therefore, this value is finite. This proves the chain rule at [latex]t=t_0[\/latex]; the rest of the theorem follows from the assumption that all functions are differentiable over their entire domains.\r\n\r\n[latex]_\\blacksquare[\/latex]\r\n\r\n<\/section>\r\n<p class=\"whitespace-normal break-words\">Look closely at this chain rule. The first term is [latex]\\frac{\\partial z}{\\partial x}\\cdot\\frac{dx}{dt}[\/latex] and the second term is [latex]\\frac{\\partial z}{\\partial y}\\cdot\\frac{dy}{dt}[\/latex]. If we treat these derivatives like fractions, each product \"simplifies\"\u2014the [latex]x[\/latex] in the first term appears to cancel, as does the [latex]y[\/latex] in the second term.<\/p>\r\n<p class=\"whitespace-normal break-words\">The variables [latex]x[\/latex] and [latex]y[\/latex] are called <strong>intermediate variables<\/strong> because they're independent variables for [latex]f[\/latex], but dependent variables for [latex]t[\/latex]. Notice that we have two terms on the right side, and [latex]f[\/latex] is a function of two variables. This pattern holds for functions with more variables too.<\/p>\r\n\r\n<section class=\"textbox proTip\" aria-label=\"Pro Tip\">The number of terms in the chain rule equals the number of intermediate variables. Each term corresponds to one path through the variables from [latex]z[\/latex] to [latex]t[\/latex].\r\n\r\n<\/section><section class=\"textbox example\" aria-label=\"Example\">Calculate [latex]dz\/dt[\/latex] for each of the following functions:\r\n<p style=\"padding-left: 30px;\">a. [latex]z=f(x,y)=4x^2+3y^2, x=x(t)=\\sin{t},y=y(t)=\\cos{t}[\/latex]<\/p>\r\n<p style=\"padding-left: 30px;\">b.\u00a0[latex]z=f(x,y)=\\sqrt{x^2-y^2},x=x(t)=e^{2t},y=y(t)=e^{-t}[\/latex]<\/p>\r\n[reveal-answer q=\"761249035\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"761249035\"]\r\n\r\na. To use the chain rule, we need four quantities\u2014[latex]\\partial z\/\\partial x, \\partial z\/\\partial y, dx\/dt,[\/latex] and [latex]dy\/dt[\/latex]:\r\n\r\n[latex]\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{\\partial z}{\\partial x} &amp;= 8x &amp;\\quad &amp;\\quad \\frac{\\partial z}{\\partial y} &amp;= 6y \\\\\r\n\r\n\\frac{dx}{dt}&amp;=\\cos{t} &amp;\\quad &amp;\\quad \\frac{dy}{dt}&amp;=-\\sin{t}.\r\n\r\n\\end{alignat}[\/latex]\r\n\r\nNow, we substitute each of these into\u00a0the Chain Rule for One Independent Variable:\r\n\r\n[latex]\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{dz}{dt} &amp;=\\frac{\\partial z}{\\partial x}\\cdot\\frac{dx}{dt}+\\frac{\\partial z}{\\partial y}\\cdot\\frac{dy}{dt} \\\\\r\n\r\n&amp;=(8x)(\\cos{t})+(6y)(-\\sin{t}) \\\\\r\n\r\n&amp;= 8x\\cos{t}-6y\\sin{t}.\r\n\r\n\\end{alignat}[\/latex]\r\n\r\nThis answer has three variables in it. To reduce it to one variable, use the fact that [latex]x(t)=\\sin t[\/latex] and [latex]y(t)=\\cos t[\/latex]. We obtain\r\n\r\n[latex]\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{dz}{dt} &amp;=8x\\cos{t}-6y\\sin{t} \\\\\r\n\r\n&amp;=8(\\sin t)\\cos t - 6(\\cos t)\\sin t \\\\\r\n\r\n&amp;= 2\\sin t\\cos t.\r\n\r\n\\end{alignat}[\/latex]\r\n\r\nThis derivative can also be calculated by first substituting [latex]x(t)[\/latex] and [latex]y(t)[\/latex] into [latex]f(x, y)[\/latex], then differentiating with respect to [latex]t[\/latex]:\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\nz &amp;=f(x,y) \\\\\r\n\r\n&amp;=f(x(t),y(t)) \\\\\r\n\r\n&amp;= 4(x(t))^2+3(y(t))^2 \\\\\r\n\r\n&amp;=4\\sin^2t+3\\cos^2t.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nThen\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{dz}{dt} &amp;=2(4\\sin t)(\\cos t)+2(3\\cos t)(-\\sin t) \\\\\r\n\r\n&amp;=8\\sin t\\cos t-6\\sin t\\cos t \\\\\r\n\r\n&amp;=2\\sin t\\cos t,\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nwhich\u00a0is the same solution. However, it may not always be this easy to differentiate in this form.\r\n\r\nb.\u00a0To use the chain rule, we again need four quantities\u2014[latex]\\partial z\/\\partial x, \\partial z\/\\partial y, dx\/dt,[\/latex], and [latex]dy\/dt[\/latex]:\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{\\partial z}{\\partial x} &amp;= \\frac{x}{\\sqrt{x^2-y^2}} &amp;\\quad &amp;\\quad \\frac{\\partial z}{\\partial y} &amp;= \\frac{-y}{\\sqrt{x^2-y^2}} \\\\\r\n\r\n\\frac{dx}{dt}&amp;=2e^{2t} &amp;\\quad &amp;\\quad \\frac{dy}{dt}&amp;=-e^{-t}{t}.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nWe substitute each of these into\u00a0the Chain Rule for One Independent Variable:\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{dz}{dt} &amp;=\\frac{\\partial z}{\\partial x}\\cdot\\frac{dx}{dt}+\\frac{\\partial z}{\\partial y}\\cdot\\frac{dy}{dt} \\\\\r\n\r\n&amp;=\\left(\\frac{x}{\\sqrt{x^2-y^2}}\\right)(2e^{2t})+\\left(\\frac{-y}{\\sqrt{x^2-y^2}}\\right)(-e^{-t}) \\\\\r\n\r\n&amp;= \\frac{2xe^{2t}-ye^{-t}}{\\sqrt{x^2-y^2}}.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nTo reduce this to one variable, we use the fact that [latex]x(t)=e^{2t}[\/latex] and [latex]y(t)=e^{-1}[\/latex]. Therefore,\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{dz}{dt} &amp;=\\frac{2xe^{2t}-ye^{-t}}{\\sqrt{x^2-y^2}} \\\\\r\n\r\n&amp;=\\frac{2(e^{2t})e^{2t}+(e^{-t})e^{-t}}{\\sqrt{e^{4t}-e^{-2t}}} \\\\\r\n\r\n&amp;=\\frac{2e^{4t}+e^{-2t}}{\\sqrt{e^{4t}-e^{-2t}}}.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nTo eliminate negative exponents, we multiply the top by [latex]e^{2t}[\/latex] and the bottom by [latex]\\sqrt{e^{4t}}[\/latex]:\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{dz}{dt} &amp;=\\frac{2e^{4t}+e^{-2t}}{\\sqrt{e^{4t}-e^{-2t}}}\\cdot\\frac{e^{2t}}{\\sqrt{e^{4t}}} \\\\\r\n\r\n&amp;=\\frac{2e^{6t}+1}{\\sqrt{e^{8t}-e^{2t}}} \\\\\r\n\r\n&amp;=\\frac{2e^{6t}+1}{\\sqrt{e^{2t}(e^{6t}-1)}} \\\\\r\n\r\n&amp;=\\frac{2e^{6t}+1}{e^t\\sqrt{e^{6t}-1}}.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nAgain, this derivative can also be calculated by first substituting [latex]x(t)[\/latex] and [latex]y(t)[\/latex] into [latex]f(x, y)[\/latex], then differentiating with respect to [latex]t[\/latex]:\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\nz &amp;=f(x,y) \\\\\r\n\r\n&amp;=f(x(t),y(t))\\\\\r\n\r\n&amp;=\\sqrt{(x(t))^2-(y(t))^2} \\\\\r\n\r\n&amp;=\\sqrt{e^{4t}-e^{-2t}} \\\\\r\n\r\n&amp;=(e^{4t}-e^{-2t})^{1\/2}.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nThen\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{dz}{dt} &amp;=\\frac12(e^{4t}-e^{-2t})^{-1\/2}(4e^{4t}+2e^{-2t}) \\\\\r\n\r\n&amp;=\\frac{2e^{4t}+e^{-2t}}{\\sqrt{e^{4t}-e^{-2t}}}.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nThis is the same solution.\r\n\r\n[\/hidden-answer]\r\n\r\n<\/section>\r\n<h3>Tree Diagrams for the Chain Rule<\/h3>\r\nA visual representation of the chain rule can be helpful. We use a <strong>tree diagram<\/strong> to remember the formula (Figure 1).\r\n\r\n[caption id=\"attachment_1244\" align=\"aligncenter\" width=\"455\"]<img class=\"size-full wp-image-1244\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/22221516\/4-5-1.jpeg\" alt=\"A diagram that starts with z = f(x, y). Along the first branch, it is written \u2202z\/\u2202x, then x = x(t), then dx\/dt, then t, and finally it says \u2202z\/\u2202x dx\/dt. Along the other branch, it is written \u2202z\/\u2202y, then y = y(t), then dy\/dt, then t, and finally it says \u2202z\/\u2202y dy\/dt.\" width=\"455\" height=\"291\" \/> Figure 1. Tree diagram for the case\u00a0[latex]\\small{\\dfrac{dz}{dt}=\\dfrac{\\partial z}{\\partial x}\\cdot\\dfrac{dx}{dt}+\\dfrac{\\partial z}{\\partial y}\\cdot\\dfrac{dy}{dt}}[\/latex].[\/caption]\r\n<p class=\"whitespace-normal break-words\">In this diagram, the leftmost corner represents [latex]z=f(x,y)[\/latex]. Since [latex]f[\/latex] has two independent variables, two lines come from this corner. The upper branch corresponds to [latex]x[\/latex] and the lower branch corresponds to [latex]y[\/latex].<\/p>\r\n<p class=\"whitespace-normal break-words\">Since both variables depend on [latex]t[\/latex], one branch comes from [latex]x[\/latex] and one from [latex]y[\/latex]. Each branch on the far right shows the path traveled to reach it. The top branch follows [latex]x[\/latex] then [latex]t[\/latex], so it's labeled [latex]\\frac{\\partial z}{\\partial x}\\times\\frac{dx}{dt}[\/latex]. The bottom branch follows [latex]y[\/latex] then [latex]t[\/latex], labeled [latex]\\frac{\\partial z}{\\partial y}\\times\\frac{dy}{dt}[\/latex].<\/p>\r\n<p class=\"whitespace-normal break-words\">To get [latex]\\frac{dz}{dt}[\/latex], add all the terms on the rightmost side of the diagram.<\/p>\r\n\r\n<h3 class=\"text-xl font-bold text-text-100 mt-1 -mb-0.5\">Chain Rule for Two Independent Variables<\/h3>\r\n<p class=\"whitespace-normal break-words\">Now suppose [latex]z=f(x,y)[\/latex] is a function of [latex]x[\/latex] and [latex]y[\/latex], and both [latex]x=g(u,v)[\/latex] and [latex]y=h(u,v)[\/latex] are functions of [latex]u[\/latex] and [latex]v[\/latex].<\/p>\r\n\r\n<section class=\"textbox keyTakeaway\" aria-label=\"Key Takeaway\">\r\n<h3>chain rule for two independent variables<\/h3>\r\n<p id=\"fs-id1167793956651\">Suppose [latex]x=g(u, v)[\/latex] and [latex]y=h(u, v)[\/latex] are differentiable functions of [latex]u[\/latex] and [latex]v[\/latex], and [latex]z=f(x, y)[\/latex] is a differentiable function of\u00a0[latex]x[\/latex] and [latex]y[\/latex]. Then, [latex]z=f(g(u, v), h(u, v))[\/latex] is a differentiable function of\u00a0[latex]u[\/latex] and\u00a0[latex]v[\/latex], and<\/p>\r\n<p style=\"text-align: center;\">[latex]\\dfrac{\\partial z}{\\partial u}=\\dfrac{\\partial z}{\\partial x}\\dfrac{\\partial x}{\\partial u}+\\dfrac{\\partial z}{\\partial y}\\dfrac{\\partial y}{\\partial u}[\/latex]<\/p>\r\nand\r\n<p style=\"text-align: center;\">[latex]\\dfrac{\\partial x}{\\partial v}=\\dfrac{\\partial z}{\\partial x}\\dfrac{\\partial x}{\\partial v}+\\dfrac{\\partial z}{\\partial y}\\dfrac{\\partial y}{\\partial v}[\/latex]<\/p>\r\n\r\n<\/section>\r\n<div>\r\n<p class=\"whitespace-normal break-words\">We can draw a tree diagram for each of these formulas as well.<\/p>\r\n\r\n<\/div>\r\n<div><\/div>\r\n<div>[caption id=\"attachment_1247\" align=\"aligncenter\" width=\"428\"]<img class=\"size-full wp-image-1247\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/22221655\/4-5-2.jpeg\" alt=\"A diagram that starts with z = f(x, y). Along the first branch, it is written \u2202z\/\u2202x, then x = g(u, v), at which point it breaks into another two branches: the first subbranch says \u2202x\/\u2202u, then u, and finally it says \u2202z\/\u2202x \u2202x\/\u2202u; the second subbranch says \u2202x\/\u2202v, then v, and finally it says \u2202z\/\u2202x \u2202x\/\u2202v. Along the other branch, it is written \u2202z\/\u2202y, then y = h(u, v), at which point it breaks into another two branches: the first subbranch says \u2202y\/\u2202u, then u, and finally it says \u2202z\/\u2202y \u2202y\/\u2202u; the second subbranch says \u2202y\/\u2202v, then v, and finally it says \u2202z\/\u2202y \u2202y\/\u2202v.\" width=\"428\" height=\"336\" \/> Figure 2. Tree diagram for\u00a0[latex]\\small{\\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}}[\/latex] and\u00a0[latex]\\small{\\frac{\\partial x}{\\partial v}=\\frac{\\partial z}{\\partial x}\\frac{\\partial x}{\\partial v}+\\frac{\\partial z}{\\partial y}\\frac{\\partial y}{\\partial v}}.[\/latex][\/caption]<\/div>\r\n<div><\/div>\r\n<div>\r\n<p class=\"whitespace-normal break-words\">To find [latex]\\frac{\\partial z}{\\partial u}[\/latex], start from the left side of the diagram and follow only the branches ending with [latex]u[\/latex]. Add the terms at the end of those branches. For [latex]\\frac{\\partial z}{\\partial v}[\/latex], follow only the branches ending with [latex]v[\/latex].<\/p>\r\n\r\n<section class=\"textbox proTip\" aria-label=\"Pro Tip\">There's an important difference between these two chain rules. In the chain rule for one independent variable, the left side is an ordinary derivative [latex]\\frac{dz}{dt}[\/latex] because [latex]z[\/latex] ultimately depends only on [latex]t[\/latex]. In the chain rule for two independent variables, the left side is a partial derivative [latex]\\frac{\\partial z}{\\partial u}[\/latex] (or [latex]\\frac{\\partial z}{\\partial v}[\/latex]) because [latex]z[\/latex] depends on both [latex]u[\/latex] and [latex]v[\/latex].\r\n\r\n<\/section><section class=\"textbox example\" aria-label=\"Example\">Calculate [latex]\\partial z\/\\partial u[\/latex] and [latex]\\partial z\/\\partial v[\/latex] using the following functions:\r\n<p style=\"text-align: center;\">[latex]z=f(x,y)=3x^2-2xy+y^2,x=x(u,v)=3u+2v,y=y(u,v)=4u-v[\/latex]<\/p>\r\n[reveal-answer q=\"977241165\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"977241165\"]\r\n\r\nTo implement the chain rule for two variables, we need six partial derivatives\u2014[latex]\\partial z\/\\partial x, \\partial z\/\\partial y, \\partial x\/\\partial u, \\partial x\/\\partial v, \\partial y\/\\partial u,[\/latex], and\u00a0[latex]\\partial y\/\\partial v[\/latex]:\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{\\partial z}{\\partial x} &amp;= 6x-2y &amp;\\quad &amp;\\quad \\frac{\\partial z}{\\partial y} &amp;= -2x+2y \\\\\r\n\r\n\\frac{\\partial x}{\\partial u} &amp;= 3 &amp;\\quad &amp;\\quad \\frac{\\partial x}{\\partial v}&amp;=2 \\\\\r\n\r\n\\frac{\\partial y}{\\partial u}&amp;= 4 &amp;\\quad &amp;\\quad \\frac{\\partial y}{\\partial v}&amp;=-1.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nTo find\u00a0[latex]\\partial z\/\\partial u[\/latex],\u00a0we use\u00a0the Chain Rule for Two Independent Variables:\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{\\partial z}{\\partial u} &amp;= \\frac{\\partial z}{\\partial x}\\frac{\\partial x}{\\partial u}+\\frac{\\partial x}{\\partial y}\\frac{\\partial y}{\\partial u} \\\\\r\n\r\n&amp;= 3(6x-2y)+4(-2x+2y) \\\\\r\n\r\n&amp;= 10x+2y.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nNext, we substitute\u00a0[latex]x(u,v)=3u+2v[\/latex] and\u00a0[latex]y(u,v)=4u-v[\/latex]:\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{\\partial z}{\\partial u} &amp;= 10x+2y \\\\\r\n\r\n&amp;= 10(3u+2v)+2(4u-v) \\\\\r\n\r\n&amp;= 38u+18v.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nTo find\u00a0[latex]\\partial z\/\\partial v[\/latex], we use\u00a0the Chain Rule for Two Independent Variables:\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{\\partial z}{\\partial v} &amp;= \\frac{\\partial z}{\\partial x}\\frac{\\partial x}{\\partial v}+\\frac{\\partial x}{\\partial y}\\frac{\\partial y}{\\partial v} \\\\\r\n\r\n&amp;= 2(6x-2y)+(-1)(-2x+2y) \\\\\r\n\r\n&amp;= 14x-6y.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\nThen we substitute [latex]x(u,v)=3u+2v[\/latex] and\u00a0[latex]y(u,v)=4u-v[\/latex]:\r\n\r\n[latex]\r\n\r\n\\hspace{8cm}\\begin{alignat}{2}\r\n\r\n\\frac{\\partial z}{\\partial v} &amp;= 14x-6y \\\\\r\n\r\n&amp;= 14(3u+2v)-6(4u-v) \\\\\r\n\r\n&amp;= 18u+34v.\r\n\r\n\\end{alignat}\r\n\r\n[\/latex]\r\n\r\n[\/hidden-answer]\r\n\r\n<\/section><\/div>","rendered":"<section class=\"textbox learningGoals\" aria-label=\"Learning Goals\">\n<ul>\n<li>Use the chain rule when you have one independent variable<\/li>\n<li>Apply the chain rule with multiple changing variables<\/li>\n<li>Find derivatives implicitly when working with functions of multiple variables<\/li>\n<\/ul>\n<\/section>\n<h2 data-type=\"title\">Chain Rules for One or Two Independent Variables<\/h2>\n<p class=\"whitespace-normal break-words\">In single-variable calculus, the chain rule was one of the most useful differentiation rules. It allowed us to find the derivative of the composition of two functions. The same thing is true for multivariable calculus, but now we have to deal with more than one form of the chain rule.<\/p>\n<section class=\"textbox recall\" aria-label=\"Recall\">\n<p class=\"whitespace-normal break-words\"><strong>Chain Rule for Single-Variable Functions<\/strong><\/p>\n<p class=\"whitespace-normal break-words\">For the derivative of a composite of two functions:<\/p>\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]\\frac{d}{dx}(f(g(x)))=f'(g(x))g'(x)[\/latex]<\/p>\n<p class=\"whitespace-pre-wrap break-words\">where both [latex]f(x)[\/latex] and [latex]g(x)[\/latex] are functions of one variable.<\/p>\n<\/section>\n<p class=\"whitespace-normal break-words\">In the above equation, both [latex]f(x)[\/latex] and [latex]g(x)[\/latex] are functions of one variable. What happens when [latex]f[\/latex] is a function of two variables and [latex]g[\/latex] is a function of one variable? Or when they&#8217;re both functions of two variables? The following theorem gives us the answer when we have one independent variable.<\/p>\n<section class=\"textbox keyTakeaway\" aria-label=\"Key Takeaway\">\n<h3>chain rule for one independent variable<\/h3>\n<p id=\"fs-id1167794143923\">Suppose that <span style=\"white-space: nowrap;\">[latex]x=g(t)[\/latex]\u00a0<\/span>and [latex]y=h(t)[\/latex] are differentiable functions of [latex]t[\/latex] and [latex]z=f(x, y)[\/latex] is a differentiable function of [latex]x[\/latex] and [latex]y[\/latex]. Then [latex]z=f(x(t), y(t))[\/latex] is a differentiable function of [latex]t[\/latex] and<\/p>\n<p style=\"text-align: center;\">[latex]\\dfrac{dz}{dt}=\\dfrac{\\partial{z}}{\\partial{x}}\\cdot\\dfrac{dx}{dt}+\\dfrac{\\partial{z}}{\\partial{y}}\\cdot\\dfrac{dy}{dt},[\/latex]<\/p>\n<p>where the ordinary derivatives are evaluated at [latex]t[\/latex] and the partial derivatives are evaluated at [latex](x, y)[\/latex].<\/p>\n<\/section>\n<section class=\"textbox connectIt\">\n<p style=\"text-align: center;\"><strong>Proof<\/strong><\/p>\n<hr \/>\n<p id=\"fs-id1167793901389\">The proof of this theorem uses the definition of differentiability of a function of two variables. Suppose that [latex]f[\/latex] is differentiable at the point\u00a0[latex]P(x_0, y_0)[\/latex], where [latex]x_0=g(t_0)[\/latex] and [latex]y_0=h(t_0)[\/latex] for a fixed value of [latex]t_0[\/latex]. We wish to prove that [latex]z=f(x(t), y(t))[\/latex] is differentiable at [latex]t=t_0[\/latex] and that\u00a0the Chain Rule for One Independent Variable\u00a0holds at that point as well.<\/p>\n<p id=\"fs-id1167793264165\">Since [latex]f[\/latex] is differentiable at [latex]P[\/latex], we know that<\/p>\n<p style=\"text-align: center;\">[latex]\\large{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)},[\/latex]<\/p>\n<p>where [latex]\\displaystyle{\\lim_{(x,y)\\to(x_0,y_0)}}\\frac{E(x,y)}{\\sqrt{(x-x_0)^2+(y-y_0)^2}}=0[\/latex]. We then subtract\u00a0[latex]z_0=f(x_0,y_0)[\/latex] from both sides of this equation:<\/p>\n<p style=\"text-align: center;\">[latex]\\begin{alignat}{2}  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)). \\\\  \\end{alignat}[\/latex]<\/p>\n<p>Next, we divide both sides by\u00a0[latex]t-t_0[\/latex]:<\/p>\n<p style=\"text-align: center;\">[latex]\\frac{z(t)-z(t_0)}{t-t_0}=f_x(x_0,y_0)\\left(\\frac{x(t)-x(t_0)}{t-t_0}\\right)+f_y(x_0,y_0)\\left(\\frac{y(t)-y(t_0)}{t-t_0}\\right)+\\frac{E(x(t),y(t))}{t-t_0}.[\/latex]<\/p>\n<p>Then we take the limit as\u00a0[latex]t[\/latex] approaches\u00a0[latex]t_0[\/latex]:<\/p>\n<p style=\"text-align: center;\">[latex]\\displaystyle\\lim_{t\\to t_0}\\frac{z(t)-z(t_0)}{t-t_0} = f_x(x_0,y_0)\\displaystyle\\lim_{t\\to t_0}\\left(\\frac{x(t)-x(t_)}{t-t_0}\\right)+f_y(x_0,y_0)\\displaystyle\\lim_{t\\to t_0}\\left(\\frac{y(t)-y(t_0)}{t-t_0}\\right)+ \\displaystyle\\lim_{t\\to t_0}\\frac{E(x(t),y(t))}{t-t_0}.[\/latex]<\/p>\n<p>The left-hand side of this equation is equal to\u00a0[latex]dz\/dt[\/latex], which leads to<\/p>\n<p style=\"text-align: center;\">[latex]\\frac{dz}{dt}=f_x(x_0,y_0)\\frac{dx}{dt}+f_y(x_0,y_0)\\frac{dy}{dt}+\\displaystyle\\lim_{t\\to t_0}\\frac{E(x(t),y(t))}{t-t_0}.[\/latex]<\/p>\n<p>The last term can be rewritten as<\/p>\n<p style=\"text-align: center;\">[latex]\\begin{alignat}{2}  \\displaystyle\\lim_{t\\to t_0}\\frac{E(x(t),y(t))}{t-t_0} &= \\displaystyle\\lim_{t\\to t_0}\\left(\\frac{E(x,y)}{\\sqrt{(x-x_0)^2+(y-y_0)^2}}\\frac{\\sqrt{(x-x_0)^2+(y-y_0)^2}}{t-t_0}\\right) \\\\  &= \\displaystyle\\lim_{t\\to t_0}\\left(\\frac{E(x,y)}{\\sqrt{(x-x_0)^2+(y-y_0)^2}}\\right)\\displaystyle\\lim_{t\\to t_0}\\left(\\frac{\\sqrt{(x-x_0)^2+(y-y_0)^2}}{t-t_0}\\right). \\\\  \\end{alignat}[\/latex]<\/p>\n<p>As [latex]t[\/latex] approaches [latex]t_0, (x(t), y(t))[\/latex] approaches [latex](x(t_0), y(t_0))[\/latex], so we can rewrite the last product as<\/p>\n<p style=\"text-align: center;\">[latex]\\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\frac{E(x,y)}{\\sqrt{(x-x_0)^2+(y-y_0)^2}}\\right)\\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\frac{\\sqrt{(x-x_0)^2+(y-y_0)^2}}{t-t_0}\\right)[\/latex]<\/p>\n<p>Since the first limit is equal to zero, we need only show that the second limit is finite:<\/p>\n<p style=\"text-align: center;\">[latex]\\begin{alignat}{2}  \\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\frac{\\sqrt{(x-x_0)^2+(y-y_0)^2}}{t-t_0}\\right) &= \\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\sqrt{\\frac{(x-x_0)^2+(y-y_0)^2}{(t-t_0)^2}}\\right) \\\\  &= \\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\sqrt{\\left(\\frac{x-x_0}{t-t_0}\\right)^2+\\left(\\frac{y-y_0}{t-t_0}\\right)^2}\\right) \\\\  &= \\sqrt{\\left(\\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\frac{x-x_0}{t-t_0}\\right)\\right)^2+\\left( \\displaystyle\\lim_{(x,y)\\to (x_0,y_0)}\\left(\\frac{y-y_0}{t-t_0}\\right)\\right)^2}.  \\end{alignat}[\/latex]<\/p>\n<p>Since [latex]x(t)[\/latex] and [latex]y(t)[\/latex] are both differentiable functions of [latex]t[\/latex], both limits inside the last radical exist. Therefore, this value is finite. This proves the chain rule at [latex]t=t_0[\/latex]; the rest of the theorem follows from the assumption that all functions are differentiable over their entire domains.<\/p>\n<p>[latex]_\\blacksquare[\/latex]<\/p>\n<\/section>\n<p class=\"whitespace-normal break-words\">Look closely at this chain rule. The first term is [latex]\\frac{\\partial z}{\\partial x}\\cdot\\frac{dx}{dt}[\/latex] and the second term is [latex]\\frac{\\partial z}{\\partial y}\\cdot\\frac{dy}{dt}[\/latex]. If we treat these derivatives like fractions, each product &#8220;simplifies&#8221;\u2014the [latex]x[\/latex] in the first term appears to cancel, as does the [latex]y[\/latex] in the second term.<\/p>\n<p class=\"whitespace-normal break-words\">The variables [latex]x[\/latex] and [latex]y[\/latex] are called <strong>intermediate variables<\/strong> because they&#8217;re independent variables for [latex]f[\/latex], but dependent variables for [latex]t[\/latex]. Notice that we have two terms on the right side, and [latex]f[\/latex] is a function of two variables. This pattern holds for functions with more variables too.<\/p>\n<section class=\"textbox proTip\" aria-label=\"Pro Tip\">The number of terms in the chain rule equals the number of intermediate variables. Each term corresponds to one path through the variables from [latex]z[\/latex] to [latex]t[\/latex].<\/p>\n<\/section>\n<section class=\"textbox example\" aria-label=\"Example\">Calculate [latex]dz\/dt[\/latex] for each of the following functions:<\/p>\n<p style=\"padding-left: 30px;\">a. [latex]z=f(x,y)=4x^2+3y^2, x=x(t)=\\sin{t},y=y(t)=\\cos{t}[\/latex]<\/p>\n<p style=\"padding-left: 30px;\">b.\u00a0[latex]z=f(x,y)=\\sqrt{x^2-y^2},x=x(t)=e^{2t},y=y(t)=e^{-t}[\/latex]<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"q761249035\">Show Solution<\/button><\/p>\n<div id=\"q761249035\" class=\"hidden-answer\" style=\"display: none\">\n<p>a. To use the chain rule, we need four quantities\u2014[latex]\\partial z\/\\partial x, \\partial z\/\\partial y, dx\/dt,[\/latex] and [latex]dy\/dt[\/latex]:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{\\partial z}{\\partial x} &= 8x &\\quad &\\quad \\frac{\\partial z}{\\partial y} &= 6y \\\\    \\frac{dx}{dt}&=\\cos{t} &\\quad &\\quad \\frac{dy}{dt}&=-\\sin{t}.    \\end{alignat}[\/latex]<\/p>\n<p>Now, we substitute each of these into\u00a0the Chain Rule for One Independent Variable:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{dz}{dt} &=\\frac{\\partial z}{\\partial x}\\cdot\\frac{dx}{dt}+\\frac{\\partial z}{\\partial y}\\cdot\\frac{dy}{dt} \\\\    &=(8x)(\\cos{t})+(6y)(-\\sin{t}) \\\\    &= 8x\\cos{t}-6y\\sin{t}.    \\end{alignat}[\/latex]<\/p>\n<p>This answer has three variables in it. To reduce it to one variable, use the fact that [latex]x(t)=\\sin t[\/latex] and [latex]y(t)=\\cos t[\/latex]. We obtain<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{dz}{dt} &=8x\\cos{t}-6y\\sin{t} \\\\    &=8(\\sin t)\\cos t - 6(\\cos t)\\sin t \\\\    &= 2\\sin t\\cos t.    \\end{alignat}[\/latex]<\/p>\n<p>This derivative can also be calculated by first substituting [latex]x(t)[\/latex] and [latex]y(t)[\/latex] into [latex]f(x, y)[\/latex], then differentiating with respect to [latex]t[\/latex]:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    z &=f(x,y) \\\\    &=f(x(t),y(t)) \\\\    &= 4(x(t))^2+3(y(t))^2 \\\\    &=4\\sin^2t+3\\cos^2t.    \\end{alignat}[\/latex]<\/p>\n<p>Then<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{dz}{dt} &=2(4\\sin t)(\\cos t)+2(3\\cos t)(-\\sin t) \\\\    &=8\\sin t\\cos t-6\\sin t\\cos t \\\\    &=2\\sin t\\cos t,    \\end{alignat}[\/latex]<\/p>\n<p>which\u00a0is the same solution. However, it may not always be this easy to differentiate in this form.<\/p>\n<p>b.\u00a0To use the chain rule, we again need four quantities\u2014[latex]\\partial z\/\\partial x, \\partial z\/\\partial y, dx\/dt,[\/latex], and [latex]dy\/dt[\/latex]:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{\\partial z}{\\partial x} &= \\frac{x}{\\sqrt{x^2-y^2}} &\\quad &\\quad \\frac{\\partial z}{\\partial y} &= \\frac{-y}{\\sqrt{x^2-y^2}} \\\\    \\frac{dx}{dt}&=2e^{2t} &\\quad &\\quad \\frac{dy}{dt}&=-e^{-t}{t}.    \\end{alignat}[\/latex]<\/p>\n<p>We substitute each of these into\u00a0the Chain Rule for One Independent Variable:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{dz}{dt} &=\\frac{\\partial z}{\\partial x}\\cdot\\frac{dx}{dt}+\\frac{\\partial z}{\\partial y}\\cdot\\frac{dy}{dt} \\\\    &=\\left(\\frac{x}{\\sqrt{x^2-y^2}}\\right)(2e^{2t})+\\left(\\frac{-y}{\\sqrt{x^2-y^2}}\\right)(-e^{-t}) \\\\    &= \\frac{2xe^{2t}-ye^{-t}}{\\sqrt{x^2-y^2}}.    \\end{alignat}[\/latex]<\/p>\n<p>To reduce this to one variable, we use the fact that [latex]x(t)=e^{2t}[\/latex] and [latex]y(t)=e^{-1}[\/latex]. Therefore,<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{dz}{dt} &=\\frac{2xe^{2t}-ye^{-t}}{\\sqrt{x^2-y^2}} \\\\    &=\\frac{2(e^{2t})e^{2t}+(e^{-t})e^{-t}}{\\sqrt{e^{4t}-e^{-2t}}} \\\\    &=\\frac{2e^{4t}+e^{-2t}}{\\sqrt{e^{4t}-e^{-2t}}}.    \\end{alignat}[\/latex]<\/p>\n<p>To eliminate negative exponents, we multiply the top by [latex]e^{2t}[\/latex] and the bottom by [latex]\\sqrt{e^{4t}}[\/latex]:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{dz}{dt} &=\\frac{2e^{4t}+e^{-2t}}{\\sqrt{e^{4t}-e^{-2t}}}\\cdot\\frac{e^{2t}}{\\sqrt{e^{4t}}} \\\\    &=\\frac{2e^{6t}+1}{\\sqrt{e^{8t}-e^{2t}}} \\\\    &=\\frac{2e^{6t}+1}{\\sqrt{e^{2t}(e^{6t}-1)}} \\\\    &=\\frac{2e^{6t}+1}{e^t\\sqrt{e^{6t}-1}}.    \\end{alignat}[\/latex]<\/p>\n<p>Again, this derivative can also be calculated by first substituting [latex]x(t)[\/latex] and [latex]y(t)[\/latex] into [latex]f(x, y)[\/latex], then differentiating with respect to [latex]t[\/latex]:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    z &=f(x,y) \\\\    &=f(x(t),y(t))\\\\    &=\\sqrt{(x(t))^2-(y(t))^2} \\\\    &=\\sqrt{e^{4t}-e^{-2t}} \\\\    &=(e^{4t}-e^{-2t})^{1\/2}.    \\end{alignat}[\/latex]<\/p>\n<p>Then<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{dz}{dt} &=\\frac12(e^{4t}-e^{-2t})^{-1\/2}(4e^{4t}+2e^{-2t}) \\\\    &=\\frac{2e^{4t}+e^{-2t}}{\\sqrt{e^{4t}-e^{-2t}}}.    \\end{alignat}[\/latex]<\/p>\n<p>This is the same solution.<\/p>\n<\/div>\n<\/div>\n<\/section>\n<h3>Tree Diagrams for the Chain Rule<\/h3>\n<p>A visual representation of the chain rule can be helpful. We use a <strong>tree diagram<\/strong> to remember the formula (Figure 1).<\/p>\n<figure id=\"attachment_1244\" aria-describedby=\"caption-attachment-1244\" style=\"width: 455px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1244\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/22221516\/4-5-1.jpeg\" alt=\"A diagram that starts with z = f(x, y). Along the first branch, it is written \u2202z\/\u2202x, then x = x(t), then dx\/dt, then t, and finally it says \u2202z\/\u2202x dx\/dt. Along the other branch, it is written \u2202z\/\u2202y, then y = y(t), then dy\/dt, then t, and finally it says \u2202z\/\u2202y dy\/dt.\" width=\"455\" height=\"291\" \/><figcaption id=\"caption-attachment-1244\" class=\"wp-caption-text\">Figure 1. Tree diagram for the case\u00a0[latex]\\small{\\dfrac{dz}{dt}=\\dfrac{\\partial z}{\\partial x}\\cdot\\dfrac{dx}{dt}+\\dfrac{\\partial z}{\\partial y}\\cdot\\dfrac{dy}{dt}}[\/latex].<\/figcaption><\/figure>\n<p class=\"whitespace-normal break-words\">In this diagram, the leftmost corner represents [latex]z=f(x,y)[\/latex]. Since [latex]f[\/latex] has two independent variables, two lines come from this corner. The upper branch corresponds to [latex]x[\/latex] and the lower branch corresponds to [latex]y[\/latex].<\/p>\n<p class=\"whitespace-normal break-words\">Since both variables depend on [latex]t[\/latex], one branch comes from [latex]x[\/latex] and one from [latex]y[\/latex]. Each branch on the far right shows the path traveled to reach it. The top branch follows [latex]x[\/latex] then [latex]t[\/latex], so it&#8217;s labeled [latex]\\frac{\\partial z}{\\partial x}\\times\\frac{dx}{dt}[\/latex]. The bottom branch follows [latex]y[\/latex] then [latex]t[\/latex], labeled [latex]\\frac{\\partial z}{\\partial y}\\times\\frac{dy}{dt}[\/latex].<\/p>\n<p class=\"whitespace-normal break-words\">To get [latex]\\frac{dz}{dt}[\/latex], add all the terms on the rightmost side of the diagram.<\/p>\n<h3 class=\"text-xl font-bold text-text-100 mt-1 -mb-0.5\">Chain Rule for Two Independent Variables<\/h3>\n<p class=\"whitespace-normal break-words\">Now suppose [latex]z=f(x,y)[\/latex] is a function of [latex]x[\/latex] and [latex]y[\/latex], and both [latex]x=g(u,v)[\/latex] and [latex]y=h(u,v)[\/latex] are functions of [latex]u[\/latex] and [latex]v[\/latex].<\/p>\n<section class=\"textbox keyTakeaway\" aria-label=\"Key Takeaway\">\n<h3>chain rule for two independent variables<\/h3>\n<p id=\"fs-id1167793956651\">Suppose [latex]x=g(u, v)[\/latex] and [latex]y=h(u, v)[\/latex] are differentiable functions of [latex]u[\/latex] and [latex]v[\/latex], and [latex]z=f(x, y)[\/latex] is a differentiable function of\u00a0[latex]x[\/latex] and [latex]y[\/latex]. Then, [latex]z=f(g(u, v), h(u, v))[\/latex] is a differentiable function of\u00a0[latex]u[\/latex] and\u00a0[latex]v[\/latex], and<\/p>\n<p style=\"text-align: center;\">[latex]\\dfrac{\\partial z}{\\partial u}=\\dfrac{\\partial z}{\\partial x}\\dfrac{\\partial x}{\\partial u}+\\dfrac{\\partial z}{\\partial y}\\dfrac{\\partial y}{\\partial u}[\/latex]<\/p>\n<p>and<\/p>\n<p style=\"text-align: center;\">[latex]\\dfrac{\\partial x}{\\partial v}=\\dfrac{\\partial z}{\\partial x}\\dfrac{\\partial x}{\\partial v}+\\dfrac{\\partial z}{\\partial y}\\dfrac{\\partial y}{\\partial v}[\/latex]<\/p>\n<\/section>\n<div>\n<p class=\"whitespace-normal break-words\">We can draw a tree diagram for each of these formulas as well.<\/p>\n<\/div>\n<div><\/div>\n<div>\n<figure id=\"attachment_1247\" aria-describedby=\"caption-attachment-1247\" style=\"width: 428px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1247\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5667\/2021\/09\/22221655\/4-5-2.jpeg\" alt=\"A diagram that starts with z = f(x, y). Along the first branch, it is written \u2202z\/\u2202x, then x = g(u, v), at which point it breaks into another two branches: the first subbranch says \u2202x\/\u2202u, then u, and finally it says \u2202z\/\u2202x \u2202x\/\u2202u; the second subbranch says \u2202x\/\u2202v, then v, and finally it says \u2202z\/\u2202x \u2202x\/\u2202v. Along the other branch, it is written \u2202z\/\u2202y, then y = h(u, v), at which point it breaks into another two branches: the first subbranch says \u2202y\/\u2202u, then u, and finally it says \u2202z\/\u2202y \u2202y\/\u2202u; the second subbranch says \u2202y\/\u2202v, then v, and finally it says \u2202z\/\u2202y \u2202y\/\u2202v.\" width=\"428\" height=\"336\" \/><figcaption id=\"caption-attachment-1247\" class=\"wp-caption-text\">Figure 2. Tree diagram for\u00a0[latex]\\small{\\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}}[\/latex] and\u00a0[latex]\\small{\\frac{\\partial x}{\\partial v}=\\frac{\\partial z}{\\partial x}\\frac{\\partial x}{\\partial v}+\\frac{\\partial z}{\\partial y}\\frac{\\partial y}{\\partial v}}.[\/latex]<\/figcaption><\/figure>\n<\/div>\n<div><\/div>\n<div>\n<p class=\"whitespace-normal break-words\">To find [latex]\\frac{\\partial z}{\\partial u}[\/latex], start from the left side of the diagram and follow only the branches ending with [latex]u[\/latex]. Add the terms at the end of those branches. For [latex]\\frac{\\partial z}{\\partial v}[\/latex], follow only the branches ending with [latex]v[\/latex].<\/p>\n<section class=\"textbox proTip\" aria-label=\"Pro Tip\">There&#8217;s an important difference between these two chain rules. In the chain rule for one independent variable, the left side is an ordinary derivative [latex]\\frac{dz}{dt}[\/latex] because [latex]z[\/latex] ultimately depends only on [latex]t[\/latex]. In the chain rule for two independent variables, the left side is a partial derivative [latex]\\frac{\\partial z}{\\partial u}[\/latex] (or [latex]\\frac{\\partial z}{\\partial v}[\/latex]) because [latex]z[\/latex] depends on both [latex]u[\/latex] and [latex]v[\/latex].<\/p>\n<\/section>\n<section class=\"textbox example\" aria-label=\"Example\">Calculate [latex]\\partial z\/\\partial u[\/latex] and [latex]\\partial z\/\\partial v[\/latex] using the following functions:<\/p>\n<p style=\"text-align: center;\">[latex]z=f(x,y)=3x^2-2xy+y^2,x=x(u,v)=3u+2v,y=y(u,v)=4u-v[\/latex]<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"q977241165\">Show Solution<\/button><\/p>\n<div id=\"q977241165\" class=\"hidden-answer\" style=\"display: none\">\n<p>To implement the chain rule for two variables, we need six partial derivatives\u2014[latex]\\partial z\/\\partial x, \\partial z\/\\partial y, \\partial x\/\\partial u, \\partial x\/\\partial v, \\partial y\/\\partial u,[\/latex], and\u00a0[latex]\\partial y\/\\partial v[\/latex]:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{\\partial z}{\\partial x} &= 6x-2y &\\quad &\\quad \\frac{\\partial z}{\\partial y} &= -2x+2y \\\\    \\frac{\\partial x}{\\partial u} &= 3 &\\quad &\\quad \\frac{\\partial x}{\\partial v}&=2 \\\\    \\frac{\\partial y}{\\partial u}&= 4 &\\quad &\\quad \\frac{\\partial y}{\\partial v}&=-1.    \\end{alignat}[\/latex]<\/p>\n<p>To find\u00a0[latex]\\partial z\/\\partial u[\/latex],\u00a0we use\u00a0the Chain Rule for Two Independent Variables:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{\\partial z}{\\partial u} &= \\frac{\\partial z}{\\partial x}\\frac{\\partial x}{\\partial u}+\\frac{\\partial x}{\\partial y}\\frac{\\partial y}{\\partial u} \\\\    &= 3(6x-2y)+4(-2x+2y) \\\\    &= 10x+2y.    \\end{alignat}[\/latex]<\/p>\n<p>Next, we substitute\u00a0[latex]x(u,v)=3u+2v[\/latex] and\u00a0[latex]y(u,v)=4u-v[\/latex]:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{\\partial z}{\\partial u} &= 10x+2y \\\\    &= 10(3u+2v)+2(4u-v) \\\\    &= 38u+18v.    \\end{alignat}[\/latex]<\/p>\n<p>To find\u00a0[latex]\\partial z\/\\partial v[\/latex], we use\u00a0the Chain Rule for Two Independent Variables:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{\\partial z}{\\partial v} &= \\frac{\\partial z}{\\partial x}\\frac{\\partial x}{\\partial v}+\\frac{\\partial x}{\\partial y}\\frac{\\partial y}{\\partial v} \\\\    &= 2(6x-2y)+(-1)(-2x+2y) \\\\    &= 14x-6y.    \\end{alignat}[\/latex]<\/p>\n<p>Then we substitute [latex]x(u,v)=3u+2v[\/latex] and\u00a0[latex]y(u,v)=4u-v[\/latex]:<\/p>\n<p>[latex]\\hspace{8cm}\\begin{alignat}{2}    \\frac{\\partial z}{\\partial v} &= 14x-6y \\\\    &= 14(3u+2v)-6(4u-v) \\\\    &= 18u+34v.    \\end{alignat}[\/latex]<\/p>\n<\/div>\n<\/div>\n<\/section>\n<\/div>\n","protected":false},"author":15,"menu_order":5,"template":"","meta":{"_candela_citation":"[]","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-616","chapter","type-chapter","status-publish","hentry"],"part":428,"module-header":"learn_it","content_attributions":[],"internal_book_links":[],"video_content":null,"cc_video_embed_content":{"cc_scripts":"","media_targets":[]},"try_it_collection":null,"_links":{"self":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters\/616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/users\/15"}],"version-history":[{"count":8,"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters\/616\/revisions"}],"predecessor-version":[{"id":1783,"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters\/616\/revisions\/1783"}],"part":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/parts\/428"}],"metadata":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapters\/616\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/media?parent=616"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/pressbooks\/v2\/chapter-type?post=616"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/contributor?post=616"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus3\/wp-json\/wp\/v2\/license?post=616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}