Multivariable Calculus · Undergraduate

The Multivariable Chain Rule

Quick answer

When z = f(x, y) and both x and y depend on t, the rate dz/dt adds one term for each way t reaches z: dz/dt = f_x dx/dt + f_y dy/dt. The rule comes straight from linear approximation, dividing the total differential by dt. With two parameters, as when x and y depend on s and t, each partial derivative of z gets the same kind of sum, and a tree diagram keeps track of the routes. The same rule gives implicit differentiation in one line: dy/dx = −F_x / F_y for a curve F(x, y) = 0.

What you'll learn

  • Differentiate a function of several variables along a path
  • Use a tree diagram for functions of two parameters
  • Differentiate an implicit curve with −F_x/F_y
  • Solve related-rates problems with several changing quantities

Following a path through a function

A hiker walks along a trail, and the temperature at each point of the map is T(x,y)T(x, y). As time passes, both coordinates change, so the temperature the hiker feels changes through two routes at once. The chain rule adds them:

dzdt=∂f∂xdxdt+∂f∂ydydt\frac{dz}{dt} = \frac{\partial f}{\partial x}\frac{dx}{dt} + \frac{\partial f}{\partial y}\frac{dy}{dt}

Each term is a rate of ff in one direction times how fast the path moves in that direction.

Why the terms add

The linear approximation says that small changes in the inputs change zz by

Δz≈fx Δx+fy Δy\Delta z \approx f_x\,\Delta x + f_y\,\Delta y

Divide by the small change Δt\Delta t that caused them and let it shrink: ΔxΔt→dxdt\tfrac{\Delta x}{\Delta t} \to \tfrac{dx}{dt} and ΔyΔt→dydt\tfrac{\Delta y}{\Delta t} \to \tfrac{dy}{dt}, and the approximation becomes exact. Near any point the function is almost linear, and for a linear function the effects of the two inputs add, which is why the chain rule is a sum.

Worked examples

Common mistakes

