Chater 6 6 Partial Derivatives.................................................... 72 6. Higher order artial derivatives...................................... 73 6.2 Matrix of artial derivatives.........................................74 6.3 Chain rule....................................................... 74 6.4 Change of variables................................................77 Philli Hall - Room 537, Huxle email: hil.hallimerial.ac.uk
Chater 6 Partial Derivatives De nition 5 Let f : R 2 R be a function of two variables, f (x; ) 2 R. The artial derivative of f with resect to x (x-variable) at a oint (x ; ) 2 R 2 is de ned as the limit x (x f (x + h; ) f (x ; ) ; ) := lim h h (6.) rovided this limit exists. Equivalentl, we de ne the artial derivative of f with resect to as the limit (x f (x ; + h) f (x ; ) ; ) := lim (6.2) h h rovided it exists. In other words, we de ne the artial derivatives of f with resect to x (res. ) keeing the other variable xed and aling the standard de nition of derivative as if f was a function of one variable. Alternativel to the notation x, we will also denote the artial derivatives as f x or x f (similarl, = f = f). The artial derivatives x and will be considered as functions x ; : R2 R that, to an oint (x; ) 2 R 2, associate the artial derivatives (6.) and (6.2). Examle 6 Let Then f(x; ) = x 2 3 + sin(x + 2) + : x (x; ) = 2x3 + cos (x + 2) (x; ) = 32 x 2 + 2 cos (x + 2) + : 72
6. Higher order artial derivatives 73 6. Higher order artial derivatives The artial derivatives x f and f of f : R 2 R are themselves functions of both variables x and. Therefore, we can di erentiate them and consider their artial derivatives with resect to x and, x x = 2 f x 2 ; x = 2 f x ; x = 2 f x ; = 2 f : One of the most imortant results in artial di erentiation is that, rovided that higher order artial derivatives exist and are continuous functions, the order in which artial derivatives are taken is not imortant. Theorem 7 Let f : R 2 R be a function such that both x f and x f are continuous. Then 2 f x = 2 f x : This means that if, for examle, we want to di erentiate a function f : R 2 R three times with resect to x and ve times with resect to, we will carr out these artial derivatives consecutivel in an order and we will siml write 8 f 5 x 3 : In general, De nition 5 can be extended in a natural wa to functions of more than 2 variables. That is, if f : R n R is a function of (x ; :::; x n ) 2 R n, then, for examle, f (x ; :::; x i + h; :::; x n ) f (x ; :::; x i ; :::; x n ) = lim x i h h rovided this limit exists. Equall, one can consider higher order artial derivatives di erentiating with resect to an variable x ; :::; x n iterativel, 2 f x j x i ; 3 f x j x i x k ; ::: etc. i; j; k 2 f; :::; ng: If f : R n R m is not real-valued but vector-valued, 7 f : R n R m (x ; :::; x n ) (f (x ; ::; x n ) ; :::; f m (x ; ::; x n )) we can artiall di erentiate an of its m comonents (f ; :::; f m ) and consider j x i ; j 2 f; :::; mg i 2 f; :::; ng:
6.2 Matrix of artial derivatives 74 6.2 Matrix of artial derivatives Partial derivatives of functions are usuall dislaed in a matrix, the so-called matrix of artial derivatives. If f : R n R m is a R m -valued function of n variables, we arrange its artial derivatives as x x 2 x n 2 2 2 x x 2 x n T f := B. (6.3).... C A m x m x 2 We will denote this matrix b T f. For examle, if f : R n R is real valued (onl one comonent, f = f ), then the matrix (6.3) reduces to a vector T f = ; ; :::; : x x 2 x n In this articular case, the vector of artial derivatives is called the gradient of f and it is alternativel denoted b rf. Examle 8 If m x n f(x; ) = x 2 3 + sin(x + 2) + is the function of Examle 6. Then its gradient is rf = 2x 3 + cos (x + 2) ; 3 2 x 2 + 2 cos (x + 2) + and the matrix of second order artial derivatives is 2 3 sin (x + 2) 6x 2 2 sin (x + 2) 6x 2 2 sin (x + 2) 6x 2 : 4 sin (x + 2) Observe that 6.3 Chain rule 2 f x = 6x2 2 sin (x + 2) = 2 f x : In Chater Section 3, we saw that in order to di erentiate the comosition of two functions of one variable we had to al the chain rule. More exlicitl, if f; g : R R, then (f g) (x) = f (g(x)) g (x) : (6.4) The roblem now is the following. Suose that we have two vector-valued functions G : R n R m and F : R m R r. We want to write the artial derivatives of the comosite function F G in terms of the artial derivatives of F and G. F G : R n G R m F R r :
6.3 Chain rule 75 Theorem 9 The matrix of artial derivatives of F G equals the roduct of the matrix of artial derivatives of F comosed with G with the matrix of artial derivatives of G, i.e., T (F G) = (T F G) T G: (6.5) That is, instead of multiling the two derivatives as in the classic version of the chain rule (6.4), in the multidimensional case we multil the matrices of artial derivatives. Examle 2 Let G : R 2 R 2 (x; ) 7 ln ; x 3 : and F : R2 R 2 (x; ) 7 x sin ; x 2 + 2 so that (F G) (x; ) = ln() sin x 3 ; qln 2 + x 6 (6.6) Then, T F = sin x x 2 + 2 x cos x 2 + 2 and T G = 3x 2 : The matrix of artial derivatives of (6.6) is T (F G) = (T F G)T G. Since sin x cos (T F G) (x; ) = = sin x3 ln() cos x 3 ln A x 2 + 2 x x 2 + 2 (x=ln ;=x 3 ) we have T (F G) = sin x3 ln() cos x 3 ln A 3x 2 = 3x2 ln() cos x 3 3x 5 x 3 ln 2 +x 6 ln 2 +x 6 x 3 ln 2 +x 6 ln 2 +x 6 sin x3 ln ln 2 +x 6 ln 2 +x 6 A : (6.7) Exercise 2 Comute T (F G) directl from (6.6) and verif that it coincides with (6.7). It is not alwas straightforward to al the chain rule (6.5). For examle, if G; F : R 2 R are two function of two variables, we could consider the new function H (x; ) := F (G (x; ) ; ) : However, this function is not the comosition of F with G because, strictl seaking G is real valued and F deends on two variables so F G has no meaning. In order to obtain the artial derivative of H in terms of those of F and G, we need to work a little bit (but not much). Observe that H can be written as H = F e G if we de ne e G from G as eg : R 2 R 2 (x; ) 7 (G (x; ) ; ) :
6.3 Chain rule 76 Therefore, b (6.5), T H = T F G e T G: e Since we have Exlicitl, T F e G = T H = F F x (G (x; ) ; ) F G x (G (x; ) ; ) x ; (G (x; ) ; ) and T e G = G x G ; F G x (G (x; ) ; ) + F (G (x; ) ; ) : H x = F G (G (x; ) ; ) x x ; H = F G (G (x; ) ; ) x + F (G (x; ) ; ) : Examle 22 (Total Derivative) Let : R R 3, (t) = (x (t) ; (t) ; z (t)), be the trajector of a article on R 3, where t stands for the time. Let f : R 4 R, f = f (t; x; ; z), be a hsical observable that deends both on time and osition. The function f (t; (t)) = f (t; x (t) ; (t) ; z (t)) is a one-variable function. Its derivative df dt (with resect to time) is called the total derivative of f (with resect to t). Observe that we can write where Consequentl, df dt = (T f e) T e = t (t) f (t; (t)) = (f e) (t) 7 e : R R 4 t (t; x (t) ; (t) ; z (t)) : x ( (t)) ( (t)) z ( (t)) Bx (t) C (t) A z (t) = (t) + t x ( (t)) x (t) + ( (t)) (t) + z ( (t)) z (t): (6.8) Since ~v = (x (t); (t); z (t)) is the velocit of the article, Equation (6.8) is sometimes found in the literature as df dt = 3X t + (t; (t)) v i ; x i where we have rede ned the variables as x = x, x 2 =, and x 3 = z. i=
6.4 Change of variables 77 6.4 Change of variables In this section, we will learn how the artial derivatives of a function change under a change of variables. Roughl seaking, a change of variables of, let us sa, R n, is a di erentiable ma ' : R n R n and, consequentl, artial derivatives are transformed according to the chain rule (6.5). However, in some situations, we ma need to invert the change of variables and comute the matrix of artial derivatives T ' of the inverse ma ' : R n R n. The comutation of T ' ma be highl non-trivial comared with T ', the matrix of artial derivatives of the direct transformation. We will exemlif this with olar coordinates on R 2 and we will learn how to exress di erential oerators given in Cartesian coordinates in olar coordinates. The next result is a generalisation of the inverse function di erentiation rule (Chater Section 3). Proosition 23 Let ' : R n R n be bijective ma such that all its artial derivatives exist and consider ' : R n R n its inverse ma (i.e., ' ' = ' ' = Id). Let x 2 R n and = ' (x) 2 R n. Then T ' () = (T ') ' () = (T ') (x) : That is, the matrix of artial derivatives of ' evaluated at 2 R n equals the inverse of the matrix T ' evaluated at x. Examle 24 (olar coordinates) Let ' : R 2 R 2 be given b 7 ' : R 2 R 2 (r; ) (r cos ; r sin ) : This change of coordinates is usuall exressed as x = r cos ; = r sin : (6.9) Let f (x; ) be a function de ned on R 2. Regarded as a function of (r; ), B the chain rule, ef (r; ) = f (r cos ; r sin ) : (6.) Using (6.9), f e r = x x r + r ; f e = x x + : f e r = cos + x sin e f = r sin + r cos : x
6.4 Change of variables 78 These equations allow us to exress the artial derivatives of f considered as a function of the olar coordinates (r; ) in terms of the artial derivatives of f with resect to x and. In matrix notation, f e r f e A = (T ') x = cos r sin sin r cos x : If we now want to nd ( x f; f) in terms of ( r e f; e f), we have two otions. On the one hand, we can invert ' r = x 2 + 2 = tan x and then al the chain rule. On the other hand, we can invert T ', (T ') = r cos sin r r sin cos (6.) so that x = r r cos r sin sin cos f e r f e For examle, x (x; ) = cos f e r (r; ) r sin f e (r; ) where r and are given b (6.). A : (6.2) Di erential oerators such as the Lalacian involving artial derivatives are ver frequent in hsics. Suose now that we want to exress a di erential oerator, for examle the Lalacian = 2 x 2 + 2 2 in olar coordinates, that is, in terms of the artial di erential oerators r and. The advantage of having the Lalacian exressed in both Cartesian and olar coordinates is twofold. On the one hand, f is eas to calculate if f deends on the variables (x; ) but if, on the contrar, f e is a function of the olar coordinates (r; ) we need, rst of all, to rewrite r and in terms of x and and al the chain rule twice. On the other hand, some simle functions of (r; ) have a ver comlicated functional form when exressed in terms of (x; ). In those situations, aling the Lalacian in olar coordinates is easier. To start with, observe that, at the level of di erential oerators, Equation (6.2) reads = r cos sin : r r sin cos x r
6.4 Change of variables 79 Carring out the matrix roduct, From (6.3) and with the same notation as in (6.), we have Equivalentl, 2 f x 2 = x x = cos r = cos 2 2 f e r 2 + r 2 cos sin f e x = cos r r sin ; (6.3) = sin r + r cos : (6.4) r sin cos f e r r sin f e r cos sin 2 f e r + r sin2 f e r r sin cos 2 f e r + r 2 sin cos f e + r 2 sin2 2 f e 2 : (6.5) 2 f 2 = = sin r + r cos sin f e r + r cos f e = sin 2 2 f e r 2 r 2 sin cos f e + r sin cos 2 f e r + r cos2 f e r + r cos sin 2 e f r Adding (6.5) and (6.6) and using cos 2 + sin 2 =, we have r 2 cos sin f e + r 2 cos2 2 f e 2 : (6.6) f e = 2 f e r 2 + f e r r + 2 f e r 2 2 :