Surfaces and Partial Derivatives James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University November 9, 2016 Outline Partial Derivatives Tangent Planes
Let s go back to our simple surface example and look at the traces again. In this figure, we show the traces for the base point x0 = 0.5 and y0 = 0.5. We have also drawn vertical lines down from the traces to the x y plane to further emphasize the placement of the traces on the surface. The surface itself is not shown as it is somewhat distracting and makes the illustration too busy. You can generate this type of graph yourself with the function DrawFullTraces as follows: D r a w F u l l T r a c e s ( f, 0. 5, 2, 0. 5, 2, 0. 5, 0. 5 ) ; Note, that each trace has a well-defined tangent line and derivative at the points x0 and y0. We have d dx f (x, y0) = d dx (x 2 + y 2 0 ) = 2x as the value y0 in this expression is a constant and hence its derivative with respect to x is zero. We denote this new derivative as f x which we read as the partial derivative of f with respect to x. It s value as the point (x0, y0) is 2x0 here. For any value of (x, y), we would have f x = 2x.
We also have d dy f (x0, y) = d dy (x 2 0 + y 2 ) = 2y We then denote this new derivative as f y which we read as the partial derivative of f with respect to y. It s value as the point (x0, y0) is then 2y0 here. For any value of (x, y), we would have f y = 2y. The tangent lines for these two traces are then T (x, y0) = f (x0, y0) + d dx f (x, y0) (x x0) x0 = (x0 2 + y0 2 ) + 2x0(x x0) T (x0, y) = f (x0, y0) + d dy f (x0, y) (y y0) y0 = (x0 2 + y0 2 ) + 2y0(y y0). We can also write these tangent line equations like this using our new notation for partial derivatives. T (x, y0) = f (x0, y0) + f (x0, y0) (x x0) x = (x0 2 + y0 2 ) + 2x0(x x0) T (x0, y) = f (x0, y0) + f (x0, y0) (y y0) y = (x0 2 + y0 2 ) + 2y0(y y0).
We can draw these tangent lines in 3D. To draw T (x, y0), we fix the y value to be y0 and then we draw the usual tangent line in the x z plane. This is a copy of the x z plane translated over to the value y0; i.e. it is parallel to the x z plane we see at the value y = 0. We can do the same thing for the tangent line T (x, y0); we fix the x value to be x0 and then draw the tangent line in the copy of the y z plane translated to the value x0. We show this in the next figure. Note the T (x, y0) and the T (x0, y) lines are determined by vectors as shown below. 1 0 A = 0 1 d dx f (x, y0) = 0 and B = 1 0 d 2x0 dy x0 f (x0, y) = 1 2y0 y0 Note that if we connect the lines determined by the vectors A and B, we determine a flat sheet which you can interpret as a piece of paper laid on top of these two lines. Of course, we can only envision a small finite subset of this sheet of paper as you can see in the figure below. Imagine that the sheet extends infinitely in all directions! The sheet of paper we are plotting is called the tangent plane to our surface at the point (x0, y0). We will talk about this more formally later.
To draw this picture with the tangent lines, the traces and the tangent plane, we use the function DrawTangentLines which has arguments (f,fx,fy,delx,nx,dely,ny,r,x0,y0). There are three new arguments: fx which is f / x, fy which is f / y and r which is the size of the tangent plane that is plotted. For the picture shown next, we ve removed the tangent plane because the plot was getting pretty busy. We did this by commenting out the line that plots the tangent plane. It is easy for you to go into the code and add it back in if you want to play around. The MatLab command line is f x = @( x, y ) 2 x ; f y = @( x, y ) 2 y ; % DrawTangentLines ( f, fx, fy, 0. 5, 2, 0. 5, 2,. 3, 0. 5, 0. 5 ) ;
f you want to see the tangent plane as well as the tangent lines, all you have to do is look at the following lines in DrawTangentLines.m. % s e t up a new l o c a l mesh g r i d near ( x0, y0 ) [U, V] = m e s h g r i d ( u, v ) % s e t up the tangent plane at ( x0, y0 ) W = f ( x0, y0 ) + f x ( x0, y0 ) (U x0 ) + f y ( x0, y0 ) (V y0 ) % p l o t t h e t a n g e n t p l a n e s u r f (U, V,W, EdgeColor, b l u e ) ; These lines setup the tangent plane and the tangent plane is turned off is there is a percent % if front of surf(u,v,w, EdgeColor, blue );. We edited the file to take the % out so we can see the tangent plane. We then see the plane in the next figure.
The ideas we have been discussing can be made more general. When we take the derivative with respect to one variable while holding the other variable constant (as we do when we find the normal derivative along a trace ), we say we are taking a partial derivative of f. Here there are two flavors: the partial derivative with respect to x and the partial derivative with respect to y. We can now state some formal definitions and introduce the notations and symbols we use for these things. We define the process of partial differentiation carefully below.
Definition Partial Derivatives Let z = f (x, y) be a function of the two independent variables x and y defined on some domain. At each pair (x, y) where f is defined in a circle of some finite radius r, Br (x0, y0) = {(x, y) (x x0) 2 + (y y0) 2 < r}, it makes sense to try to find the limits f (x, y0) f (x0, y0) lim x x0,y=y0 x x0 f (x0, y) f (x0, y0) lim x=x0,y y0 y y0 If these limits exists, they are called the partial derivatives of f with respect to x and y at (x0, y0), respectively. Comment For these partial derivatives, we use the symbols and f fx(x0, y0), x (x0, y0), zx(x0, y0), z (x0, y0) x fy (x0, y0), f z (x0, y0), zy (x0, y0), y (x0, y0) y
Comment We often use another notation for partial derivatives. The function f of two variables x and y can be thought of as having two arguments or slots into which we place values. So another useful notation is to let the symbol D1f be fx and D2f be fy. We will be using this notation later when we talk about the chain rule. Comment It is easy to take partial derivatives. Just imagine the one variable held constant and take the derivative of the resulting function just like you did in your earlier calculus courses. Example Let z = f (x, y) = x 2 + 4y 2 be a function of two variables. Find z x and z y. Solution Thinking of y as a constant, we take the derivative in the usual way with respect to x. This gives z x = 2x as the derivative of 4y 2 with respect to x is 0. So, we know fx = 2x. In a similar way, we find z y. We see z y = 8y as the derivative of x 2 with respect to y is 0. So fy = 8y.
Example Let z = f (x, y) = 4x 2 y 3. Find z z x and y. Solution Thinking of y as a constant, take the derivative in the usual way with respect to x: This gives z x = 8xy 3 as the term 4y 3 is considered a constant here. So fx = 8xy 3. Similarly, z y = 12x 2 y 2 as the term 4x 2 is considered a constant here. So fy = 12x 2 y 2. Look at the tangent plane again to refresh your memory.
Let s recall some facts about inner products. Any time the dot product of two vectors is 0, the vectors are perpendicular! We define a plane as follows. Definition Planes A plane in 3D through the point (x0, y0, z0) is defined as the set of all points (x, y, z) so that the angle between the vectors D and N is zero where D is the vector we get by connecting the point (x0, y0, z0) to the point (x, y, z). Hence, for x x0 N1 D = y y0 and N = N2 z z0 N3 the plane is the set of points (x, y, z) so that < D, N >= 0. The vector N is called the normal vector to the plane. Recall the tangent plane to a surface z = f (x, y) at the point (x 0, y 0) was the plane determined by the tangent lines T (x, y 0) and T (x 0, y). The T (x, y 0) line was determined by the vector 1 1 A = 0 = 0 f x (x0, y0) 2x 0 and the T (x 0, y) line was determined by the vector B = 0 0 1 = 1 f y (x0, y0) 2y 0
We need to find a vector perpendicular to both A and B. Let s try this one: N = [ fx(x0, y0), fy (x0, y0), 1] T. The dot product of A with N is < A, N >= 1 ( fx(x0, y0) + 0 ( fy (x0, y0)) + (fx(x0, y0) 1 = 0. and the dot product of B with N is < B, N >= 0 ( fx(x0, y0) + 1 ( fy (x0, y0)) + (fy (x0, y0) 1 = 0. So our N is perpendicular to both of these vectors and so we know the tangent plane to the surface z = f (x, y) at the point (x0, y0) is then given by fx(x0, y0)(x x0) fy (x0, y0)(y y0) + (z f (x0, y0)) = 0. This then gives the traditional equation of the tangent plane: z = f ( x0, y0) + fx(x0, y0)(x x0) + fy (x0, y0)(y y0). We can use another compact definition at this point. We can define the gradient of the function f to be the vector f. The gradient is defined as follows. Definition The Gradient The gradient of the scalar function z = f (x, y) is defined to be the vector f where [ ] fx(x f (x 0, y 0) = 0, y 0). f y (x 0, y 0) Note the gradient takes a scalar function argument and returns a vector answer. The word scalar just means the function returns a number and not a vector.
Using the gradient, the tangent plane equation can be rewritten as f (x, y) = f (x 0, y 0)+ < f, X X 0 > = f (x 0, y 0) + f T (X X 0) where X X 0 = [ x x 0 y y 0 ] T. The obvious question to ask now is how much of a discrepancy is there between the value f (x, y) and the value of the tangent plane? Example Find the gradient of f (x, y) = x 2 + 4xy + 9y 2 and the equation of the tangent plane to this surface at the point (1, 2). Solution f (x, y) = [ ] 2x + 4y. 4x + 18y The equation of the tangent plane at (1, 2) is then z = f (1, 2) + fx(1, 2)(x 1) + fy (1, 2)(y 2) = 45 + 10(x 1) + 40(y 2) = 45 + 10x + 40y. Note this can also be written as 10x + 40y + z = 45 which is also a standard form. However, in this form, the attachment point (1, 2, 45) is hidden from view.
Example Find the gradient of f (x, y) = 3x 2 + 2y 2 and the equation of the tangent plane to this surface at the point (2, 3). Solution f (x, y) = [ ] 6x. 4y The equation of the tangent plane at (2, 3) is then z = f (2, 3) + fx(2, 3)(x 2) + fy (2, 3)(y 3) = 30 + 12(x 2) + 12(y 3) = 30 + 12x + 12y. Note this can also be written as 12x + 12y + z = 35 which is also a standard form. However, in this form, the attachment point (2, 3, 30) is hidden from view. Homework 33 33.1 If f (x, y) has a local minimum or local maximum at (x0, y0) prove fx(x0, y0) = fy (x0, y0) = 0. 33.2 If fx(x, y0) is continuous locally and fx(x0, y0) is positive, prove f (x, y0) > f (x0, y0) locally. 33.3 If fy (x0, y) is continuous locally and fy (x0, y0) is negative, prove f (x0, y) < f (x0, y0) locally.