Practice problems

  1. For w=xyw = xy with x=t2x = t^2 and y=3ty = 3t, find dwdt\tfrac{dw}{dt} at t=2t = 2.

    Answer

    3636

    Full solution

    dwdt=y(2t)+x(3)=3t⋅2t+3t2=9t2\tfrac{dw}{dt} = y(2t) + x(3) = 3t \cdot 2t + 3t^2 = 9t^2, which is 3636 at t=2t = 2. Substituting first, w=3t3w = 3t^3, agrees.

  2. For z=x2+y2z = x^2 + y^2 with x=etx = e^t and y=e−ty = e^{-t}, find dzdt\tfrac{dz}{dt} at t=0t = 0.

    Answer

    00

    Full solution

    dzdt=2xet+2y(−e−t)=2e2t−2e−2t\tfrac{dz}{dt} = 2x e^t + 2y(-e^{-t}) = 2e^{2t} - 2e^{-2t}, which is 00 at t=0t = 0.

  3. For z=xyz = xy with x=stx = st and y=s+ty = s + t, find ∂z∂s\tfrac{\partial z}{\partial s} at (s,t)=(1,2)(s, t) = (1, 2).

    Answer

    88

    Full solution

    ∂z∂s=y⋅t+x⋅1\tfrac{\partial z}{\partial s} = y \cdot t + x \cdot 1. At (1,2)(1, 2): x=2x = 2 and y=3y = 3, so 3⋅2+2=83 \cdot 2 + 2 = 8.

  4. Find dydx\tfrac{dy}{dx} on the curve x2+xy+y2=7x^2 + xy + y^2 = 7 at (1,2)(1, 2).

    Answer

    −45-\tfrac{4}{5}

    Full solution

    Fx=2x+y=4F_x = 2x + y = 4 and Fy=x+2y=5F_y = x + 2y = 5, so dydx=−45\tfrac{dy}{dx} = -\tfrac{4}{5}.

  5. Use −FxFy-\tfrac{F_x}{F_y} to find the slope of the circle x2+y2=25x^2 + y^2 = 25.

    Answer

    −xy-\tfrac{x}{y}

    Full solution

    Fx=2xF_x = 2x and Fy=2yF_y = 2y. At (3,4)(3, 4) the slope is −34-\tfrac{3}{4}, perpendicular to the radius, whose slope is 43\tfrac{4}{3}.

  6. A rectangle is 2020 cm long, growing at 22 cm/s, and 1010 cm wide, shrinking at 11 cm/s. How fast is its area changing?

    Answer

    00 cm²/s

    Full solution

    A=lwA = lw, so dAdt=wdldt+ldwdt=10(2)+20(−1)=0\tfrac{dA}{dt} = w\tfrac{dl}{dt} + l\tfrac{dw}{dt} = 10(2) + 20(-1) = 0. The two effects cancel at this instant.

  7. Draw the tree diagram for w=f(x,y,z)w = f(x, y, z) with xx, yy, zz each depending on tt, and write dwdt\tfrac{dw}{dt}.

    Answer

    dwdt=fxdxdt+fydydt+fzdzdt\tfrac{dw}{dt} = f_x\tfrac{dx}{dt} + f_y\tfrac{dy}{dt} + f_z\tfrac{dz}{dt}

    Full solution

    Three branches lead from ww to xx, yy and zz, and each continues to tt. Three paths give three products.

  8. For T=x2+y2T = x^2 + y^2 on the path x=cos⁡tx = \cos t, y=2sin⁡ty = 2\sin t, where on the path does TT increase fastest?

    Answer

    At t=π4t = \tfrac{\pi}{4} and t=5π4t = \tfrac{5\pi}{4}

    Full solution

    dTdt=3sin⁡2t\tfrac{dT}{dt} = 3\sin 2t is largest, equal to 33, where sin⁡2t=1\sin 2t = 1.

  9. For z=f(x,y)z = f(x, y) with x=rcos⁡θx = r\cos\theta and y=rsin⁡θy = r\sin\theta, write ∂z∂r\tfrac{\partial z}{\partial r}.

    Answer

    fxcos⁡θ+fysin⁡θf_x\cos\theta + f_y\sin\theta

    Full solution

    ∂x∂r=cos⁡θ\tfrac{\partial x}{\partial r} = \cos\theta and ∂y∂r=sin⁡θ\tfrac{\partial y}{\partial r} = \sin\theta. This is the rate of change of ff moving straight out from the origin.

  10. A student computes dzdt\tfrac{dz}{dt} for z=x2yz = x^2y with x=tx = t and y=t2y = t^2 as 2x⋅1=2t2x \cdot 1 = 2t. What went wrong?

    Hint

    How many routes lead from tt to zz?

    Answer

    The route through yy is missing. dzdt=2xy⋅1+x2⋅2t=4t3\tfrac{dz}{dt} = 2xy \cdot 1 + x^2 \cdot 2t = 4t^3.

    Full solution

    The student also dropped the factor yy from fx=2xyf_x = 2xy. With both routes, 2t⋅t2+t2⋅2t=4t32t \cdot t^2 + t^2 \cdot 2t = 4t^3, which matches differentiating z=t4z = t^4 directly.

Frequently asked questions

What is the multivariable chain rule?

If z = f(x, y) with x = x(t) and y = y(t), then dz/dt = (∂f/∂x)(dx/dt) + (∂f/∂y)(dy/dt): one term for each intermediate variable.

Why does the chain rule add terms?

A small change in t moves both x and y, and the linear approximation dz ≈ f_x dx + f_y dy adds their effects. Dividing by dt gives the rule.

What is a tree diagram?

A picture with z at the top, the intermediate variables below it and the independent variables at the bottom. Each path from z down to a variable is one product in the sum.

How does the chain rule give implicit differentiation?

Differentiating F(x, y) = 0 with y = y(x) gives F_x + F_y dy/dx = 0, so dy/dx = −F_x / F_y wherever F_y is not zero.

What if x and y depend on two variables s and t?

Then ∂z/∂s = f_x x_s + f_y y_s and ∂z/∂t = f_x x_t + f_y y_t, the same rule with partial derivatives throughout.

What to learn next