Math Core

Lesson 3.5 · Partial Derivatives

The multivariable chain rule

Quantities are often linked in chains. The temperature you feel depends on your position, and your position depends on time. The volume of a balloon depends on its radius and height, which both change as it inflates. The multivariable chain rule tells you how the final quantity changes by adding up the contribution of every link in the chain.

Case 1: one parameter

Suppose z=f(x,y)z = f(x, y) and both xx and yy are functions of tt. Then zz is ultimately a function of tt alone. How fast does it change?

Over a short time Δt\Delta t, the inputs change by Δx\Delta x and Δy\Delta y. From the linear approximation in the previous lesson, the output changes by about

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

Dividing by Δt\Delta t and letting Δt→0\Delta t \to 0 gives the first version of the chain rule.

Chain rule, one parameter

If z=f(x,y)z = f(x, y) is differentiable and x=x(t)x = x(t), y=y(t)y = y(t) are differentiable, then

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

Each term is "how sensitive zz is to one input" times "how fast that input is changing." For three intermediate variables xx, yy, zz feeding into ww, there are three such terms.

Worked example: Along a circle

Let z=x2y+y3z = x^2y + y^3, where x=cos⁡tx = \cos t and y=sin⁡ty = \sin t. Find dzdt\dfrac{dz}{dt} at t=0t = 0.

At t=0t = 0: x=1x = 1, y=0y = 0, dxdt=−sin⁡0=0\dfrac{dx}{dt} = -\sin 0 = 0 and dydt=cos⁡0=1\dfrac{dy}{dt} = \cos 0 = 1.

The partials are zx=2xyz_x = 2xy and zy=x2+3y2z_y = x^2 + 3y^2, which equal 00 and 11 at (1,0)(1, 0). So

dzdt=(0)(0)+(1)(1)=1.\frac{dz}{dt} = (0)(0) + (1)(1) = 1.

Worked example: A changing cylinder

The radius of a cylinder is increasing at 0.20.2 cm/s while its height is decreasing at 0.50.5 cm/s. How fast is the volume changing when r=3r = 3 cm and h=8h = 8 cm?

V=πr2hV = \pi r^2 h, so

dVdt=Vrdrdt+Vhdhdt=2πrh (0.2)+πr2 (−0.5).\frac{dV}{dt} = V_r\frac{dr}{dt} + V_h\frac{dh}{dt} = 2\pi r h\,(0.2) + \pi r^2\,(-0.5).

At r=3r = 3, h=8h = 8: dVdt=2π(24)(0.2)−π(9)(0.5)=9.6π−4.5π=5.1π≈16.0\dfrac{dV}{dt} = 2\pi(24)(0.2) - \pi(9)(0.5) = 9.6\pi - 4.5\pi = 5.1\pi \approx 16.0 cm³/s. The volume is still increasing, because growth in the radius wins.

Case 2: two parameters

Now suppose xx and yy each depend on two variables, x=x(s,t)x = x(s, t) and y=y(s,t)y = y(s, t). Then zz is a function of ss and tt, and it has two partial derivatives. Hold tt fixed and apply Case 1 to get ∂z/∂s\partial z/\partial s; hold ss fixed to get ∂z/∂t\partial z/\partial t.

Chain rule, two parameters

∂z∂s=∂z∂x∂x∂s+∂z∂y∂y∂s,∂z∂t=∂z∂x∂x∂t+∂z∂y∂y∂t.\frac{\partial z}{\partial s} = \frac{\partial z}{\partial x}\frac{\partial x}{\partial s} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial s}, \qquad \frac{\partial z}{\partial t} = \frac{\partial z}{\partial x}\frac{\partial x}{\partial t} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial t}.

Tree diagrams

A tree diagram keeps the bookkeeping straight. Put zz at the top, draw a branch to each intermediate variable (xx and yy), and from each of those draw branches to the independent variables (ss and tt). Label every branch with the corresponding partial derivative. To find ∂z/∂s\partial z/\partial s, follow every path from zz down to ss, multiply along each path, and add the results. This rule works for any number of variables and any number of levels.

Worked example: Two parameters

Let z=exsin⁡yz = e^x\sin y with x=st2x = st^2 and y=s2ty = s^2t. Find ∂z∂s\dfrac{\partial z}{\partial s}.

The pieces are zx=exsin⁡yz_x = e^x\sin y, zy=excos⁡yz_y = e^x\cos y, xs=t2x_s = t^2 and ys=2sty_s = 2st. So

∂z∂s=exsin⁡y⋅t2+excos⁡y⋅2st=est2(t2sin⁡(s2t)+2stcos⁡(s2t)).\frac{\partial z}{\partial s} = e^x\sin y\cdot t^2 + e^x\cos y\cdot 2st = e^{st^2}\left(t^2\sin(s^2t) + 2st\cos(s^2t)\right).

