Chain Rule for Functions of Several Variables June, 0 Functions of Several Variables We write f : R n R m for a rule assigning to each vector in a domain D R n a unique vector in R m Examples: Suppose your position at time t is given by p(t) t +, 3t, t This gives a function p : R R 3 Observe that any vector line equation r r 0 + tv is a function r : R R n, where r 0, v R n On a windy day, the force of the wind at a point (x, y, z) might be given by a function For a function f : R n R m, we write F (x, y, z) : R 3 R F (x, y, z) xz +, y + z f(x, x,, x n ) (f (x, x,, x n ), f (x, x,, x n ),, f m (x, x,, x n )) For the function p in Example, we have p (t) t +, p (t) 3t, and p 3 (t) t Derivative Matrix We can organize the partial derivatives of f : R R into a matrix called the derivative matrix, Df x More generally, for f : R n R m, the derivative matrix of y f(x,, x n ) (f (x,, x n ),, f m (x,, x n )) is Df Examples: Find the derivative matrix r(t) t +, 3t, t x x m x x x m x Dr 3 m
F (x, y) sin x, cos(xy), ln x DF cos x 0 y sin(xy) x sin(xy) 0 x 3 Composition for Functions of Several Variables Recall from single variable calculus that for two functions f, g : R R, we may find the composition f g(x) f(g(x)) We can illustrate this as follows: R g R f R To take derivatives of these compositions, we use the Chain Rule: d df dg (f g(x)) (g(x)) dx dx dx (x) For multivariable functions f : R n R m and g : R k R n, we can take the composition f g(t) f(g(t)) illustrated by R k g R n f R m Our next task will be to find a rule for expressing the derivative matrix of f g in terms of the matrices Df and Dg Examples: Find F g(x, y), where F (t) t, t, 3t + and g(x, y) 3x + y F g(t) F (g(t)) F (3x + y) (3x + y), 3(3x + 3y), 3(3x + y) + Express T in terms of t, when T (x, y) xy, 3x + y, and x t, y t T (t) (t )(t), 3(t ) + (t) We can view this as a composition by defining a function f(t) x(t), y(t) t, t Then expressing T in terms of t is the same as finding T f(t) 4 Chain Rule, Case Suppose the function f(x) gives the height of a mountain range at position x We are thinking of a cross section through the mountains, like the following graph
Now suppose your are traveling through the mountains along this cross section, with position at time t given by a function g(t) Then your height at time t is f(g(t)) We can define a function h(t) f(g(t)) Sometimes we write h f g or h(t) (f g)(t) Recall that the one-dimensional chain rule is dh df (t) dt dx ( g(t) ) dg dt (t) We can state this in terms of the derivative matrices of f and g Since f : R R and g : R R, the matrices Df and Dg are matrices Df df dx, Dg dg dx Since multiplication of matrices is just scalar multilplication, the one-dimensional chain rule can be written Dh(t) Df(g(t))Dg(t) Chain Rule, Case Now redefine the mountain range by a function of two variables f(x, y) As before, you travel across the mountain range in a path g(t) g (t), g (t) Now your height at time t is given by h(t) f(g(t)), which means that we evaluate f(x, y) at x g (t) and y g (t) The derivative h (t) will give the rate of change of height with respect to time We compute this by taking the product of derivative matrices Dh(t) Df(g(t))Dg(t) This what the computation looks like: Dh(t) (x, y) x (x, y) g (t) g(t) t y g (t) t g (g(t)) (g(t)) (t) t x y g (t) t x (g(t)) g (t) + t y (g(t)) g t (t) 3
6 Chain Rule for Multivariable Functions For general functions f : R n R m, and g : R k R n we can take the composition f(x) f (x),, f m (x) ) g(t) g (t),, g n (t) h(t) f(g(t)) f(g (t),, g n (t)) We can find the derivative matrix of the composition h by taking the product of derivative matrices Dh(t) Df(g(t))Dg(t) 7 Examples Suppose in our example from the beginning, the height of the mountain range at point (x, y) is given by f(x, y) x sin(xy), and the path you travel is given by g(t) t, t Then your height at time t is h(t) f(g(t)) We can compute the rate of change of height at time t using the chain rule Dh(t) Df(g(t))Dg(t) xy cos(xy) + sin(xy) x cos(xy) g(t) t t 3 cos(t 3 ) + sin(t 3 ) t cos(t 3 ) t t 3 cos(t 3 ) + sin(t 3 ) + 4t 3 cos(t 3 ) 6t 3 cos(t 3 ) + sin(t 3 ) We can also compute this derivative by first composing the functions, then taking the derivative of the composition h(t) f(g(t)) t sin(t 3 ) Dh(t) 6t 3 cos(t 3 ) + sin(t 3 ) Find Dh and Dh(, ) where h f(g(s, t)), and f(x, y, z) x + z, xyz, h(s, t) t, st, s 3 Using the chain rule, we compute: Dh(s, t) Df(g(s, t))dg(s, t) 4
0 z 0 t yz xz xy 4st g(s,t) 3s 0 0 s 3 0 s 4 t s 3 t st 3 t 4st 3s 0 6s s 3 t 3 + 6s 3 t 3 s 4 t + 4s 4 t 6s 8s 3 t 3 6s 4 t Without using the chain rule, we can first compose the functions, then find the derivative matrix of the composition From this, we compute h(s, t) (f g)(s, t) t + s 6, s 4 t 3 Dh(s, t) D(f g)(s, t) Dh(, ) 6 8 6 6s 8s 3 t 3 6s 4 t 3 Find D(F g)(3, ), if F (x, y) e xy+, e x, Dg(3, ), 0, and g(3, ) D(F g)(3, ) DF (g(3, ))Dg(3, ) ye xy+ xe xy+ e x 0 (,0) 0 e 0 e e e