Lecture 5: Rules of Differentiation First order derivatives Higher order derivatives Partial differentiation Higher order partials Differentials Derivatives of implicit functions Generalized implicit function theorem Eponential and logarithmic functions Taylor series approimation First Order Derivatives Consider functions of a single independent variable, f : X R, X an open interval of R. R1(constant function) f() = k f'() = 0. R (power function) f() = n f'() = n n-1 R3 (multiplicative constant) f() = kg() f'() = kg'(). 1
Eamples R1-R3 3 3 #1 Let y = f() =. Find dy / d 1/3() 1/3-1 = 1/3() -/3. = () 1/3. Hence, d / d () 1/3 = # Let y = f() = 3, where f: R + R. Find dy /d = 0 #3 Let y = f() = 10 0. Find dy / d = (10) 0 0-1 = 0 1 = 0. #4 Let y = f() = 0 4/5. Find dy /d = 16-1/5. Two or more functions of the same variable: sum-difference Def 1. By the sum (difference) of any two real-valued l functions f() and g(), where f: D R and g: E R, we mean the realvalued function f g: D E R whose value at any D E is the sum (difference) of two real numbers f() and g(). In symbols we have (f g) () = f() g(), for any D E.
Rules R4 (sum-difference) g() = i f i () g'() = i f i '(). Remark: To account for differences, simply multiply any of the f i by -1 and use the multiplicative constant rule. Eamples #1 What is the slope of the curve y= f() = 3-3 + 5, when it crosses the y -ais? First find dy d d d 3 d d d 3 5 d dy / d = 3-3 = f(). When the curve crosses the y - ais, we have = 0. Hence, evaluate f() for = 0. f(0) = -3. Thus the slope at = 0 is -3. 3
Eamples 3 1/ # Find f() if f() = 7 5. Clearly we may write f() as f() = -7-1/ + 5 Hence f() = d d 1 / d 7 5 d d d f() = 1 + 7-3/ Product Def By the product of any two real valued functions f() and g(), where f: D R and g: E R, we mean the real function fg : D E R whose value at any D E is the product of the two real numbers f() and g(). 4
Product Rule R5 (product) h() = f()g() h'() = f'()g() + f()g'() Remark: This rule can be generalized as d [f1 = f f f d 1() f () f N ()] 1 ()[f () f 3 () f N ()] + ()[f 1 () f 3 () f N ()] + + f N ()[f 1 () f () f N-1 ()]. Let f() = 5 5 (5 + 6) Eample d Find f(). Here we may consider f() as the product of two d functions, say h() = 5 5, and g() = (5 + 6). d Hence d f() = dh g. Using the product rule we obtain d f() = ( 4 + ) (5 +6) + 5 + 5 = 4 5 + 6 4 + 10 + 1 + 5 + 5 = 5 5 + 6 4 + 15 + 1 + 5 f() = 6 5 + 6 4 + 15 + 1. 5
Quotient Def. The quotient of any two real-valued functions f() and g(), where f: D R, g: E R, is the real-valued function f/g: D E R, defined for g() 0, whose value at any D E is the quotient of the two real numbers f() / g(), g() 0. Quotient Rule R6 (quotient) h() = f()/g() h'() = [f'()g() g'()f()]/[g()] 6
Eamples #1 Find f(), where f() = 3, g() differentiable fn of. g ( ) 3g ( ) g( ) 3 g ( ) # Find d ( 1)( 3 4), d where 0 Here we must use the product rule and the quotient rule. ( 3 4) 3 ( 1) ( 1)( 3 4) 4 Composite functions Def The composite function of any two functions z = f(y) and y = g(), where g X Y Z f such that the domain of f coincides with the range of g, is a function h(), where h : X Z, defined by h() = f(g()) for every member X. Remark: The notation f o g is used to denote the composite function f(g()). 7
Eample ma u( 1, ) st I = p 1 1 + p = I/p -(p 1 /p ) 1 = g( 1 ) u( 1, I/p -(p 1 /p ) 1 ) = u( 1,g( 1 )) ma u( 1,g( 1 )) Eample Consider the two functions g: R R and f: R R defined by y = g() = 3-1 z = f(y) = y + 3 for any real numbers, y. From our definition we may form the function f g or f[g()]: f g = f[g()] = (3-1) + 3 = z, where f g is defined for every real. 8
Composite function rule R7 (chain) If z = f(y) is a differentiable function of y and y = g() is a differentiable function of, then the composite function f g or h() = f[g()] is a differentiable function of and h'() = f[g()] g(). Remark: This rule can be etended d to any finite chain. e.g., h = f(g(r())) h' = f'(g)g'(r)r'() Eamples #1 Let z = 6y + 1/y and y =3. Then but y = 3 dz d = dz dy dy d =(6 + y)3 dz = (6 + 3) 3 = 9 + 18 d 9
Eamples # Let z = y 1, y = 5 y dz d = 1 ( y ) y( y 1 ) (5) ( y ) = 5( y y y) 5( y y) 5y 10y y( 5y 10) 4 4 4 4 y y y y dz = ( 5y 10) 3 d y but y = 5 dz d = 55 ( ) 10 ( 5) 3 Inverse function Def. The inverse function of a function y = f(), where f: X Y, is a function = f -1 (y), where f -1 : f[x] X. We have that y = f() if and only if = f -1 (y) for all (,y) Gr(f). Proposition If the function y = f() is one- Proposition. If the function y = f() is oneto-one, then the inverse function = f -1 (y) eists. 10
Inverse function A one-to-one function defined on real numbers is called monotonic. A monotonic function is either increasing or decreasing. Def. A monotonic function f(), f: R R is monotonically increasing iff for any, R, > implies f() > f(). Def. A monotonic function f(), f: R Ri is a monotonically decreasing function iff for any, R, > implies f() < f(). Inverse function Remark: A practical method of determining i whether a particular differentiable function is monotonic is to see if its derivative never changes sign. (> 0 if, < 0 if ) 11
Eample Direct demand Q = D(p) Inverse demand p = D -1 (Q) = p(q) Q = 5-p. What is inverse demand? Inverse function rule R8 (inverse function) Given y = f() and = f -1 (y), we have f -1' (y) = 1/f'(). Proposition. If a function y = f(), f : X Y, is one-to-one, then (i) the inverse function = f -1 (y) eists, (ii) f -1 (y) is one-to-one, (iii) (f -1 ) -1 = f. 1
Let y = f() = 5 + 4, f: R R. Eamples f is bijective f -1 (y). Now find f -1 (y) = y 4 5 = d d f() and d dy f -1 (y) and compare. d d f() = 5, then by inverse fn rule d d -1 = ( 15 ) 0 5 1 dy f (y) 5 5 5 From above we see that y = 5 + 4 = 1 5 y - 4/5 are both bijective. dy f -1 (y) should = 1/5. Higher Order Derivatives If a function is differentiable, then its derivative function is itself a function which may possess a derivative. If this is the case, then the derivative function may be differentiated. This derivative is called the second derivative. If a derivative of the second derivative function eists, then the resultant derivative is called the third derivative. 13
Higher Order Derivatives Generally, if successive derivatives eist, a function may have any number of higher order derivatives. The second derivative is denoted f''() or d f/d and the nth order derivative is given by d n f/d n. Eample: Let f() = 3 5 + 10. We have that f' = 15 4 + 10, f'' = 60 3, and d 3 f/d 3 = 180. Partial derivatives Here we consider a function of the form y = f( 1,, n ), f: R n R. Short-hand notation: y = f(), where R n. 14
Partial derivative: definition Def. The partial derivative of the function f( 1,,, n ), f: R n R, at a point ( o 1, o,, o n) with respect to i is given by lim o y i 0 0 0 0 f( 1,..., i i,, N) f( 1,, N) i 00 i Notation Notation: We denote the partial derivative, lim i 0 y i, in each of the following ways. f i (), f()/ i or i f(). 15
Illustration f f 1 o 1 o Summary The mechanics of differentiation are very simple: When differentiating with respect to i, regard all other independent variables as constants Use the simple rules of differentiation for i. 16
Eamples #1 Let y = f( 1, ) = 1 + + 3 then f 1 = 1 and f = 1 # Let y = f( 1,, 3 ) = ( 1 + 3) ( + 4) ( 3 ) f = 1 ( + 4) ( 3 ) 1 #3 Let y = f( 1, ) = 1 4 + 10 1 f 4 = 1 1 + 10 Etensions of the chain rule a. Let y = f( 1,..., n )where ), i = i ( 1 )fori= ),,...,n. We have that dy/d 1 = f/ 1 + n f i i d d i 1. b. Let y = f( 1,...,, n ), where i i = i (u). Then we have that dy/du = n f i 1 i d i du. 17
Etensions of the chain rule c. Let y = f( 1,..., n ), where i = i (v 1,...,v m ), for all i. Then we have that y/v j = n f i 1 i v i j. Eample Let y = f( 1, ) = 3 1 +, where 1 = v +u and = u + 5v. Find y / u, y / v 18
Higher order partial derivatives A first order partial derivative function is itself a function of the n independent d variables of the original function. Thus, if this function has partial derivatives, then we can define higher order partial derivative functions. The most interesting ti are the second order partial derivative functions denoted f ij () = f / R n i j. Higher order partial derivatives If i and j are equal, then f ii is called a direct second order partial derivative and if ij, f ij is called a cross second order partial derivative. We can associate a matri of partial derivatives to each point ( 1,..., n ) in the domain of f. The matri is defined by H( o )= [f( ij o )] i,j = 1,,n and it is called the Hessian of f at the arbitrary point o. 19
Eamples #1. Let f = ( 1 + 3)( + 4) 3. We have that f 1 = ( + 4) 3, f 11 = 0, f 1 = 3, f 13 = ( + 4) f = ( 1 + 3)( 3 )( ), f = ( 1 + 3) 3, f 1 = 3, f 3 = ( 1 + 3)( ). f 3 = ( 1 + 3)( + 4), f 3 = ( 1 + 3)( ), f 31 = ( + 4), f 33 = 0. #. Let f = 1. f 1 =, f 1 = 1, f 11 = 0, f = 1, f 1 = 1, f = 0. The Hessian at any point ( 1, ) is given by H = 0 1 1 0 = f f f 11 1 f 1. A result Young's Theorem. If f(), R n, possesses continuous partial derivatives at a point, then f ij = f ji at that point. Eample: f = y. Show f y = f y. 0
Differentials Given that y = f(), a will generate a y as discussed d above. When the is infinitesimal we write d, which, thus, generates an infinitesimal change in y, dy. The first order differential of y = f() is dy = df = f'()d. Eample f() () = 3 +, find dy: dy = f() d dy = (3 + ) d. 1
Functions of Many Variables Given y = f( 1, n ), the differential of f is given by df = i f i () d i. Some rules Proposition 1. If f( 1,,, n ) and g( 1,,, n ) are differentiable functions of the variables i ( i = 1,, n), then (i) (ii) (iii) (iv) d (f n ) = nf n-1 df d (f g) = df dg d (f g) = gdf + fdg f d = gdf fdg, g 0. g g
Eample Let f = ( 1 + 3 )/ 1, find df. df = 3 1 3 1 d1 ( ) ( ) 1 1 d. nd order differential It is also possible to take a differential of a first order differential so as to define a second order differential. d f = n i=1 i1 n i1 j=1 f ij d i d j. We have that d f can be epressed as a quadratic form in d: d'hd, 3
Derivatives of Implicit Functions Implicit relationships between two variables and y are often epressed as equations of the form F(, y) = 0. If possible, we would like to define eplicit functions say = (y) and y = y() from this relation. We would also like to define the derivatives of such functions. Eample A circle with radius and center 0: F(, y) = + y 4 = 0. y + y - 4 = 0 - - 4
Eample Here every (-, ) is associated with two values of y. It is possible to define two functions: y = f() = 4, where f: [-, +] [0, ] y = g() = - 4, where g: [-, +] [-, 0]. A result: basic IFT Proposition 1. The relation F(, y) = 0 defines one or more differentiable implicit functions of the form y = f(), at some point, if F / y 0. We have that dy F /. d F / y 5
Our Eample y =f() = 4 ;f:[-, +] [0, ] y = g() = - 4 ; g: [-, +] [-, 0] f '() = -(4 - ) -1/ = -/y g'() = + (4 - ) -1/ = -/y Use IFT on + y 4 = 0. dy d F / F y y / y, 6
A generalization Proposition. The relation F( 1,, 3,, N ) = 0 defines one or more differentiable i implicit i functions of the form i = f i ( j ), at j, if F / i 0, i, j=1,, N, i j. We have that i j F / F / i j. Eample 13 + 3 = 0. Find / 3 3 F 3 / 3 F/ ( ), for ( 3 1 + 3 ) 0. 1 3 7
A Generalized Implicit Function Theorem Consider a system of n equations 0 = F i (y 1,...y n, 1,..., m ), i = 1,...,n. The variables y 1,...,y n represent n independent variables and the 1,..., m represent m parameters. Write as y R n and R m. The Jacobian of the System 1 1 F / y1 F / y J y = n n F / y 1 F / y n y n 8
9 General IFT Proposition 3. Let F i (y,) = 0 possess continuous partial derivatives in y and. If at a point i (y o, o ), J y 0, then n functions y i = f i ( 1,..., m ) which are defined in a neighborhood of o. We have (i) F i (f 1,...f n, o ) = 0, i, (ii) y i = f i ( ) are continuously differentiable in locally y k 1 / F 1 / y k 1 / F 1 / (iii) J y y y k n k 1 / / = F F k n k / / and y y k n k 1 / / = J y -1 F F k n k / /. Cramer's Rule and IFT Remark: Using Cramer's Rule we have that Remark: Using Cramer's Rule, we have that y i / k = J yi / J y.
Eample Eample: Solve the following system for system y 1 / and y /. y 1 + 3y - 6 = 0 y 1 + y = 0. Eponential and Logarithmic Functions An eponential function is a function in which h the independent d variable appears as an eponent: y = b, where b > 1 We take b > 0 to avoid comple numbers. b > 1 is not restrictive because we can take (b -1 ) = b - for cases in which b (0, 1). 30
Logarithmic A logarithmic function is the inverse function of b. That is, = log b y. A preferred base is the number e.7. More formally, e = lim [1 + 1/n] n. e is called the n d natural logarithmic i base. It has the desirable property that t e = e. The corresponding log d function is written = ln y, meaning log e y. Illustration b y 1 31
Rules of logarithms R. 1: If, y > 0, then log (y) = log y + log. Proof: e ln = and e ln y = y so that y = e ln e ln y = e ln+lny. Moreover y = e lny. Thus, e ln+lny = e lny. Rules of logarithms R. : If, y > 0, then log (y/) = log y - log. Proof: e ln = and e ln(1/y) = y -1 so that /y = e ln e ln(1/y). Moreover /y = e ln/y. Thus, e ln e ln(1/y) = e ln/y and ln + ln(y -1 ) = ln/y. Using rule 3 (to be shown) the result holds. 3
Rules of logarithms R. 3: If > 0, then log a = a log. Proof: e ln = and a e ln = a. However, a = (e ln ) a = e aln a. Thus, e ln = e aln. Conversion and inversion of bases conversion log b u = (log b c)(log c u) (log c u is known) Proof: Let u = c p. Then log c u = p. We know that log b u = log b c p = plog b c. By definition, p = logc u, so that logb u = (logc u)(logb c). 33
Conversion and inversion of bases inversion log b c = 1/(log c b) Proof: Using the conversion rule, 1 = log b b = (log b c)(log c b). Thus, log b c = 1/(log c b). Derivatives of Eponential and Logarithmic Functions. R. 1: The derivative of the log function y = ln f() is given by d y d f f ( ) ( ) 34
Derivatives of Eponential and Logarithmic Functions R. : The derivative of the eponential function y = e f() is given by dy d = f()ef(). Derivatives of Eponential and Logarithmic Functions R. 3: The derivative of the eponential function y = b f() is given by dy d = f()bf() ln b. 35
Derivatives of Eponential and Logarithmic Functions R. 4: The derivative of the logarithmic function y = log b f() is given by dy d f ( ) 1 f ( ) ln b Eamples #1 Let = e y 4, th en dy d = 4 e 4. # L et y = [ln (16 )] dy d = 3 16 + ln(16 ) = + ln16 = + (ln16 + ln) = (1 + ln16) + 4 ln. 36
Eamples #3 Let y = 6 17, then f' = ( + 17) 6 17ln 6. The Taylor Series Approimation It is sometimes of interest to approimate a function at a point with the use of a polynomial function. Linear and quadratic approimations are typically used. Let y = f(). 37
The Taylor Series Approimation A Taylor's Series Approimation of f at o is given by k f() f( o i o 1 d f ( ) o i ) + i ( ). i! d i1 Linear Approimation A linear approimation takes k = 1. This is given by f() f( o ) + [df( o )/d](- o ) = [f( o ) f '( o ) o ] + f '( o ). Defining, a [f( o ) f '( o ) o ] and b f '( o ), we have f() a + b. 38
Illustration f( o ) [f( o ) f ' ( o ) o ] A Note that A = f (f f ') and A/ = f ' o Quadratic Approimation A quadratic approimation takes k =. We have that or o f() f( o ) + f '( o )(- o f ''( ) o ) + ( ). f() [f( o ) f '( o ) o +f''( ''( o )( o ) /] + [f '( o ) o f ''( o )] +[f ''( o )/] This is of the form f() a + b + c. 39
Functions of many variables General linear n f() f( o o o ) + f i ( )( i i ). i1 Define f()' (f 1() f n()) and term this the gradient of f. Then we have f() f( o ) + f( o )'( o ), Functions of many variables Quadratic f() f( o ) + f( o )'( o ) + 1 o o f ( )( )( o i j ij i i j j ' ). or f() f( o ) + f( o )'( o ) + 1 ( o )'H( o )( - o ). 40
Eamples Consider the function y =. Let us construct a linear approimation at = 1. f + 4( 1) = - + 4. A quadratic approimation at = 1 is f + 4( 1) + (4/)(-1) = + 4 4 + ( + 1) = + 4 4 + 4 + ) f =. Given that the original function is quadratic, the approimation is eact. Eamples. Let y = 3 1. Construct a linear and a quadratic approimation of f at (1,1). The linear approimation is given by f 1 + 3( 1 1) + 1( 1). Rewriting, f -3 + 3 1 +. A quadratic approimation is constructed as follows: 1 6 3 1 1 f 1 + 3( 1 1) + 1( 1) + [ 1 1 1] 3 0. 1 Epanding terms we obtain the following epression. f 3-6 1 - + 3 1 + 3 1. 41