Week 6: 5.11.2012 - 10.11.2012 Faggian@unive.it Mathematics II: A few (solved) problems 1 Domain of a function of many variables [11.1] Recall that a real function of n real variables is a function which domain is a subset D of Rn , and which attains real values: f : D ⊆ Rn → R , x2 , ..., x3 ) 7−→ (x1 z = f (x1 , x2 , ..., x3 ) Sometimes a real function is given in terms of the map, and it is asked to determine its domain, or natural domain. It means to determine the largest subset of R2 where the function is defined (makes sense). 1. Solve exercises [SH 11.1], in particular #3, 4, 6, 7 pp.380-381. 2. Determine the domains of the functions given by the following formulas and draw them in the xy plane: 2 (a) f (x, y) = ln (4 − x2 − y 2 ) p (b) f (x, y) = x2 − 3x + 2 + y [R: D = {(x, y) ∈ R : x2 + y 2 < 4}] 2 [R: D = {(x, y) ∈ R : y ≥ −x2 + 3x − 2}] 1 (c) f (x, y) = √ ex x+y−1 (d) f (x, y) = 1−x exy −2 ln(x+y) xy (e) f (x, y) = (f) f (x, y) = −x2 }] q x2 +y x 2 [R: D = {(x, y) ∈ R : x + y ≥ 0, x + y 6= 1, x 6= 0}] 2 [R: D = {(x, y) ∈ R : y 6= ln 2 x }] 2 [R: D = {(x, y) ∈ R : x 6= 0, y 6= 0, x + y > 0}] 2 2 [R: D = {(x, y) ∈ R : x > 0, y ≥ −x2 } ∪ {(x, y) ∈ R : x < 0, y ≤ 2 2 2 (g) f (x, y) = √ ln(x−y) [R: D = {(x, y) ∈ R : x9 + y18 < 1, x > y}] 18−2x2 −y 2 p (h) f (x, y) = y 2 − x2 + ln(x2 + y 2 − 1) Solution of (h) The domain of f is given by the intersection of two sets, namely D = D1 ∩D2 , where: 2 2 D1 = {(x, y) ∈ R : x2 + y 2 > 1}, D2 = {(x, y) ∈ R : y 2 − x2 ≥ 0} Note that D1 is the complement set of R2 of the circle with center at the origin and radius 1. To write D2 in a more explicit form, we can observe that: y 2 − x2 ≥ 0 ⇔ (x + y)(x − y) ≥ 0 ⇔ (x ≥ y, x ≥ −y) ∨ (x ≤ y, x ≤ −y) thus 2 2 D2 = {(x, y) ∈ R : x ≥ y, x ≥ −y} ∪ {(x, y) ∈ R : x ≤ y, x ≤ −y}. 1 3. Determine and plot in R2 the domain of the following functions: q √ 2 +y 2 −4] 1 a) f (x, y) = √xy−3 + ln( y − x − x) b) f (x, y) = ln[(x−1) y−x Solution. a) In order for the function f to be defined: √ 1 has to be defined, which means xy − 3 ≥ 0 and xy − 3 6= 0, thus xy > 3. • √xy−3 √ • the argument of the square root in ln( y − x − x) need be positive, thus y ≥ x, moreover the √ argument of the logarithm need to be strictly positive, namely y − x − x > 0. Since all of these conditions have to hold simultaneously, the domain is the intersection of the two sets: √ D = {(x, y) : xy > 3} ∩ {(x, y) : y − x − x > 0, y ≥ x} Nevertheless, if we want to draw the domain in the xy-plane, we need to be more explicit: • Note that condition xy > 3 is satisfied if and only if (iff) x and y have the same sign: xy > 3 ⇔ x>0 ∨ y > x3 x<0 y < x3 thus, the first set can be written as the union of two sets; 3 3 {(x, y) : xy > 3} = (x, y) : x > 0, y > ∪ (x, y) : x < 0, y < x x • Moreover, note that: √ y−x>x⇔ y≥x y≥x x≥0 ∨ x<0 y − x > x2 thus (x, y) : √ y − x > x ⇔ (x, y) : y ≥ x, x > 0, y > x2 + x ∪ {(x, y) : y ≥ x, x < 0} In the end, summing up all these information we have: D= 3 3 2 (x, y) : y < , x < 0, y ≥ x ∪ (x, y) : y > , x > 0, y ≥ x, y > x + x x x b) (Sketch) D = D1 ∪ D2 where D1 = (x, y) : 4 < (x − 1)2 + y 2 ≤ 5, y < x D2 = (x, y) : (x − 1)2 + y 2 ≥ 5 ∩ {(x, y) : y > x} 2 2 Partial derivatives [11.2, 11.4, 11.5, 11.6] 4. Solve exercises from [SH 11.2] in particular #3, 4, 5, 6, 8 and from [SH 11.6] #2, 3, 6, 7. 5. Find partial derivatives of the functions in exercise 3. Are the partial derivatives defined at all points of the domain of the function? Solution. We refer to the domain of any of the function in exercise 3 with D, and to the domain of their derivatives with D0 . a) Partial derivatives are defined in all of the domain of f , namely D = D0 fx (x, y) = −2x ; 4 − x2 − y 2 fx (x, y) = −2y . 4 − x2 − y 2 b) Partial derivatives are not defined in all D, but in D0 = D r {(x, y) : x2 − 3x + 2 + y = 0} √ [note that the function t 7→ t is not differentiable at 0] 2x − 3 ; fx (x, y) = p 2 2 x − 3x + 2 + y 1 fx (x, y) = p . 2 2 x − 3x + 2 + y c) Partial derivatives are defined in D0 = D r {(x, y) : x + y = 0} and are given by: 1 fx (x, y) = −e x √ 2 x + y − 2 − x2 √ √ 2; 2x2 x + y ( x + y − 1) 1 ex fx (x, y) = − √ √ 2. 2 x + y ( x + y − 1) d) D0 = D and fx (x, y) = 2 − exy (1 + y − xy) 2 (exy − 2) ; fx (x, y) = − xexy (1 − x) (exy − 2) 2 . e) D0 = D and fx (x, y) = − 1 1 ln (x + y) + ; x2 y xy (x + y) fx (x, y) = f) D0 = D r {(x, y) : y = −x2 } and r 1 x 1 2 fx (x, y) = 2− 2 y+x ; 2 y + x2 x y − (x + y) ln (x + y) . xy 2 (x + y) 1 fx (x, y) = 2x r x . y + x2 g) D0 = D and fx (x, y) = 2x(x − y) ln (x − y) − 2x2 − y 2 + 18 (x − y) (18 − 2x2 − y 2 ) 3 2 ; fx (x, y) = y(x − y) ln (x − y) − 2x2 − y 2 + 18 3 (x − y) (18 − 2x2 − y 2 ) 2 h) D0 = D r {(x, y) : |x| = |y|} and fx (x, y) = − 2x x ; −p 2 2 2 1−x −y y − x2 3 fx (x, y) = − 2y y +p 2 2 2 1−x −y y − x2 . 6. Find second order partial derivatives of the functions in exercise 4. 7. Find the domain and the first partial derivatives (with respect to x, y and z) of the following functions with three variables. Are derivatives defined at all points of the domain of the function f? a) f (x, y, z) = x−yz 2 x+y 2 + exz p + z ln( x − y 2 ) b) f (x, y, z) = 3x p c) f (x, y, z) = 2xy − y 2 + (x3 − 2z)5 Solution. a) We have D0 = D = {(x, y, z) ∈ R3 : y 6= −x} and xz fx (x, y, z) = ze + z2 + 1 y 2 (x + y) ; fy (x, y, z) = − z2 + 1 x 2 (x + y) ; fz (x, y, z) = xexz − 2y z . x+y b) The function is defined in D = {(x, y, z) ∈ R3 : x ≥ y 2 } while partial derivatives are defined in D0 = {(x, y, z) ∈ R3 : x > y 2 } and are given by 2 fx (x, y, z) = 2x (ln 3) 3x + p yz 1 z ; fy (x, y, z) = − ; fz (x, y, z) = ln x − y 2 . 2 2 2x−y x−y c) The domain of the function is D = {(x, y, z) ∈ R3 : (2x − y) y ≥ 0} while partial derivatives are defined in D0 = {(x, y) : (2x − y) y > 0} and given by fx (x, y, z) = 15x2 x3 − 2z fy (x, y, z) = p fz (x, y, z) = −10 x3 − 2z x−y 2xy − y 2 4 +p y 2xy − y 2 ; ; 4 . 8. Find the second order partial derivatives of the function a) in exercise 8. Solution. A function in n variables has n first partial derivatives and n2 second partial derivatives. For n = 3, we thus have 9 second partial derivatives, which we can write in a “table”1 . (z2 +1)y (z2 +1)(x−y) 2yz exz (1 + xz) + (x+y) z 2 exz − 2 (x+y)3 3 2 fxx fxy fxz (x+y) (x−y)(z 2 +1) fyx fyy fyz = 2x(1+z 2 ) 2xz − 3 3 2 (x+y) (x+y) (x+y) fzx fzy fzz 2y z −2xz xz xz 2 xz e + xze + 2y (x+y)2 − x+y + x e (x+y)2 1 Such a table is called the Hessian matrix of the function f. 4 9. Find the gradient of f (x, y, z, t) = t2 2z 2 + xyt − z2t+y . Solution. The gradient of a function of n variables is an ordered set of n real values (namely, a vector in Rn ) composed by the n partial derivatives (one with respect to each variable). In this case, we have a vector of dimension 4 2 2 2 t 1 t2 + xy − z2t+y ln 2 . ∇f (x, y, z, t) = ty; tx − 2 ln 2 yz 2t+y ; − 2 − 2t+y ; 2z z 10. The function u(x, y) = lnyx represents the utility (a measure of happiness) associated to consumption of some goods x and y. Find an approximate variation of the function given by the increase of one unit of the good x, when y is fixed, and the variation of the function given by the increase of one unit of good y, when x is fixed, around the point (2,-1) of the domain. Is u suitable to represent a utility where x is the number of cars and y the level of pollution? If it is so, explain to which extent. 3 Level sets [11.3] Recall that a level curve at height k of a function of two variables f : D ⊆ R2 → R is the subset of the domain of the function (hence also a subset of R2 ) given by Γk = {(x, y) ∈ D : f (x, y) = k} The equation of such level curve is f (x, y) = k (do not forget to require that (x, y) lies in the domain D). 11. Solve exercises from [SH 11.3] in particular # 3, 4, 5, 7, 8, 9. 12. Draw level curves of f, after rewriting their equation in a suitable (more explicit) way. q x2 for k = 1, k = −2, k = 0 a) f (x, y) = y+1 b) f (x, y) = −x2 + 4y −y 2 − 6y for k = −3, k = 14, k = 13. For which k the curve is the null set? c) f (x, y) = x2 − 4x − y + 20 for k = 4, k = 10, k = 20 √ d) f (x, y) = x2 −2 y for k = −1, k = 0, k = 1 Solution. a) Let Γk be the level curve at height k of f , namely s ( ) x2 2 Γk = (x, y) ∈ R : =k y+1 For k = 1 it represents the graph of a parabola deprived of the point (0, −1) s x2 x2 y = x2 − 1 =1⇔ =1⇔ y 6= −1, x 6= 0 y+1 y+1 5 namely2 Γ1 = (x, y) ∈ R2 : y = x2 − 1 r {(0, −1)} q x2 = −2 has no solution3 , thus Differently, for k = −2, the equation y+1 Γ−2 = ∅ Finally, Γ0 is the y – axis, deprived of the point (0, −1): s ( ) 2 x Γ0 = (x, y) ∈ R2 : = 0 = {(0, y) ∈ R2 : y 6= −1} y+1 b) (Sketch) The equation of Γ−3 is −x2 + 4y − y 2 − 6y = −3, so that multiplying both sides by −1, and completing the square, we equvalently derive 2 −x2 + 4y − y 2 − 6y = −3 ⇔ (x − 2) + (y + 3)2 = 16 namely the level curve is a circle with center (2, −3) and radius 4. n o 2 Γ−3 = (x, y) ∈ R2 : (x − 2) + (y + 3)2 = 16 Similarly, Γ14 = Γ13 = n o 2 (x, y) ∈ R2 : (x − 2) + (y + 3)2 = −1 = ∅ n o 2 (x, y) ∈ R2 : (x − 2) + (y + 3)2 = 0 = {(2, −3)} c) (Sketch) The level curves k are all convex parabola: y = x2 − 4x + 20 − k For k = 4 ... 13. [SH, 11.3 #4] Show that x2 − y 2 = c is a level curve for: 2 2 f (x, y) = ex e−y + x4 − 2x2 y 2 + y 4 for every value of c. Solutions. Let’s rewrite f as follows f (x, y) = ex 2 −y 2 + x2 − y 2 2 and A = {(x, y) ∈ R2 : x2 − y 2 = c} 2 Similarly, for every k > 0 Γk = 3 More (x, y) ∈ R2 : y = y = generally, it is true that Γk = ∅ for every k < 0. 6 x2 − 1 r {(0, −1)} 2 k We need to show that the points of A belongs to the same level curve of f .4 In fact, given a number (x0 , y0 ) in A, at that point we have 2 2 f (x0 , y0 ) = ex0 −y0 + x20 − y02 2 = ec + c2 namely, all points in A belong to the same level curve k = ec + c2 of f. 14. Show that all the points of the straight line of equation y = 2x belong to the level curve at height 0 of f (x, y) = x2 − 4y 2 Are those the only points of such level curve of f ? Solution. The function can be written as f (x, y) = (y − 2x)(y + 2x) and can be evaluated at the points of the line, which are all points with coordinates (x, 2x): f (x, 2x) = (2x − 2x)(2x + 2x) = 0 thus, we have shown the first assertion. Nevertheless, the level curve at height 0 of f is given by the union of the previous straight line and that of equation y = −2x Γ0 = {(x, y) : (y − 2x)(y + 2x) = 0} = {(x, y) : y − 2x = 0} ∪ {(x, y) : y + 2x = 0} 4 Linear Approximation and tangent plane [12.8] 15. Given the function f (x, y) = x2 + y 2 − x + y find the tangent plane at (1, 1) and at (2, 2). Solution. The equation of the tangent plane at (x0 , y0 ), to the graph of f is given by z = z0 + a(x − x0 ) + b(y − y0 ) where z0 = f (x0 , y0 ) , a = ∂f ∂f (x0 , y0 ) , b = (x0 , y0 ) ∂x ∂y Thus the equation of the tangent plane at (1, 1) is z = z0 + a(x − 1) + b(y − 1) 4 It might be easier if the text of the exercises would have been: ”Show that all the points of the set A = {(x, y) ∈ R2 : x2 − y 2 = c} belong to the same level curve of f ” and, in particular, at the level curve k = ec + c2 . As a matter of fact, if it is easy to prove that those points belong to the level curve k (we only need to check that the function has k as a constant value at those points), it is not obvious that those are the unique points to belong to the curve. To understand more clearly, see the next exercise. 7 with z0 = f (1, 1) = 2 ∂f a = (1, 1) = [2x − 1]x=1,y=1 = 1 ∂x ∂f b = (1, 1) = [2y + 1]x=1,y=1 = 3 ∂y namely 2 + (x − 1) + 3(y − 1) z = z = x + 3y − 2 Similarly, the equation of the tangent plane at (2, 2) is z = 8 + 3(x − 2) + 5(y − 2) 16. Given the function f (x, y) = x2 y − (x + y)2 Find the set of points (x, y) of the domain of f where the tangent plane is horizontal (namely, parallel to the xy – plane). Solution. Note that: a) The equation of a plane parallel to the xy – plane is of type z = z0 where z0 is a constant, namely, the plane is given by the set of all points (x, y) where f take the value z0 . (Note that the variables x and y do not appear in the equation.) b) We have seen in the previous exercise that the tangent plane to the graph of f at the point (x0 , y0 , f (x0 , y0 )) is z = z0 + a(x − x0 ) + b(y − y0 ) ∂f where z0 = f (x0 , y0 ) , a = ∂f ∂x (x0 , y0 ) , b = ∂y (x0 , y0 ) . To have x and y not in the equation we necessary need to have a and b null, namely the partial derivatives of f in (x0 , y0 ) . Thus, the tangent plane is horizontal (i.e. of type z = z0 ) if and only if a = 0 and b = 0, that is iff partial derivatives are null. Then such points are solutions to ( ∂f ∂x (x, y) = 0 ∂f ∂y (x, y) = 0 In our case: thus ( ∂f (x, y) = 2(xy − x − y), ∂x ∂f ∂x ∂f ∂y (x, y) = 0 ⇔ (x, y) = 0 ∂f (x, y) = x2 − 2(x + y) ∂y xy − x − y = 0 ⇔ x2 − 2(x + y) = 0 8 ( y (y−1) y 2( (y−1) + x= 2 y (y−1)2 − y) = 0 Let’s solve the second equation respect to y: y2 2y 2 − 2 (y − 1) y−1 = ⇔ y 2 − 2y 3 + 2y 2 =0 (y − 1)2 y 2 (3 − 2y) =0 (y − 1)2 0⇔ ⇔ y 2 (3 − 2y) = 0 3 ⇔ y = 0 or y = 2 Then we derive the corresponding x by means of the first equation, obtaining the solutions (0, 0) and 3, 23 . 17. Find the points on the surface of equation z = x4 − 4xy 3 + 6y 2 − 2 at which the tangent plane is horizontal. Solution. the system To have an horizontal plane, partial derivatives of f need to be null. Thus we solve ( so that ∂f 3 3 ∂x (x, y) = 4x − 4y = 0 ∂f ∂y (x, y) = 12y(1 − xy) = 0 4(x − y)(x2 + y 2 + xy) = 0 ⇔ 12y(1 − xy) = 0 x=y 12y(1 − y 2 ) = 0 Since the second equation holds for y ∈ {0, 1, −1}, by substituting those values in the first equation we get the coordinates of the points we were searching for (1; 1), (0, 0), (−1, −1). 18. Given the function f (x, y) = 4xy 2 + exy find the linear approximation of f (x, y) about (1, 0). Compute the exact value of f (0.99, 0.01) and compare it with the approximate value of the function obtained by means of the linear approximation at that point. Solution. Note that f (1, 0) = 1. The linear approximation of the function f (x, y) at the point (x0 , y0 ) is given by the polynomial P (x, y) = f (x0 , y0 ) + fx0 (x0 , y0 )(x − x0 ) + fy0 (x0 , y0 )(y − y0 ), In this case (x0 , y0 ) = fx0 (1, 0) = (1, 0) xy ye + 4y 2 x=1,y=0 = 0 fy0 (1, 0) = [8xy + xexy ]x=1,y=0 = 1 so that P (x, y) = 1 + y The exact value of f (0.99, 0.01) is f (0.99, 0.01) = 4xy 2 + exy x=0.99,y=0.01 = 1. 010 345 167 9 the value of the linear approximation is P (0.99, 0.01) = [1 + y]x=0.99,y=0.01 = 1.01 so that f (0.99, 0.01) ≈ P (0.99, 0.01). 10