Common mistake

Evaluate every factor at the same point. If you are asked for ∂z/∂s\partial z/\partial s at (s,t)=(2,1)(s, t) = (2, 1), first compute the corresponding xx and yy, then evaluate zxz_x and zyz_y at that (x,y)(x, y) and evaluate xsx_s and ysy_s at (s,t)=(2,1)(s, t) = (2, 1). Plugging ss and tt directly into zxz_x as if they were xx and yy is the most common error.

Implicit differentiation

The chain rule also explains implicit differentiation. Suppose the equation F(x,y)=0F(x, y) = 0 defines yy as a function of xx. Differentiate both sides with respect to xx, treating xx as xx and yy as y(x)y(x):

Fxdxdx+Fydydx=0⟹dydx=−FxFy,provided Fy≠0.F_x\frac{dx}{dx} + F_y\frac{dy}{dx} = 0 \quad\Longrightarrow\quad \frac{dy}{dx} = -\frac{F_x}{F_y}, \quad\text{provided } F_y \ne 0.

The same argument works one dimension up. If F(x,y,z)=0F(x, y, z) = 0 defines zz implicitly as a function of xx and yy, then

∂z∂x=−FxFz,∂z∂y=−FyFz,Fz≠0.\frac{\partial z}{\partial x} = -\frac{F_x}{F_z}, \qquad \frac{\partial z}{\partial y} = -\frac{F_y}{F_z}, \qquad F_z \ne 0.

Worked example: Implicit derivatives

(a) Find dydx\dfrac{dy}{dx} if x3+y3=6xyx^3 + y^3 = 6xy.

Move everything to one side: F(x,y)=x3+y3−6xyF(x, y) = x^3 + y^3 - 6xy. Then Fx=3x2−6yF_x = 3x^2 - 6y and Fy=3y2−6xF_y = 3y^2 - 6x, so

dydx=−3x2−6y3y2−6x=2y−x2y2−2x.\frac{dy}{dx} = -\frac{3x^2 - 6y}{3y^2 - 6x} = \frac{2y - x^2}{y^2 - 2x}.

(b) Find ∂z∂x\dfrac{\partial z}{\partial x} if x2+2y2+3z2=12x^2 + 2y^2 + 3z^2 = 12.

With F=x2+2y2+3z2−12F = x^2 + 2y^2 + 3z^2 - 12, Fx=2xF_x = 2x and Fz=6zF_z = 6z, so ∂z∂x=−2x6z=−x3z\dfrac{\partial z}{\partial x} = -\dfrac{2x}{6z} = -\dfrac{x}{3z}.

Tip

Mind the minus sign in −Fx/Fy-F_x/F_y. A quick sanity check: on the circle x2+y2=25x^2 + y^2 = 25, the formula gives dydx=−xy\dfrac{dy}{dx} = -\dfrac{x}{y}, which is negative in the first quadrant, just as the picture of the circle says it should be.

Practice

Practice 1

Let z=x2+xyz = x^2 + xy with x=t2x = t^2 and y=3ty = 3t. Use the chain rule to find dzdt\dfrac{dz}{dt} at t=1t = 1.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Let w=xy+yzw = xy + yz with x=tx = t, y=t2y = t^2 and z=t3z = t^3. Find dwdt\dfrac{dw}{dt} at t=1t = 1.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Let z=x2yz = x^2y with x=s+tx = s + t and y=s−ty = s - t. Find ∂z∂s\dfrac{\partial z}{\partial s} when s=2s = 2 and t=1t = 1.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

With the same z=x2yz = x^2y, x=s+tx = s + t and y=s−ty = s - t, find ∂z∂t\dfrac{\partial z}{\partial t} when s=2s = 2 and t=1t = 1.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

The equation x2y+y3=10x^2y + y^3 = 10 defines yy implicitly as a function of xx. Find dydx\dfrac{dy}{dx} in terms of xx and yy.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 6

The point (1,2)(1, 2) lies on the curve x3+xy2=5x^3 + xy^2 = 5. Find dydx\dfrac{dy}{dx} there.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

The equation xz+yz2+x2y=7xz + yz^2 + x^2y = 7 defines zz implicitly as a function of xx and yy. Find ∂z∂x\dfrac{\partial z}{\partial x} in terms of xx, yy and zz.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 8

The length of a rectangle is increasing at 33 cm/s and its width is decreasing at 22 cm/s. How fast, in cm/s, is the length of the diagonal changing when the length is 88 cm and the width is 66 cm?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.