15.5 The Chain Rule Theorem (The Chain Rule - case 1) Suppose z = f (x, y) is a differentiable function and x = x(t), y = y(t) are both differentiable functions of t. Then z is differentiable with respect to t and dz ∂f dx ∂f dy = + dt ∂x dt ∂y dt (Proof) ∆z = ∂f ∂f ∆x + ∆y + 1 ∂x + 2 ∂y ∂x ∂y ∆z ∆t = ∂f ∆x ∂f ∆y ∆x ∆y + + 1 + 2 ∂x ∆t ∂y ∆t ∆t ∆t = ∂f dx ∂f dy dx dy ∂f dx ∂f dy + + lim 1 + lim 2 = + ∂x dt ∂y dt dt ∆t→0 dt ∆t→0 ∂x dt ∂y dt lim ∆t→0 ∆z ∆t because lim 1 = lim 2 = 0 ∆t→0 ∆t→0 Example Use the Chain Rule to find dz/dt or dw/dt : x = 5t4 , y = 1/t (a) z = cos(x + 4y) ; (b) w = tan−1 (Answers) p x2 + y 2 + z 2 ; x = sin t, y = cos t, z = tan t dx dy dz 3 2 = (cos(x + 4y))x + (cos(x + 4y))y = − sin(x + 4y) · 20t − 4 sin(x + 4y) · (−1/t ) dt dt dt dx dy dz p p p dw −1 −1 −1 (b) x2 + y 2 + z 2 x2 + y 2 + z 2 x2 + y 2 + z 2 = tan + tan + tan x dt y dt z dt dt (a) = x (1 + x2 + y 2 + z 2 ) + + = p x2 + y 2 + z 2 · cos t y (1 + x2 + y 2 + z 2 ) p x2 + y 2 + z 2 p x2 + y 2 + z 2 z (1 + x2 + y 2 + z 2 ) · (− sin t) 2 · sec t x cos t − y sin t + z sec2 t p x2 + y 2 + z 2 (1 + x2 + y 2 + z 2 ) Theorem (The Chain Rule - case 2) Let z = f (x, y) be a differentiable function of x and y where x = x(s, t), y = y(s, t) are differentiable functions of s and t. Then z = f (x(s, t), y(s, t)) is a differentiable function of s and t and ∂z ∂f ∂x ∂f ∂y = + , ∂s ∂x ∂s ∂y ∂s ∂z ∂f ∂x ∂f ∂y = + ∂t ∂x ∂t ∂y ∂t Example Use the Chain Rule to find ∂z/∂s and ∂z/∂t (a) z = arcsin(xy) ; x = s2 + t2 , y = 1 − 2st (b) z = er cos θ ; r = st, θ = (Answers) (a) (b) √ s2 + t2 ∂z y x 2ys − 2xt = (arcsin(xy))x · xs + (arcsin(xy))y · ys = p · 2s + p · (−2t) = p ∂s 1 − x2 y 2 1 − x2 y 2 1 − x2 y 2 ∂z 2ty − 2sx Similarly, = p ∂t 1 − x2 y 2 ∂z s r r r r = (e cos θ)r · rs + (e cos θ)θ · θs = e cos θ · t − e sin θ · √ ∂s s2 + t2 ∂z t sin θ r Similarly, =e s cos θ − √ ∂t s2 + t2 1 Theorem (The Chain Rule - generalized) Suppose z = f (x1 , · · · , xn ) be a differentiable function where x1 = x1 (t1 , · · · , tm ) x2 = x2 (t1 , · · · , tm ) are differentiable functions of t1 , · · · , tm . Then z = f (x1 (t1 , · · · , tm ), · · · , xn (t1 , · · · , tm )) . .. xn = xn (t1 , · · · , tm ) is a differentiable function of t1 , · · · , tm and n X ∂f ∂xk ∂f ∂x1 ∂f ∂x2 ∂f ∂xn ∂z = + + ··· + = ∂ti ∂x1 ∂xi ∂x2 ∂ti ∂xn ∂ti ∂xk ∂ti k=1 Example Use the Chain Rule to find ∂u ∂u ∂u , , when ∂p ∂r ∂θ u = x2 + yz ; (Answers) x = pr cos θ, y = pr sin θ, z = p + r • up = (x2 + yz)x · xp + (x2 + yz)y · yp + (x2 + yz)z · zp = 2x · r cos θ + z · r sin θ + y · 1 • ur = (x2 + yz)x · xr + (x2 + yz)y · yr + (x2 + yz)z · zr = 2x · p cos θ + z · p sin θ + y · 1 • uθ = (x2 + yz)x · xθ + (x2 + yz)y · yθ + (x2 + yz)z · zθ = 2x · (−pr sin θ) + z · pr cos θ + y · 0 Theorem (Implicit Differentiation) (a) Given f (x, y) = C where y is an implicitly defined function of x, we have f (x, y) = C ⇓ fx dx + fy dy = 0 provided fx and fy exist. (b) Given f (x, y, z) = C where z is an implicitly defined function of x and y, we have f (x, y, z) = C ⇓ fx + fz ∂z ∂z = 0 and fy + fz =0 ∂x ∂y provided fx , fy , and fz exist. (Explanation) (a) Since y = y(x), we can view f (x, y) and C as functions of x. Since f (x, y) and C are equal at all x, their derivatives with respect to x are equal as well. Differentiate both sides of f (x, y(x)) = C with respect to x : d f (x, y) dx fx dx dy + fy dx dx fx + fy dy dx fx dx + fy dy = d C dx = 0 = 0 = 0 (Chain Rule) 2 (b) Since z = z(x, y) and x,y are independent variables, we can view f (x, y, z(x, y)) and C as functions of two variables x and y. The two functions f (x, y, z(x, y)) and C are equal at all x and y. Hence their partial derivatives with respect to x(and y) are equal at all x and y. Differentiate both sides of f (x, y, z(x, y)) = C with respect to x : ∂ f (x, y, z) ∂x fx = ∂ C ∂x ∂y ∂z ∂x + fy + fz ∂x ∂x ∂x = 0 ∂z ∂x = 0 fx + 0 + fz (Chain Rule) Similarly when we differentiate functions in both sides of f (x, y, z) = C with respect to y, we get the result fy + fz Example 2 (a) Use partial derivatives to find dy/dx when y 5 + x2 y 3 = 1 + yex . (b) Use partial derivatives to find ∂z/∂x and ∂z/∂y when xyz = cos(x + y + z). (Answers) 2 (a) Let f (x, y) = y 5 + x2 y 3 − 1 − yex . Then we have f (x, y) = 0. 2 2 (y 5 + x2 y 3 − 1 − yex )dx + (y 5 + x2 y 3 − 1 − yex )dy x2 (2xy 3 − 2xye )dx + (5y 4 + 3x2 y 2 − e x2 )dy = 0 = 0 2 2xy 3 − 2xyex dy =− . Hence dx 5y 4 + 3x2 y 2 − ex2 (b) Let f (x, y, z) = xyz − cos(x + y + z). We have f (x, y, z) = 0. Differentiate both sides with respect to x : (xyz − cos(x + y + z))x + (xyz − cos(x + y + z))z (yz + sin(x + y + z)) + (xy + sin(x + y + z)) ∂z ∂x ∂z ∂x ∂z yz + sin(x + y + z) Hence =− . ∂x xy + sin(x + y + z) xz + sin(x + y + z) ∂z =− . By the same way we achieve ∂y xy + sin(x + y + z) 3 = 0 = 0 ∂z = 0. ∂y