CHAIN RULE (SEVERAL VARIABLES) DR KUENZER Typed by: Yusuf Saber Example: x 2 x22 f1 x1 , x2 0 f ( x1 , x2 ) 1 , x0 0 x1 x1 x2 f 2 x1 , x2 Solution The derivative of f x1, x2 is given by f1, x x1 , x2 f x1 , x2 1 f 2, x x1 , x2 1 2x2 2x 1 x1 1 x2 0 f 0,0 1 f1, x2 x1, x2 f 2, x2 x1, x2 0 0 0 We need to linearly approximate the function at x0 , we thus use the following 0 general formula f x f x0 f x0 x x0 R2 x with lim x x0 x x0 1 R2 ( x) . Here: 0 x1 0 R2 x 0 x2 0 x12 x22 0 0 x1 x1 x2 0 1 f x f x0 f x0 x x0 Hence x 2 x22 0 x12 x22 R2 x 1 x1 x1 x2 x1 x1 x2 error term x x x2 x2 2 2 1 1 2 x1 x12 x22 x1 x2 1 0 , lim lim lim 0 0 x 0 x2 x1 x2 x 0 x1 x2 x 0 1 1 0 0 x2 x2 x2 x2 1 1 2 2 as to be expected. 2 1 2 Theorem (Chain Rule): Let f : D m be a function that is differentiable in x0 D , g : E n that is differentiable in f x0 E . k be a function m (Assume that there is an 0 such that B x0 D , and B f x0 E , and assume that f ( D) E .) Recall: The composition of f followed by g is given by g f x g f x def Then the derivative of such a function is given by g f x g f x 0 k n f x0 k m mn inner derivative outer derivative Note: The number of variables determine the number of columns in the resulting matrix and the number of functions determines the number of rows. Proof: Consider the linear approximation of g f in k0 g f x g f x g f x0 g f x0 f x f x0 R2 f x g f x0 g f x0 f x0 x x0 R2 x R2 f x g f x0 g f x0 f x0 x x0 g f x0 R2 x R2 f x , g f x0 and x x0 1 g f x R x 0 , and 0 2 x x0 1 R2 f x 0 for x x0 Since we have constructed a linear approximation with matrix g f x2 f x0 , we know that g f x0 g f x0 f x0 Example: x Let g g x, y x y y r r sin Let f f r , r cos We want to calculate g f r , . g: 2 1 f: 2 2 By direct calculation: g g f r, g f r , r sin r cos f r , sin cos r cos r sin Now we apply the chain rule to recalculate g f (r , ) . r cos sin f r, r sin cos g x, y 1 1 We can therefore find g f r , g f r , f r , r cos sin 1 r sin cos sin cos r cos r sin 1 which is the same. Example: u x Let f x , where u x and v x are arbitrary differentiable functions in v x y let g g y, z y z . z We want to rederive the product rule from one-dimensional calculus. From the question we see that Now: g 1 2 g: 2 1 u x f x g f x g u x v x , v x hence g f x u x v x On the other hand, f: g y, z z u x f x v x y , Hence g f x g f x f x u x v x u x v x v x u x u x v x Hence u x v x v x v x u x v x , as to be expected. Example: Calculate the derivative d x2 1 t sin xt 2 dt x dx def f ( x) We use the following trick. Define h y, z, w t 1 sin wt 2 dt , def z y simply by replacing all occurrences of x by different variables, and let x def g x x2 x record the replacements. Then h g x h g x h x, x 2 , x t 1 sin t 2 x dt x2 x f x The derivative of g is given by 1 g x 2 x 1 The derivative of h is given by h y, z , w hy y, z , w hz y, z , w hw y , z , w Now we must find each of those terms separately. By the Fundamental Theorem, we get, for a constant a d x u t dt u x dx a So hy y, z, w y d t 1 sin t 2 w dt y 1 sin y 2 w z dy And hz y, z , w d dz t z 1 y Finally sin t 2 w dt z 1 sin z 2 w z d t 1 sin t 2 w dt y dw z d t 1 sin t 2 w dt y dw hw y, z , w t 1 cos t 2 w t 2 dt z y 1 z 2tw cos t 2 w dt y 2w z 1 sin t 2 w y 2w 1 sin z 2 w sin y 2 w 2w Therefore h y, z , w hy y, z , w hz y, z , w hw y , z , w y 1 sin y 2 w z 1 sin z 2 w Hence f '( x) h g ( x) g ( x) 1 hy x, x , x hz x, x , x hw x, x , x 2 x 1 1 x 1 sin( x 3 ) 1 x 2 sin( x 5 ) 2 x x 1 sin( x 5 ) sin( x 3 ) 2 3 5 x 1 sin( x 3 ) x 1 sin( x 5 ). 2 2 2 2 2 1 sin z 2 w sin y 2 w 2w