﻿

Calculus

http://matrix.skku.ac.kr/Cal-Book1/

http://matrix.skku.ac.kr/Cal-Book1/Ch1/

http://matrix.skku.ac.kr/Cal-Book1/Ch2/

http://matrix.skku.ac.kr/Cal-Book1/Ch5/

http://matrix.skku.ac.kr/Cal-Book1/Ch6/

http://matrix.skku.ac.kr/Cal-Book1/Ch7/

http://matrix.skku.ac.kr/Cal-Book1/Ch8/

...

http://matrix.skku.ac.kr/Cal-Book1/Ch14/

Chapter 13. Partial Derivatives

13.1 Multivariate Functions

문제풀이 by 구본우  http://youtu.be/As_0AYApHlM

13.2 Limits and Continuity of Multivariate Functions

13.3 Partial Derivatives    http://youtu.be/LR89Ct3cEDY

문제풀이 by 김동윤  http://youtu.be/rSYLp1mSMXY

13.4 Differentiability and Total Differentials

문제풀이 by 김범윤  http://youtu.be/qDmCWBiXbIA

13.5 The Chain Rule   http://youtu.be/r3dGYL1vkEU

문제풀이 by 김유경  http://youtu.be/vzN5By6qzvM

13.6 Directional Derivatives and Gradient     http://youtu.be/o8L_ShRANjo

문제풀이 by 김태현  http://youtu.be/2_7TOUuzJoE

13.7 Tangent Plane and Differentiability     http://youtu.be/uOf-5YHKGI4

문제풀이 by 서용태  http://youtu.be/GDkE8OqUvsk

13.8 Extrema of Multivariate Functions   http://youtu.be/oDZUkOEszOQ

문제풀이 by 오교혁  http://youtu.be/FWmk_MasIjE

13.9 Lagrange Multiplier

문제풀이 by 이원준  http://youtu.be/YMGdQWBzyrI

13.1 Multivariate Functions

Multivariate Functions

So far we have discussed calculus of functions of one variable. In this section we deal with functions of two or more variables. However in real life a function depends upon many dependent variables. Such functions, in general are called multi-variable functions or functions of several variables. In this section, we primarily deal with functions of two variables. All the concepts can be analogously extended to functions of two or more variables. Many functions in real life depend upon more than one variables. In chapters 3 and 5, we discussed how to obtain the derivatives and integrals of functions with one independent variable. In this section, we will consider functions with two or more independent variables.

Let us look at some examples: (i) The area of a rectangle depends upon the length and width of the rectangle. Therefore, we can think of area as function of two variables, . (ii) The temperature of particular place on earth depends on the longitude and the latitude of that point. So we can think of temperature as a function of two variables, say . (iii) The cost of a mobile hand-set depends upon many factors.

In this section we deal with real valued functions of two real variables. The domain of such functions is a set of points in . We will assume that is endowed with Euclidean distance, that is distance between any two points, and is given by

A point in can also be referred to as a vector, which is the position vector of that point.

A real valued function of two real variables in general can be defined as follows:

DEFINITION1

Let .  A function of two variables is a rule that assigns to each point a unique real number denoted by . The set is called the domain of and its range is the set of values that takes.

Generally, we write to make explicit the value taken on by at the point . Here and are called independent variables and is called the dependent variable.

Most often the domain of the function is not mentioned explicitly, however it can be obtained from the function’s expression by simply looking at set of points on which the function is well defined. Let us look at some examples.

EXAMPLE1

Find the domain of the following function:

(a)

(b)

(c)

(d)

(e) .

Solution. (a) Note that the right handside of the expression works for all values except when the denominator is zero. That is, the domain of this function is

.

(b) The domain of this function is set of points such that . That is, . Thus the domain of is .

(c)The domain of is a set of points such that  . See Figure 1.  That is

.

Figure 1

(d) We know that is defined only for positive reals. That is   . This happens when

(i), or (ii) , . For (i), .

For (ii), .

Then the domain of is . Thus . See Figure 2.

Figure 2

(e)The domain of this function is when right handside make sense. That when and . The domain is plotted in Figure 3.

Figure 3

■

Graph of a Multivariate Function

Let . Then the graph of is a set of points

graph .

Usually, the graph of a function is called a surface in . (See Figure 4.) In Figure 5 the surface is the graph of the polynomial function is plotted.

Figure 4 Graph of a function of and is a surface      Figure 5 Graph of a polynomial function

Unlike one variable function , plotting the graph of a function in is not an easy task. One way to plot is to look at set of points for various values of , which is the intersection of the surface and the plane . The intersection is called the level curve at the level . If we know these level curves for all values of , then we can visualize the surface .

Note that level curve is the set of all points in the domain of at which takes value . Level curves are also called contour lines. Thus to plot the graph of a surface all we need is to plot level curves (contour lines) for various values of and then put these level curves at the corresponding level planes. (See Figure 6(a).)

A contour map of a function is a 2-dimensional graph showing several level curves corresponding to several values of . A contour map of lies in the -plane. (See Figure 6(b).)

Figure 6 Surface in (a) and level curves in (b)

EXAMPLE2

Plot the surface and level curves of .

■

Figure 7 Surface and level curves in Example 2

In most instances the task of graphing level curves of a function of two variables is formidable. A CAS was used to generate the surfaces and corresponding level curves in Figure 8.

(a)                                        (b)

Figure 8 Graph of in (a); level curves in (b)

The level curves of a function are also called contour lines. On a practical level, contour maps are often used to display curves of equal elevation. In Figure 9, we see that a contour map illustrates the various segments of a hill that have a given altitude. This shows heights of the mountain in in Figure 10, which show the volcano Mt. Halla, in the state of Jeju, Korea.

Figure 9 Contour map of Mt. Halla          Figure 10 Map of Mt. Halla in the state of Jeju, South Korea

CAS. Graph the level curves of the following functions along with the surface:

(1)

(2)

(3)

(4)

var('x, y')

f(x, y)=x^2+y^2

contour_plot(f(x, y), (x, -2, 2), (y, -2, 2), fill=False, cmap='hsv', axes=True, labels=True)

Figure 11

(2)

var('x, y')

f(x, y)=x^2-y^2

contour_plot(f(x, y), (x, -2, 2), (y, -2, 2), fill=False, cmap='hsv', axes=True, labels=True)

Figure 12

var('x, y')

f(x, y)=sin(x)*cos(y)

contour_plot(f(x, y), (x, -2, 2), (y, -2, 2), fill=False, cmap='hsv', axes=True, labels=True)

Figure 13

(4) Level curves along with the surface:

var('x, y')

f(x, y)=4*x*y*exp(-x^2-y^2)

contour_plot(f(x, y), (x, -2, 2), (y, -2, 2), fill=False, cmap='hsv', axes=True, labels=True)

Figure 14

EXAMPLE 4

Graph and plot the level curves , and in the domain of in the plane.

Solution. The domain of is the entire -plane, and the range of is the set of real numbers less than or equal to . The graph is the paraboloid , a portion of which is shown in Figure 15.                          In Figure 16, The level curve is the set of points in the plane such that .

This is the circle of radius centered at the origin. Similarly, the level curves and are the circles

.

The level curve consists of the origin alone.

Figure 15                                        Figure 16

Functions of Three Variables

The definition of functions of three or more variables are simply generalizations of the definition of one variable. For example, a function of three variables is a rule of correspondence that assigns to each ordered triple of real number in a subset of , one and only one number in the set of real numbers. A function of three variables is usually denoted by or .

For example, the volume and surface area S of a rectangular box are polynomial functions of three variables:

and .

The set of points in space where a function of three independent variables has a value is called a level surface of .

EXAMPLE 5

Describe the level surfaces of the function .

Solution. The value of is the distance from the origin to the point . Each level surface   is a half-sphere of radius centered at the origin. The level surface consists of the origin alone.

We are not graphing the function in this example. We are looking at level surfaces in the domain of the function. The level surfaces show how the function values change as we move through its domain . If we remain on a sphere of radius centered at the origin, the function maintains a constant value, namely . If we move from a point on one sphere to a point on another, the function value increases if we move away from the origin and decreases if we move toward the origin. The manner in which the values change depend on the direction chosen; the relationship between the function values and the direction travelled is important.

EXAMPLE6

(a) The level surfaces of the polynomial are a family of parallel planes defined by . (See Figure 18.)

Figure 18 Level surfaces in (a) of Example 6

(b) The level surfaces of the polynomial are a family of concentric spheres defined by , . See Figure 17.

Figure 17 Level surfaces in (b) of Example 6

(c) The level surfaces of the rational function are given by or . A few members of this family of paraboloids are

given in Figure 19.

Figure 19 Level surfaces in (c) of Example 6

var('x,y,z')

f(x,y,z)=x-y+2*z

p=Graphics()

for k, col in [(1, 'red'),(2, 'orange'),(3, 'yellow'),(4, 'green')]:

p+=implicit_plot3d(f(x,y,z)==k,(x,-2,2),(y,-2,2),(z,-1,3),opacity=0.7, color=col)

p

(b)

var('x,y,z')

f(x,y,z)=x^2+y^2+z^2

p=Graphics()

for k, col in [(1, 'red'),(2, 'orange'),(3, 'yellow'),(4, 'green')]:

p+=implicit_plot3d(f(x,y,z)==k,(x,-2,2),(y,-2,2),(z,-3,1),opacity=0.7, color=col)

p                       # Figure 17

(c)

var('x,y,z')

f(x,y,z)=(x^2+z^2)/y

p=Graphics()

for k, col in [(1, 'red'),(2, 'orange'),(3, 'yellow'),(4, 'green')]:

p+=implicit_plot3d(f(x,y,z)==k,(x,-2,2),(y,-2,2),(z,-3,3),opacity=0.7, color=col)

p

13.1 EXERCISES (Multivariate Functions)

1. If , find (a) , (b), (c) .

(a) .

(b) .

(c)

.

2. , find

(a) , (b).

(a) .

(b) .

3-4. Find the domain of the given function.

3.

4.

5-6. Find the range of the given function.

5.

var('x,y,z')

implicit_plot3d(1+exp(x*y)==z,(x,-2.5,2.5),(y,-2.5,2.5),(z,0,3),opacity=0.3)

Then the range is .

6.

7-8. Sketch typical level surfaces of the function.

7.

var('x,y,z')

f(x,y,z)=y+z

p=Graphics()

for k, col in [(1,'red'), (2,'orange'), (3, 'yellow'), (4,'green')]:

p+=implicit_plot3d(f(x,y,z)==k,(x,-2,2), (y,-2,2),(z,-1,3),opacity=0.7,color=col)

p

8.

9.

10. Given that

find the , and intercepts of the level surface that passes through .

13.2 Limits and Continuity of Multivariate Functions

Limits and Continuity

Before discussing limits and continuity, we need to introduce some terminology about sets that will be useful in the sections and chapters that follow. The set

is called an open disk centered at with radius . On the other hand, the set

is a closed disk. A closed disk contains all points interior to and on a circle. See Figure 1 (a). Let be some region of the -plane. Then a point is said to be an interior point of , if there is at least one open disk centered at that contains only points of . We say that is a boundary point of if the interior of each open disk centered at contains points from both and . The region is said to be open if it contains no boundary points and closed if it contains all its boundary points. See Figure 1. A region is said to be bounded if it can be contained in a sufficiently large rectangle or disk in the plane. These concepts can be carry over naturally to . For example, an open ball consists of all points interior to, but not on, a sphere with center and radius ;

.

A region in is bounded if it can be contained in a sufficiently large disk.

Figure 1 Various regions in

Let be a function defined on a region .

which means is getting close to the number as close to . A precise definition can be given as follows;

DEFINITION1

Let and (The point need not necessarily be in ). Then we say that the limit of as approaches to is , if for every , there exists such that such that when for .

This can be also expressed as

and  as .

EXAMPLE1

Let . Let us check if exists.

Solution. It is straightforward to guess that the limit exists and it is . Let be given. To prove that , we need to find such that when , we have . Note that for all . Hence any choice of will work. Thus

.    ■

EXAMPLE2

Let . Let us check if exists.

Solution. It is not hard to guess that when , . Therefore, the limit must be . Let us prove this. Let . We need to find such that when ,

we have .

For any , it is easy to that (See Figure 2.)

Figure 2

and . Thus we have

(Triangle Law of Modulus)

.

Therefore,

.

This suggests that we may choose . Now if

, from we have . Hence, exists and it is .                         ■

EXAMPLE3

(1) Let . Then show that .

(2) Let . Then show that .

Solution. (1) Let . We need to find such that when

,

we have .

For any , it is easy to that

.

This suggests that we may choose . Now if

, from we have

. Hence, .

(2) Similar to (1), we can prove .

Limit Along a Path

The notion of “approaching” a point is not as simple as it is for functions of one variable. In the -plane, there are an infinite number of ways of approaching a point , as shown in Figure 3. In order that exist, we require that approach to along every possible curve or path through . In particular,

(ⅰ) If does not approach the same number for two different paths to , then does not exist.

(ⅱ) If the limit of does not exists along some path through , then limit at does not exist.

Figure 3

In the discussion of that follows we shall assume that the function is defined at every point in an open disk centered at but not necessarily at itself.

EXAMPLE4

Investigate the limit of

at .

Solution. Let and in such a way that . Then along this line

.

Since the limit of the function depends on the manner in which approach to , the function does not have a limit at . For example, for , and for , .  ■

EXAMPLE5

Find the limit, if it exists, of the following function as .

(a)

(b)

Solution. (a) Since and ,

we have .

Note that iff and .

Thus, as , and so

.

That is, .

(b) Let and in such a way that . Then along this line

Since the limit of the function depends on the manner in which approach to , the function does not have limit at . For example, for , and for , .         ■

Finding the limit of a function directly from the definition is not an easy task. The following are properties of limit of two variable functions which are similar to properties of one variable functions. These properties give a tool to compute limit of various functions.

THEOREM 2  The Power Rule

Let and be real numbers and suppose that , . Then

1.

2.

3.

4.

5. , if

6.

7. If and are integers, and have no common factors and , then

where we have if is even and and are integers.

EXAMPLE6

Using the laws of limit in Theorem 2, find the limit of

(1) at .

(2) .

Solution.  (1) From Theorem 2, we have we have

.

(2) From Theorem 2, we have

.

Therefore, .

EXAMPLE7

Find the limit of the following function as .

(a)                (b)

Solution.  (a) Let . Then one can show that if and only if . We have .

Therefore,.

(b)When the point is on the straight line , . Therefore, the limit of is as approaches along line . This limit changes as changes. Hence, does not have a limit as .

EXAMPLE8

Find the limit of the following functions as .

(a)                 (b)

Solution.  (a) Since, , we have

Note that iff and

Thus, as , and so .

That is, .

(b) Letting along any non-vertical line through the origin. Let along the , we have

.

Therefore, depending on the value of , different paths will lead to different values of the limit as . Hence the limit does not exist as .

Figure 4                                              Figure 5

EXAMPLE9

Find  .

Solution.

var('x,y')

f(x,y)=(x-2*y)/(x+3*y)

limit(limit(f,x=1),y=2)

Answer : (x, y) |--> -3/7

var('x,y')

f(x,y)=(x-2*y)/(x+3*y)

limit(limit(f,y=2),x=1)

THEOREM 3

For a function in neighborhood of point , suppose that

exist. Let

.

Then and converges to . Furthermore,

and can be distinguished by denoting the former as the double limit while the latter as the successive limit. Since is practically a limit of single variable function, we just repeats the limit process twice.

Proof. Since , for any given , there exists a number  such that if   then  .

With the same argument, since , for any given , there exists a number such that

if   then  .

Since , for any given , there exists a number  and such that

if   then  .

Thus, if , then and simultaneously if , then

.

This implies

.

Likewise, this may be proven in a similar manner for limits taken in varying orders, that is, first , then and first , then .

In Example 7 (b) and . Thus and exist but two limits are not equal. Then does not exists.

The function is one of examples where the converse of Theorem 3 is false. For this function,

if , then and

if , then .

Therefore,

.

However, when , respectively . Thus in any domain near , no matter how small, there are points that are assigned and points that are assigned by the function . This means that the limit of the function at does not exists. The may not exist, even if is satisfied.

EXAMPLE10

Using Sage, find the limit of

(1) at .

(2) .

(3) Find the example of .

Solution.

var('x, y')

f(x, y)=(3*x+y^2+4*x*y)

limit(f(x, y), x=1)

y^2 + 4*y + 3

limit(f(1, y), y=1)

(2)

var('x, y')

f(x, y)=(x^2-4*y+1)/(x+2*y+3)

limit(f(x, y), x=0)

-(4*y - 1)/(2*y + 3)

limit(f(0, y), y=0)

(3) Let . We have

,

.

Then since , a function     is an example of (3).          ■

Continuity of Functions of Two Variables

The following definition of continuity for function of two variables is analogous to the definition of continuity for a one variable function.

DEFINITION4

Let and .  Then is said to be continuous at if . That is, exists and it is equal to the value of the function. If is continuous at every point in , then we say that is continuous on .

EXAMPLE11

It is easy to see that functions defined in Examples 1, 2 and 3 are continuous on . The proof is similar to the solutions given in Examples 1, 2 and 3.   ■

EXAMPLE12

Determine the points at which the following function is continuous.

Solution. The function is a rational function, so it is continuous at all points of its domain, which consists of all points of except . In order for to be continuous at , we must show that

.

You can verify that as approaches along paths of the form , where is any constant, the function values approach . Now consider parabolic paths of the form , where is a nonzero constant. (See Figure 6.)

Figure 6

For the choice of , notice that if is replaced by in , the result involves the same power of (in this case, ) in the numerator and denominator were canceled.

This time we substitute and note that as ;

We see that along parabolic paths, the limit depends on the approach path. For example, with , along the path , the function values approach . (See Figure 7.) Because function values approach two different numbers along two different paths, the limit at does not exist, and is not continuous at .■

Figure 7

EXAMPLE13

Investigate the continuity of

at .

Solution.

,

Hence it is continuous at .

Properties of Continuous Functions

Using the properties of limits in Theorem 2, one can show that sums, differences, products and quotients of continuous functions are continuous on their domains under appropriate conditions. For example:

(i) Any polynomial function of two variables and is continuous on . Note that a polynomial of and is a function which is obtained by adding terms of the form where and are non negative integers.

(ii) A rational function is continuous on as numerator and denominator are continuous on and the denominator satisfies for all .

THEOREM 5  Continuity of Composite Functions

If is continuous at and is continuous at , then the composite function is continuous at .

EXAMPLE14

Investigate the continuity of , .

Solution. Since is continuous for all and is continuous for all , is also continuous for all by using Theorem 5. Similarly, since is continuous for all and is continuous for all , is also continuous for all by using Theorem 5.   ■

The following theorem is an important  concept which is used in quite often  while dealing with continuous functions. It says that if is a continuous function and has a non zero value at a point , then it continues to be non zero near in the domain of .

THEOREM 6

If is a continuous function at the point and , then has the same sign as near the point .

Continuity of Functions of Three Variables

The notions of limit and continuity for functions of three or more variables are natural extensions of those just considered. For example, a function is continuous at if

.

The polynomial function is continuous throughout . The rational function

is continuous except at the single point . The rational function

is continuous except at points on the plane .

13.2 EXERCISES (Limits and Continuity of Multivariate Functions)

1-7. Find the limit, if it exists, or show that the limit does not exist.

1.

Solution. Let and along the line .

Then

For example, for , and for . Therefore the limit does not exists.

2. .

Solution.  .

var('x,y')

f(x,y)=x^3/(2*x^2+6*y^4)

limit(limit(f(x,y),x=0),y=0)

0

limit(limit(f(x,y),y=0),x=0)

0

The limit exists and it is .

3.

var('x, y')

f(x, y)=(x^2-y^2)/(x^2+y^2)

limit(f(x, 0), x=0)

1

limit(f(0, y), y=0)

-1

Answer : The limit does not exist.

4.  .

After plotting the function, we know it converges. So the order in and does not effect.

var('x, y')

f(x, y)=(sin(x^3 + y^3))/(x^2+y^2)

limit(f(x, y), x=0)

sin(y^3)/y^2

limit(f(0, y), y=0)

5. .

Let and along the line .

var('x,y')

f(x, y)=(sin(x^3 + y^3))/(x^2+y^2)

limit(limit(f(x,y),x=0),y=0)

y

limit(limit(f(x,y),x=0),y=0)

0

Answer : The limit exists and it is .

6.  .

After plotting the function, we know it converges. Let and along the line .

7. .

var('x, y, z')

f(x, y)=x*y*z/(x*y+y*z+z*x)

limit(f(x, y, z), x=0)

0

So

show(limit(f(0, y, z), y=0))

show(limit(f(0, y, z), z=0))

0

0

Answer : The limit exists and it is .

8. What value of for

will

make the function continuous at .

Solution.

Since , then by Squeeze Theorem.

Hence, if we define , then will be continuous at .

9-10. Let each of the following functions have the value 0 at the origin. Which of them are continuous at the origin? Explain your answer.

9. .

var('x, y')

f(x, y)=(x*2*y^2)/(x^2+y^4)

limit(f(x, y), x=0)

0

limit(f(0, y), y=0)

0

The limit is . Hence, if we define , then is continuous at the origin.

10.

var('x, y, z, w')

f(x, y, z, w)=(x^2+y^4+z^2*w^2)/(x^4+y^2+z^2+w^2)

limit(f(x, 0, 0, 0), x=0)

+Infinity

The limit does not exist.

11-12. Find and the set on which is continuous.

11. , .

Solution. Since is continuous for all and is continuous for all , is continuous on a set by using Theorem 5 in Section 13.2.

12. , .

Solution. Since is continuous for all and is continuous for all , is continuous on a set by using Theorem 5 in Section 13.2.

13.3 Partial Derivatives

In this section, we will deal with partial derivatives, which is an important concept in multivariate calculus. Partial derivatives are (essentially) derivative of one variable functions. Consider defined on a domain, . Let us fix a point . Suppose we fix one of the variables, say , then becomes a function of one variable . Let . If is differentiable at , that is,

exists, then we say that has a partial derivative at with respect to . Similarly we can define the partial derivative of with respect to at . See Definition 1 for a generalization of this idea.

First-Order Partial Derivatives

DEFINITION1

Let be a function of two variables and .

The partial derivative of with respect to is defined as

, provided this limit exists.

The partial derivative of with respect to is defined as

, provided this limit exists.

The partial derivative of with respect to may be denoted by (any of the following)

.

Similarly, the partial derivative of with respect to may be denoted by

.

Geometric Meaning of the Partial Derivative

Let us consider the function . Let be a point on the surface where . We wish to look at the geometric meaning of and . To find , we look at the curve of intersection of the surface and the plane , parallel to the plane. This is the same as saying fix in . Then is the slope of the tangent to the curve of intersection at as the rate change of for at this point. (See Figure 1.)

Figure 1 Intersection of the surface with the plane

Similarly, is the slope of the tangent of the curve at the point as the rate change of for at this point. (See Figure 2.)

Figure 2 Intersection of the surface with the plane

EXAMPLE1

Find partial derivatives with respect to and for the following functions at the given point.

(a) .

(b) .

(c) .

Solution.  (a) .

Thus , .

(b) The partial derivatives are

,

.

Then , .

(c) Let . Then

Then and .     ■

EXAMPLE2

Show that  for .

Solution.  The partial derivatives are

and .

Therefore, .

Functions of Three Variables

Let be a function of three variables and . The partial derivatives of with respect to , with respect to , and with respect to are defined as follows

provided the limits on the right hand side exist.

In general, if is a function of variables, then the partial derivative of with respect to the variable, , is defined to be

.

To compute , we differentiate with respect to while holding the remaining variables fixed.

EXAMPLE3

Find , and if .

Solution.  , and .

var('x,y,z')

f=exp(x*y)*log(z)

fx=diff(f,x);fy=diff(f,y);fz=diff(f,z)

print fx

print fy

print fz

Second and Higher Order Partial Derivatives

Suppose that has first order partial derivatives and . Note that and are also function of and . Therefore, we can talk about their partial derivatives if they exist. If and have partial derivatives with respect to and , then the following four possibilities exist:

,

,

,

.

These are called second order partial derivatives of . and are called mixed second order partial derivatives. In general, the second order mixed partial derivatives need not be equal.

Third order partial derivatives may also be defined, for instance

.

.

.

The higher partial derivative may be defined similarly if they exist.

EXAMPLE4

Let

be a function of two variables .

Verify that and are not define at .

Solution.

var('x,y')

f=(x^3*y-x*y^3)/(x^2+y^2)

limit(limit(f,x=0),y=0)

0

var('x,y')

f=(x^3*y-x*y^3)/(x^2+y^2)

limit(limit(f,y=0),x=0)

0

Then is continuous on .

var('x,y')

f(x,y)=(x^3*y-x*y^3)/(x^2+y^2)

f_xy=diff(diff(f,x),y)

fxy=limit(limit(f_xy,x=0),y=0)

print fxy

fyx=limit(limit(f_xy,y=0),x=0)

print fyx

-1, 1

Since two limits are different, is not define at .

Actually on except .

var('x,y')

f(x,y)=(x^3*y-x*y^3)/(x^2+y^2)

f_xy=diff(diff(f,x),y)

f_yx=diff(diff(f,y),x)

print bool(f_xy==f_yx) # except the origin

True

Then it is easy to show that , , , exist. However because and .   ■

This example shows second order partial derivatives and  may be different, so the order of differentiation cannot be interchanged arbitrarily. The following theorem provides a sufficient condition for changing the order of differentiation.

THEOREM 2  Equality of Mixed Partial Derivatives

Suppose and it's derivatives , and are defined in a domain containing a point and all are continuous at . Then

.

As a consequence, if and both exist and are continuous, then . If third partial derivatives exist and are continuous, then  is true as well. These results holds for all higher order partial derivatives.

EXAMPLE5

For , find the second order partial derivatives.

Solution. , ,

, ,

,

.

var('x,y')

f=sin(x-y)+exp(-x*y)

fxx=diff(f,x,2)

fyy=diff(f,y,2)

fxy=diff(f,x,y)

fyx=diff(f,y,x)

print fxx

print fyy

print fxy

print fyx

Answer : y^2*e^(-x*y) - sin(x - y)

x^2*e^(-x*y) - sin(x - y)

x*y*e^(-x*y) - e^(-x*y) + sin(x - y)

x*y*e^(-x*y) - e^(-x*y) + sin(x – y)

EXAMPLE6

Show that the partial derivatives and both exist, but the function is not continuous at .

Solution. Since the definition of partial derivatives, we have

.

However, is not continuous at because the limit of does not exists as follows;

letting along the line ,

.

13.3 EXERCISES (Partial Derivatives)

1. Find partial derivatives with respect to and   for the function .

Solution.

var('x,y')

f=24*x*y-6*x^2*y

fx=diff(f,x);fy=diff(f,y)

print fx

print fy

Answer : -12*x*y+24*y, -6*x^2 + 24*x

2. Find partial derivatives with respect to and for the function .

Solution.

3. Find all second order partial derivatives of the function .

Solution.

4. Find all second order partial derivatives of the function .

Solution.

5. Take an example of the solution for the .

Solution.

var('x, y')

f(x, y)=x*y+x^3+y^3

solve([derivative(f,x,2)+derivative(f,y,2)==0], x, y)

([x == -y], [1])

6-8. Laplace’s equation A classical equation of mathematics is Laplace’s equation, which arises in both theory and applications. It governs ideal fluid flow, electrostatic potentials, and the steady-state distribution of heat in a conducting medium. In two dimensions, Laplace’s equation is

Show that the following functions are harmonic; that is, they satisfy Laplace’s equation.

6.

Solution.

var('x, y')

u(x, y)=x*(x^2-3*y^2)

u_xx=diff(u(x,y), x, 2)

u_yy=diff(u(x,y), y, 2)

bool(u_xx+u_yy==0)

True

7. for any real number .

True

8.

var('x, y')

u(x,y)= arctan(y/(x-1)) - arctan(y/(x+1))

u_xx=diff(u(x,y), x, 2)

u_yy=diff(u(x,y), y, 2)

bool(u_xx+u_yy==0)

True

9. The volume of a right circular cone of radius and height is . Show that if the height remains constant while the radius changes the volume satisfies .

10. Let . Show that

.

13.4 Differentiability and Total Differentials

Differentiability

Once again we try to generalize, the deﬁnition of differentiability of one variable function at . Recall that is differentiable at , with its derivative , if . Using the definition of limit, this means the following: Given any , for sufficiently small . That is,

with the condition that as . We can generalize this definition to a function . In the sequel, we assume that is deﬁned on some open subset of .

The analogous requirement with several variables is the definition of differentiability for functions or two (or more) variables.

DEFINITION1

The function is differentiable at provided and exist and the change equals

where for fixed and , and are functions that depend only on and , with as . A function is differentiable on an open region if it is differentiable at each point of .

Several observations are needed here. First, the definition extends to functions of more than two variables. Second, we will show how differentiability is related to linear approximation and the existence of a tangent plane in Section 13.7. Finally, the conditions of the definition are generally difficult to verify. The following theorem may be useful in checking differentiablity.

THEOREM 2  Conditions for Differentiability

Suppose the function has partial derivatives and defined on an open region and and are continuous on . Then is differentiable at every point of .

This theorem states that existence of and at is not enough to ensure differentiability of at ; we also need their continuity. Polynomials and rational functions are differentiable at all points of their domains, as are compositions of exponential, logarithmic and trigonometric functions with other differentiable functions.

We close with the analog of Theorem 3 in Section 3.1, which states that differentiability implies continuity.

THEOREM 3  Differentiability Implies Continuity

If a function is differentiable at , then it is continuous at .

Proof.  By the definition of differentiability,

,

where as . Because is assumed to be differentiable, as and approach , we see that

.

Also, because , it follows that

,

which implies continuity of at .

EXAMPLE1

Discuss the differentiability and continuity of the function

Solution. As the definition of a rational function, is continuous and differentiable at all points . The interesting behavior occurs at the origin. It can be shown that if the origin is approached along the line , then

.

Therefore, the value of the limit depends on the direction of approach, which implies that the limit does not exist, and is not continuous at . By Theorem 3, is not differentiable at .

Let’s look at the first partial derivatives of at . A short calculation shows that

.

That is, the partial derivatives exist at .

Despite the fact that is not differentiable at , its first partial derivatives exist at . Existence of first partial derivatives at a point is not enough to ensure differentiability at that point. As expressed in Theorem 2, continuity of first partial derivatives is required for differentiability. It can be shown that and are not continuous at .      ■

Total Differential

The partial derivative introduced in the previous section tells us how a function changes when we vary one variable and hold the others fixed. Sometimes we wish to know how a function changes when more than one variable is changed. In section 3.4, we dealt with differential of a function at . Recall that

.

In this section we wish to generalize this for the function of two variables. Let be a function of two variables. Assume that has first order partial derivatives and at in some neighborhood of . Let us also assume for convenience that and are also continuous.

Let and represent infinitesimal changes in and , respectively, at . Let be the increment of the function . That is,

.

We add and subtract in , and get

Using the mean value theorem in the interval , there exists between and such that

.

Similarly using the mean value theorem in the interval , there exists between and such that

.

Using and , in , we get

.

The above equation can be rewritten as follows: there exist , such that

.

Note that as andy , we have and . Thus under the limiting case we have

.

The is called the differential or total differential of . At time in infinitesimal case we write and , then the differential can be written as

.

In case, is a function of three variables then the total differential is given by

.

EXAMPLE2

If , find the total differential of .

Solution. By definitions of the total differential, we have

.

The first order partial derivatives of with respect to and are as follows :

,

Hence, we obtain

.       ■

EXAMPLE3

The base diameter and height of a cylinder are measured as and , respectively, with a possible error in measurement of as much as for each. Estimate maximum relative error and percentage error in the calculated volume of the cylinder.

Solution. The volume of a cylinder with base diameter cm and height  cm is . Taking natural logarithms on both sides of this equation, we get

.

Now we take the differentials on both sides to have

.

is a maximum when and are positive. Therefore, we take and along with . This gives

.

The maximum relative error in the calculated volume is .

Thus the percentage error in the calculated volume is 5.25%.

EXAMPLE4

The dimensions of a rectangular cuboid are measured to be 70 cm, 60 cm and 50 cm, with a possible error in measurement as much 0.3 cm in each. Calculate differential and increment to estimate the maximum error in the volume of the rectangular cuboid.

Solution. Let , and be the dimensions of the rectangular cuboid.

Then the volume is . By , since

,

so

if , , and .

Next we will find the increment of as follows

.    ■

Given , we have found the total differential . If we have the total differential , can we find ?

EXAMPLE5

If , find .

Solution. By , .

Integrating with respect to , we obtain

,

where is a constant with respect to , that is a function of . Next we differentiate both sides of with respect to , and we have

.

Then . Thus .

Integrating with respect to , we have

where is a constant. Putting this in , we have

.              ■

13.4 EXERCISES (Differentiability and Total Differential)

1. Find the total differential of when .

Solution.

2. If , find the total differential of .

Solution.

3. The base diameter and height of a right circular cone are measured as 10cm and 25cm, respectively, with a possible error in measurement of as much as for each. Estimate maximum relative error and percentage error in the calculated volume of the right circular cone.

Solution. Since the volume of right circular cone is , .

Let , then  .

The maximum relative error is and the percentage error is 3.2%.

4. Find an approximation using total differential.

(1) Find an approximation of when .

(2) Find an approximation of .

Solution. (1) Since and

, the linear approximation is

Then .

(2) Let .  Since

and  ,

the linear approximation is

.

13.5 The Chain Rule

The Chain Rule

Let . If and depend on other variables, we would like to find derivatives or partial derivatives of with respect to these independent variables. There are several variations that can occur. For example, and can be function of another variable, say , or and can be functions of two variables and . The Chain Rule for multivariable function helps to find derivative and partial derivatives of compositions of functions. Let us consider the first case, where and are functions of .

THEOREM 1  Chain Rule (One Independent Variable)

If is a function of and , and and are differentiable functions of , then the composition is a differentiable function of and

.

Proof.  If and and are both functions of the parameter of , then is the independent variable. Using in Section 13.4, we have

.

When and . By hypothesis and are continuous

or,  . (See Figure 1.)           ■

Figure 1

THEOREM 2

Let have continuous first order partial derivatives and be a differentiable function of . Then the composition is a differentiable function of and

.

Proof.  Using in Section 13.4, we have

.

Taking the limit of the above equation as gives.

In particular

and .

Taking the limit of the above equation as gives

or,  . (See Figure 2.)    ■

Figure 2

THEOREM 3  Chain Rule (Two Independent Variables)

Let have continuous first order partial derivatives with respect to and . Let and also have continuous first order partial derivatives with respect to and . Then

.

Proof.  Using in Section 13.4, we have

for some . When as .

Now taking the limit of the above equation as gives

.

In other words,

.

It may be shown, similarly that

. (See Figure 3.)

Figure 3

THEOREM 4

Let have continuous first order partial derivatives with respect to , , . Let , and be functions of independent variables and . Also assume that , and have continuous first order partial derivatives with respect to and . Then

and

. (See Figure 4.)

Figure 4

THEOREM 5

If and then

and . (See Figure 5.)

Figure 5

EXAMPLE1

If where and  , find .

Solution. .

Using the chain rule.

■

EXAMPLE2

If where and , find .

Solution. Let us look at the tree diagram in Figure 6.

Figure 6

Using the chain rule gives

Now

.

.

Therefore

.

var('u, x, y, z')

u=ln(x^2+y^2+z^2)

u

log(x^2 + y^2 + z^2)

dudx=diff(u, x).factor()

dudx

2*x/(x^2 + y^2 + z^2)

dudy=diff(u, y).factor()

dudy

2*y/(x^2 + y^2 + z^2)

dudz=diff(u, z).factor()

dudz

2*z/(x^2 + y^2 + z^2)

y=x*sin(x)

dydx=diff(y, x).factor()

dydx

x*cos(x) + sin(x)

z=x*cos(x)

dzdx=diff(z, x).factor()

dzdx

-x*sin(x) + cos(x)

(dudx+dudy*dydx+dudz*dzdx).subs(y=x*sin(x), z=x*cos(x)).trig_simplify()

EXAMPLE3

If where , find .

Solution. Using the chain rule, we have

.

Since ,

,

.

Therefore, we have

,

,

Since , .

Therefore

.  ■

EXAMPLE4

If where and , find , , and .

Solution. Taking the first order partial derivatives with respect to and of and , we obtain

Solving (1) and (2), we have

and .

Solving (3) and (4), we have

and .

To find , first we can get the following

.

Thus we have

.

Therefore .

var('r,t,x,y,r_x,t_x,r_y,t_y')

z=r^2*exp(-t)

x=r*cos(t);y=r*sin(t)

solve([1==cos(t)*r_x-r*sin(t)*t_x,0==sin(t)*r_x+r*cos(t)*t_x],r_x,t_x)

r_x = cos(t)/(sin(t)^2 + cos(t)^2), t_x =-sin(t)/(r*sin(t)^2 +r*cos(t)^2)]]

r_x=cos(t)/(sin(t)^2 + cos(t)^2)

t_x=-sin(t)/(r*sin(t)^2+r*cos(t)^2)

print r_x.simplify_trig()

print t_x.simplify_trig()

cos(t), -sin(t)/r

solve([0==cos(t)*r_y-r*sin(t)*t_y,1==sin(t)*r_y+r*cos(t)*t_y],r_y,t_y)

r_y = sin(t)/(sin(t)^2 + cos(t)^2), t_y = cos(t)/(r*sin(t)^2 +r*cos(t)^2)

r_y = sin(t)/(sin(t)^2 + cos(t)^2)

t_y = cos(t)/(r*sin(t)^2+r*cos(t)^2)

print r_y.simplify_trig()

print t_y.simplify_trig()

sin(t), cos(t)/r

z_y=diff(z,r)*r_y+diff(z,t)*t_y

z_y.simplify_trig()

(2*r*sin(t) - r*cos(t))*e^(-t)

z_yx=diff(z_y,r)*r_x+diff(z_y,t)*t_x

z_yx.simplify_trig()

-(sin(t)*cos(t) + 2*cos(t)^2 – 1)*e^(-t).

Implicit Differentiation

(Ⅰ) For the relationship between two variables and , we say that is an implicit function of if we are given an equation

Here can be thought of as a single-valued function in a small neighborhood of . If the relationship where exists, then is an explicit function of . The following theorem holds for implicit function , if has continuous first order partial derivatives of with respect to in the neighborhood at the point where .

THEOREM 6  Implicit Differentiation

Let have continuous first order derivatives on its domain. Suppose that defines as a differentiable function of . Then

,  provided  .

Figure 7

Proof.   We can apply the chain rule to differentiate both sides of the equation with respect to . Since both and are functions of , we get

.

Then, if .     ■

Now we suppose that is given implicity as a function

by an equation of the form . This means that for all in the domain of . If and are differentiable, then we can apply Chain Rule to differentiate the equation as follows:

THEOREM 7  Implicit Differentiation

Let be differentiable on its domain and suppose that defines as an differentiable function of and . Then

,   where .(See Figure 8.)

Figure 8

Proof.   We assumed that defines implicitly as a function of and . Then .

So this equation becomes

because and .

Similarly,

because and .

If , then we have

.    ■

When and are functions of

,

we obtain the derivative with respect to

,

by solving the system of equations above, we find . Let us assume that the determinant

,

then

.

EXAMPLE5

If , find .

Solution.  Let . Then

.

Therefore, from formula , we obtain

.

var('x,y')

f=x*sin(y)+y*cos(x)

f_x=diff(f,x);f_y=diff(f,y)

dydx=-f_x/f_y

dydx

Answer : (y*sin(x) - sin(y))/(x*cos(y) + cos(x))

EXAMPLE6

Suppose is an implicit function of and on any rectangular region that satisfy . Find and .

Solution.  Let . Since

,

and ,

from , we obtain

.      ■

var('x,y,z')

f=x^3*exp(y+z)-y*sin(x-z)

f_x=diff(f,x);f_y=diff(f,y);f_z=diff(f,z)

dzdx=-f_x/f_z;dzdy=-f_y/f_z

print dzdx

print dzdy

-(x^3*e^(y+z)-sin(x-z))/(x^3*e^(y+z)+y*cos(x-z))

EXAMPLE7

If equation ,  find and .

Solution.  Let . Then

, and .

Therefore, from formula , we obtain

and .     ■

13.5 EXERCISES (The Chain Rule)

1. If where , and , find and at and .

Solution.

.

2. Find and if , where .

Solution.  (1) ,

(2)

.

3. Find of .

Solution.

4. Find of .

Solution.  Take a partial derivative of both sides with respect to , then  we have

.

.

5. Find and when is an implicitly defined function of and in

.

Solution.  If

,

6. Find , of .

Solution. because

.

because .

7. Find  when .

Solution.

8. Let with .

(a) Show that and exist everywhere.

Solution.  (a) If ,

var('x, y, h')

f(x, y)=x*y/(x^2+y^2)

fx(x, y)=limit((f(x+h, y)-f(x, y))/h, h=0)

fy(x, y)=limit((f(x, y+h)-f(x, y))/h, h=0)

print(fx(x, y))

print

print(fy(x, y))

-(x^2*y - y^3)/(x^4 + 2*x^2*y^2 + y^4)

(x^3 - x*y^2)/(x^4 + 2*x^2*y^2 + y^4)

Thus and exist everywhere.

(b)

print(limit(fx(x, 0), x=0))

print(limit(fx(0, y), y=0))

0

Infinity

is not continuous at the origin.

print(limit(fy(x, 0), x=0))

print(limit(fy(0, y), y=0))

Infinity

0

is not continuous at the origin.

9. A function is called a homogeneous function of degree if all the terms in are of degree . In other words, for any parameter . If is a homogeneous function of degree n then show that

This is also called Euler’s theorem for homogeneous function.

10. Verify the Euler’s theorem for the following:

(i) .

(ii) .

(iii) .

(iv) .

(v)

(vi) .

11. If is a homogeneous function of degree in , and then show that

.

12.Let . Find at , .

13. Let is a homogeneous function of degree in and . If then show that

.

14.Let . Show that

.

15.Let . Show that

.

16. Show that is a solution of for all and assuming that is a constant.

17. If is the solution of the equation

with the condition that as , ﬁnd the values of and .

18. Let , , and . Find .

19. Let , , . Find at .

The partial derivatives and are the rates of change of at in the positive - and -directions. Rates of change in other directions are given by directional derivatives. We open this section by deﬁning directional derivatives and then use the Chain Rule to derive a formula for their values in terms of - and -derivatives. Then we study gradient vectors and show how they are used to determine how directional derivatives at a point change as the direction changes, and, in particular, how they can be used to ﬁnd the maximum and minimum directional derivatives at a point.

In this section we introduce a type of derivative, called a directional derivative, that enables us to find the rate of change of a function of two or more variables in any direction.

Directional Derivatives

DEFINITION1  Directional Derivatives

Let be a unit vector. The directional derivative of at in the direction of is defined as

if the limit exist.

1. Note that if , then and if , then .

2. Consider a curve in the domain of . Note that is the line passing through in the direction of furthermore, and . Then it is easy to see that .

EXAMPLE1

Find the directional derivative of at in direction of .

Solution.

var('x,y,h')

f(x, y)=4*x^2*y+3*x*y+6*x+2

limit((f(1+h,-1+h*0) - f(1,-1))/h, h=0)

THEOREM 2

Suppose that is differentiable at and is any unit vector. Then

Proof.

(by the Chain rule)

.       ■

EXAMPLE2

Find the directional derivative if

and is the unit vector given by angle .

Solution.  When , the unit vector is

.

Since and ,

and .

Then .     ■

var('x,y')

f(x,y)=x^3-3*x*y+4*y^2

delf=vector([diff(f(x,y),x),diff(f(x,y),y)])

delfp=delf.subs(x=1,y=2)

u=vector([cos(pi/6),sin(pi/6)])

dirdr=delfp.dot_product(u)

print dirdr

For convenience, we define the gradient of a function to be the vector-valued function whose components are the first-order partial derivatives of , as specified in Definition 3. We denote the gradient of a function by grad or .

DEFINITION3

The gradient of is the vector-valued function

,

provided both first order partial derivatives exist.

3. In view of Theorem 2, we have

.

EXAMPLE3

(i) ,

(ii) .

Solution.

var('x,y')

f(x, y)=4*x^2+3*y^2-5*x*y

Answer : (x, y) |--> (8*x - 5*y, -5*x + 6*y)

(ii)

var('x,y')

f(x, y)=x*y/(x^2+y^2+1)

Answer : (x, y) |--> (-2*x^2*y/(x^2 + y^2 + 1)^2 + y/(x^2 + y^2 + 1), -2*x*y^2/(x^2 + y^2 + 1)^2 + x/(x^2 + y^2 + 1))

.  ■

The gradient is not limited to calculating partial derivatives; it plays important roles in multivariable calculus. Our present goal is to develop some intuition about the meaning of the gradient.

From Remark 3, . Using properties of the dot product, we have

where is the angle between and . It follows that has its maximum value when , which corresponds to . Therefore, has its maximum value and has its greatest rate of increase when and point in the same direction. Notice that when , the actual rate of increase is .

Similarly, when , we have , and has its greatest rate of decrease when and point in opposite directions. The actual rate of decrease is . These observations are summarized as follows:

Write these as three observations:

1. The gradient points in the direction of steepest ascent at .

2. The negative of the gradient points is the direction of steepest descent.

3. Notice that when the angle between and is , which means and are orthogonal.

EXAMPLE4

(a)Find the derivative of at the point in the direction of the unit vector .

(b) What is the direction in which the function increase most rapidly at in -plane region?

(c) Determine the direction of zero change in at (3, 4).

Solution.  (a) Since ,

,

hen the directional derivative is

.

(b) The function increases most rapidly in the direction of the gradient. The gradient is

.

Its direction is

.

(c) The directions of zero change in at (3, 4) are the directions orthogonal to .

and .

Computing shows that they are perpendicular.

.    ■

Note that Observation 3 says that in the direction orthogonal to the gradient , the function does not change at . Recall the curve , where is a constant, is a level curve, on which function values is constant. Combing these two observations, we conclude that gradient is orthogonal to the line tangent to the level curve through .

THEOREM 4  The Gradient and Level Curves

Given a function differentiable at , the line tangent to the level curve of at is orthogonal to the gradient  .

Proof.  A level curve of the function is a curve in the -plane of the form , where is a constant. By Theorem 6 in section 13.5, the slope of the line tangent to the level curve is .

It follows that any vector that points in the direction of the tangent line at the point is a scalar multiple of the vector

.

At that same point, the gradient points in the direction

.

The dot product of and is

which implies that and are orthogonal to each other.

An immediate consequence of Theorem 4 is an alternative equation of the tangent line. The curve described by can be viewed as a level curve for a surface. By Theorem 4, the line tangent to the curve at is orthogonal to . Therefore, if is a point on the tangent line, then , which, when simplified, gives an equation of the line tangent to the curve .

EXAMPLE5

Consider the upper sheet of a hyperboloid of two sheets.

(a)Verify that the gradient at is orthogonal to the corresponding level curve at that point.

(b) Find an equation of the tangent line to the level curve at .

Solution.  (a) You can verify that is on the surface; therefore, is on the level curve corresponding to . Setting in the equation of the surface and squaring both sides, the equation of the level curve is or , which is the equation of an ellipse. Differentiating with respect to gives , which implies that the slope of the level curve is . Therefore, at the point , the slope of the tangent line is . Any vector proportional to has slope and points in the direction of the tangent line.

.

It follows that . The tangent vector and the gradient are orthogonal because

.

(b) An equation of the line tangent to the level curve at is

.

Then the tangent line is

Functions of Three Variables

Let be a function of three variables deﬁned on some domain in . The notion of directional derivative and gradient of can be deﬁned just by introducing extra component z in definition of two variable function . For the sake of completion, let us write these definitions:

DEFINITION5

Let be a function of three variables deﬁned in a domain . Let and be an unit vector in . Then the directional derivative of at in the direction of is given by

if the right hand side limit exists.

Again using chain rule it turns out that

.

DEFINITION6

Let be a function of three variables deﬁned in a domain . Let and possesses continuous first order partial derivative at . Then the gradient of at is deﬁned as

EXAMPLE6

Find the directional derivative of the function at in direction of .

Solution.  We have , , and so that

Since and is a unit vector in the indicated direction. From last definition we obtain

.

Suppose has continuous first order partial derivatives. Then the surface

is one of the level surfaces of . Let

be differentiable curves passing through the point on where  , and . For all , we obtain

.

Then using the chain rule, we have

.   .

Therefore

,

where is a tangent vector of the curve. What we conclude from this is that the gradient passing through is perpendicular to the tangent vector of all differentiable curves along . (See Figure 1.) Thus is perpendicular to the tangent vector of all differentiable curves passing through on . Therefore, these lines are perpendicular to and in the plane passing through .

Figure 1 is perpendicular to tangent vector of differentiable function at . So tangent vector is on the surface.

EXAMPLE7

Find the directional derivative of the function at the point in the direction of the vector .

Solution.  The unit vector of is

with .

The partial derivatives of at are

.

.

Hence the directional derivative of at in the direction of is

.   ■

EXAMPLE8

Estimate how much the value of will change if the point moves unit from straight toward .

Solution.  We first find the directional derivative of at in the direction of the vector  . The unit vector of is

.

.

Therefore,

.

The change in  that results from moving unit away from in the direction of is approximately

unit.

EXAMPLE9

Plot the contour plot and level surface of

.

html("<i>  <b> Directional derivative 시각화 <p></p> </b>"   )

var('x,y,t,z')

f(x,y)=2*sin(x)*cos(y)

line_thickness=3

surface_color='blue'

plane_color='purple'

line_color='red'

tangent_color='green'

@interact

def myfun(location=input_grid(1, 2, default=[0,0], label = "Location (x,y)", width=2), angle=slider(0,2*pi, label = "Angle"),

show_surface=("Show surface", True), show_contour=("Show Contour Plot", True)):

location3d = vector(location[0]+[0])

location = location3d[0:2]

direction3d = vector(RDF, [cos(angle), sin(angle), 0])

direction=direction3d[0:2]

cos_angle = math.cos(angle)

sin_angle = math.sin(angle)

curve_point = (location+t*direction).list()

curve = parametric_plot(curve_point+[f(*curve_point)], (t,-3,3),color=line_color,thickness=line_thickness)

plane = parametric_plot((cos_angle*x+location[0],sin_angle*x+location[1],t), (x, -3,3), (t,-3,3),opacity=0.8, color=plane_color)

pt = point3d(location3d.list(),color='green', size=10)

tangent_line = parametric_plot((location[0]+t*cos_angle, location[1]+t*sin_angle, f(*location)+t*df(*location)*(direction)), (t, -3,3), thickness=line_thickness, color=tangent_color)

picture3d = direction_vector+curve+plane+pt+tangent_line

picture2d = contour_plot(f(x,y), (x,-3,3),(y,-3,3), plot_points=100)

picture2d += arrow(location.list(), (location+direction).list(),color="red")

picture2d += point(location.list(),rgbcolor='green',pointsize=40)

if show_surface:

picture3d += plot3d(f(x,y), (x,-3,3),(y,-3,3),opacity=0.7)

dff = df(location[0], location[1])

dff3d = vector(RDF,dff.list()+[0])

picture2d += arrow(location.list(), (location+dff).list(), rgbcolor=gradient_color, width=line_thickness)

if show_contour:

show(picture2d, aspect_ratio=1)

show(picture3d,aspect=[1,1,1], axes=True)

Figure 2

Figure 3

13.6 EXERCISES (Directional Derivatives and Gradient)

http://matrix.skku.ac.kr/Cal-Book/part2/CS-Sec-13-6-Sol.html

1. Find the directional derivative of the function at the point in the direction of the vector .

Solution. ,

⇒  ,

.

2. Find the directional derivative of the function at the point in the direction of the vector .

Solution.  => and .

, ,

.

3. Find the directional derivative of the function at the point in the direction of the vector .

Solution.

.

4. If , find

Solution.

var('x, y, z')

f(x, y, z)=1/sqrt(x^2+y^2+z^2)

(x, y, z) |--> (-x/(x^2 + y^2 + z^2)^(3/2), -y/(x^2 + y^2 + z^2)^(3/2), -z/(x^2 + y^2 + z^2)^(3/2))

Therefore,

.

5. Find the gradient of at the point .

Solution.         .

6. Use the definition of the gradient, assume that and are differentiable function on , and let be a constant. Prove the following gradient rules.

(1)

(2)

(3)

(4)

Solution. and are differentiable function on

(1)

.

(2)

.

(3)

(4)

.

7. Find the gradient of .

Solution. ,

.

13.7 Tangent Plane

In this section, we introduce tangent plane to a surface and look at how to find its equations. Tangent plane is extension of tangent line to a one variable function

.

Recall that if be a differentiable function of one variable, then the equation of the tangent line at is given by

.

Tangent Plane

A tangent plane is defined to be a plane that is just tangent to a surface (it touches the surface in only one point).

To derive the equation of tangent plane, we will use Theorem 4 in section 13.6: tangent plane is orthogonal to the gradient. Let be a differentiable function in its domain. If is surface which is a level surface of and is a point on , then we have proved that the gradient is orthogonal to the tangent line to level curves. (See Figure 1.)

Figure 1 Tangent Plane to a surface

Thus one can define tangent plane at to as a plane which is perpendicular to , provided .

Thus, if and are points on the tangent plane and and are their corresponding position vectors, respectively, a vector equation of tangent plane is

where .

The definition of tangent plane is given below:

DEFINITION1     Tangent Plane

Let be a point on the level surface where is not . Then an equation of the tangent plane at is

EXAMPLE1

Find an equation of the tangent plane to the graph of the sphere at .

Solution.  By defining , we find that the given sphere is the level surface passing through . Now,

, ,

so that

and .

It follows the form in Definition 1 that an equation of the tangent plane is

or   .

See in Figure 2.

Figure 2 Tangent Plane in Example 2

The equation of the tangent plane obtained in for a function at a point where can be obtained using Definition 1 the graph of the function can be thought of level surface of , where . In this case we have

, and .

Hence by Definition 1, the equation of tangent plane is

.

This implies that the equation of tangent plane is

.

DEFINITION2     Equation of Tangent Plane

Let be a function of two variables having first order continuous partial derivatives in some domain. Let be a point in the domain of . Then equation of tangent plane to the surface at the point is given by

.

EXAMPLE2

Find the tangent plane to the surface at the point . (See figure 3.)

Figure 3

Solution. Let . Then and . Since and , the equation of tangent plane is

.

var('x,y')

f(x,y)=9-x^2-y^2

a,b=1,2

fx=f.diff(x)(a,b)

fy=f.diff(y)(a,b)

T(x,y)=f(a,b)+fx*(x-a)+fy*(y-b)

show(T(x,y))

p=plot3d(f,(x,-2,2),(y,-3,3),color='red',opacity=0.3);

pt=point3d((a,b,f(a,b)),pointsize=50)

tgt=plot3d(T,(x,a-0.6,a+0.6),(y,b-0.6,b+0.6),color='blue',opacity=0.5);

p+pt+tgt

Normal Line

Let be a function having continuous first order partial derivatives. Then the gradient to the surface at is given by

where .

We know that the gradient is perpendicular to the tangent plane to the surface at the point . Hence the parametric equations of the normal line is given by

,

,

In case and , the symmetric equation of the normal line to the surface at can be written as

.

EXAMPLE3

Find the tangent plane and the normal line at  the point to the surface

. (See Figure 4.)

Figure 4  A tangent plane and a normal vector to the surface

at .

Solution. 1. The partial derivatives of at are

By Definition 1, the equation of a tangent plane at   is

or

.

By , the equation of normal line is

().    ■

EXAMPLE4

Find the tangent plane and the normal line at  the point to the surface  .

Solution.  Given equation can be written as

Then the equation can be considered as a level surface of

.

Therefore our tangent plane at is the plane perpendicular to the gradient at . Now we have

,

,

.

The equation of tangent plane is

or  .

The equation of normal line is

var('x,y,z,t')

F=ln(x^2+y^2)-z

normal=g.subs(x=1,y=2,z=ln(5))

PP_0=vector([x-1,y-2,z-ln(5)])

T=normal.dot_product(PP_0)

Nline=vector([1+normal[0]*t,2+normal[1]*t,ln(5)+normal[2]*t])

print T==0

print Nline

■

EXAMPLE5

Use sage to ﬁnd the tangent plane and the normal line to the surface at , . Also plot all these together.

Solution.

var('x,y,z,t')

f(x,y)=4*x*y*exp(-x^2-y^2)

F(x,y,z)= z-4*x*y*exp(-x^2-y^2)

a,b=1,0.5

c=f(a,b)

delFp=delF(a,b,c)

tangent_plane=delFp.dot_product(vector([x-a,y-b,z-c]))==0

print "The tangent plane is"

show(tangent_plane)

fx=f.diff(x)(a,b)

fy=f.diff(y)(a,b)

normal_line= (x==a+t*fx, y==b+t*fy, z==c-t)

print "The normal line is"

show(normal_line)

Answer : The equation of the Tangent Plane is:

0.573009593720380x−0.573009593720380y+z−0.859514390580570=0

The equation of the normal line  is:

(x=−0.573009593720380t+1,y=0.573009593720380t +0.500000000000000, z=−t+0.573009593720380)

Figure 5

pt=point3d((a,b,f(a,b)), pointsize=50, color='red')

p=plot3d(f, (x,-2,2),(y,-2,2), color='green', opacity=0.2)

tangent=implicit_plot3d(delFp.dot_product(vector([x-a,y-b,z-c]))==0,(x,a-0.3,a+0.3),(y,b-0.3,b+0.3),(z,c-0.3,c+0.3), color='blue', opacity=0.5)

normal=parametric_plot3d(vector([a+t*fx,b+t*fy, c-t]),(t,-1,1),color='red')

p+pt+tangent+normal

Answer : [[x == 0, y == 0], [x == -1/2*sqrt(2), y == -1/2*sqrt(2)], [x ==1/2*sqrt(2), y == -1/2*sqrt(2)], [x == -1/2*sqrt(2), y == 1/2*sqrt(2)], [x == 1/2*sqrt(2), y == 1/2*sqrt(2)]]

13.7 EXERCISES (Tangent Plane)

http://matrix.skku.ac.kr/Cal-Book/part2/CS-Sec-13-7-Sol.html

1. Find the equation of the tangent plane at the point to the surface .

Solution.

⇒ The equation of the tangent plane is

2. Find the equation of the tangent plane and the normal line at the point to the surface .

Solution.

⇒  and

Hence at the point , the tangent plane is and the normal line is (that is, ).

3. Find so that all tangent planes to the surface pass through the origin for all .

Solution. Let  . Then we have that

and

.

Since every tangent plane intersects the origin, the equation of the tangent plane at a point on the surface should satisfies

.

We then have

.

Simplifying the equation, we obtain

which implies .

4. Find the tangent plane of the surface at .

Solution. Let .

Due to implicit differentiation, we have

, and .

In particular, at we have

Thus, the tangent plane is . Simplifying it, we have .

5. Find the equation of the tangent plane and the normal line to the surface at .

Solution.

Equation of tangent plane:

.

or .

Equation of normal line:

, .

6. Let be the surface whose equation in cylindrical coordinates is . Find the tangent plane and the normal line to at the point in rectangular coordinates.

Solution. The equation of  in rectangular coordinates is given by .

If we regard as a level surface of

at , then the normal vector of the tangent plane is , where and hence

Therefore, the equations of the tangent plane is

or

.

And the normal line is

.

7. Let if and let

In the direction of what unit vectors does the directional derivative of at exist?

Solution. Suppose we wish to compute the directional derivative of in the direction of a unit vector Then

and the limit does not exist unless or Hence the directional derivative of at exists in the directions of and or their unit scalar multiples.

8-9. Find the tangent plane to the given surface at the indicated point.

8. at .

Solution.

var('x, y, z, w')

f(x, y, z, w)=x^2+y^2+z^2-w

fx(-1, 0, 0, 1)*(x+1)+fy(-1, 0, 0, 1)*(y-0)+fz(-1, 0, 0, 1)*(z-0)+fw(-1, 0, 0, 1)*(w-1)==0

Answer : -w - 2*x - 1 == 0

9. at .

Solution.

var('x, y, z')

f(x, y, z)=exp(3*y)*cos(2*x)-z

p1=implicit_plot3d(f(x, y, z)==0, (x, 0, pi/2), (y, -1, 1), (z, -1, 0), opacity=0.6)

p2=implicit_plot3d(fx(pi/3, 0, -1/2)*(x-pi/3)+fy(pi/3, 0, -1/2)*(y-0)+fz(pi/3, 0, -1/2)*(z+1/2)==0, (x, 0, pi/2), (y, -1, 1), (z, -1, 0), color='orange', opacity=0.6)

p3=point3d([pi/3, 0, -1/2], color='red')

p1+p2+p3

1/3*(pi - 3*x)*sqrt(3) - 3/2*y - z - 1/2 == 0

10. Find the equations of the tangent plane and normal line at the point to the paraboloid .

Solution.

var('x,y,z,t')

F=-x^2-y^2-z

normal=g.subs(x=-1,y=1,z=-2)

PP_0=vector([x+1,y-1,z+2])

T=normal.dot_product(PP_0)

Nline=vector([-1+normal[0]*t,1+normal[1]*t,-2+normal[2]*t])

print T==0

print Nline

Answer : 2*x - 2*y - z + 2 == 0

(2*t - 1, -2*t + 1, -t – 2)

p1=implicit_plot3d(z==-x^2-y^2,(x,-7,7),(y,-7,7),(z,-7,7), opacity=0.2, color="red", mesh=True);

p2=implicit_plot3d(dF_p*(w-p)==0,(x,-7,7),(y,-7,7),(z,-7,7), opacity=0.2, color="blue",
mesh=True);

p3=parametric_plot3d((-2*t-1,2*t+1,t-2),(t,-1,1), opacity=1, color="red", mesh=True);

show(p1+p2+p3, aspect_ratio=1)

So tangency normal vector is clear.

11. Find the equations of the tangent plane and the normal line at  the point to the surface .

Solution. We have ,

, .

Hence, .

Therefore by the equation of the tangent plane to the surface at the point is

Or, .

By the equation of the normal line at the point to the surface is

, .

12. The surface and  meet in an ellipse . Find parametric equations for the line tangent to at the point .

Solution. Let be a point on the intersection of these surfaces. Then the tangent line at to the curve is orthogonal to and . In particular, it is parallel to .

The components of and the coordinates of give us equations for the line. We have

, .

Therefore .

Thus the tangent to the curve at is parallel to the vector . Therefore, its equation is .

13. Sketch a level curve (ellipse) of passing through the pont . Find a vector perpendicular to this ellipse at the point .

Solution. The value of at the point is .

Therefore, the level curve of passing through is , which is an ellipse. Vector perpendicular to this ellipse at the point is .

13.8 Extrema of Multivariate Functions

We have seen how to find extreme values of a single variable function as an application to derivatives. In this section we look at how to find extrema  of multivatiate functions as an application to partial derivatives. As with single variable function, concepts developed in this section are useful for practical optimization problems.

Local and Global Maximum and Minimum

We begin with the definition of local and relative extrema for a function of two variables and .

DEFINITION1  Local Maximum and Minimum

(i) A point is a local maximum of a function if for all near in the domain of .

(ii) A point is a local minimum of a function if for all near in the domain of .

Let and suppose has a local minimum at . This means there exists positive real numbers such that   for all and . Similarly, we can define a local maximum at .

When in , is a single variable function. Suppose the first order partial derivatives of exist at the point , then we have since it has the extreme value at .

Likewise, when , has the extreme value at and . Therefore, if is a local maximum or local minimum of , then

This is in fact, a necessary condition for a point to be a point of local maximum/minimum of . All such points where first order partial derivatives vanish are called critical points of .

Figure 1

DEFINITION2

A critical point of a function is a point in the domain of for which and , or where one of its partial derivatives does not exist.

THEOREM 3  Local Extrema

If a function has a local extremum at point and  the first derivatives exist at this point, then

and .

Theorem 3 says that if has a local maximum or local minimum at , then is a critical point of . In general, can be a critical point of even though is not a local maximum or local minimum value.

Figure 2

The discussion below/above suggests the next theorems.

Let us look at . The graph of is shown in the Figure 1.

The point in Figure 2, is a critical point which is neither a local maximum nor local minimum. It is easy to see that and implies that and . That means is the only critical point of . However from the graph, it is clear that is not a local maximum/local minimum. In fact if we take any small neighborhood around , there are points and in this neighborhood where   and . Because this surface looks like a saddle horse, such a critical point is called a saddle point.

Another way of looking at Theorem 3 is the following. Suppose has continuous ﬁrst order partial derivatives. We know that is the direction in which function increases with maximum speed. Thus, if is a point of local maximum, then at on the surface, , there is no direction in which function can increase. Hence which implies . Similarly, at the point of local minimum .

EXAMPLE1

Find all the critical points for .

Solution.  The first partial derivatives are

and .

Hence, and implies

and .

Thus the critical point is .

Figure 3

EXAMPLE2

Find all the critical points for .

Solution. The first partial derivatives are

and .

Hence, and implies

and .

Thus, the critical point is .

EXAMPLE3

Find critical points of . Plot the surface and its contour lines.

Solution.

var('x,y')

f(x,y)=4*x*y*exp(-x^2-y^2)

fx=f.diff(x)

fy=f.diff(y)

sol=solve([fx==0,fy==0],[x,y],solution_dict=True)

sol

Answer : [{y: 0, x: 0}, {y: -1/2*sqrt(2), x: -1/2*sqrt(2)},

{y: -1/2*sqrt(2), x:1/2*sqrt(2)}, {y: 1/2*sqrt(2), x: -1/2*sqrt(2)},

{y: 1/2*sqrt(2), x:1/2*sqrt(2)}]

Here has five critical points and . This is clear from the graph of the surface . Look at Figure 4.

Figure 4                                   Figure 5

It is also clear from the Figure Give Reference that f has two points of local maximum and two points of local minimum and a saddle point. Look at contour line of the function . Look at Figure 4.

It is clear from the contour lines of (See Figure 5.) that, near the point of local maximum and local minimum, level curves resembles concentric circles. Near saddle points, the level curves are hyperbolic looking shapes.     ■

Second Derivative Test

We know that critical points are likely candidates for point of local maximum, local minimum or saddle point. Analogous to second derivative test for function of one variable, there is second derivative test for functions of two variables to classify critical points as local maximum, local minimum or saddle points.

The following theorem tells us how to decide the local maximum and local minimum of a given function at a critical point.

THEOREM 4  Second Derivatives Test

Suppose and has continuous second-order partial derivatives in a neighborhood of . Let

.

(1) If and , then is a local maximum.

(2) If and , then is a local minimum.

(3) If , then does not have a local maximum or
minimum at . The point is a saddle point.

In case (c) the point is called a saddle point of and the graph of crosses its tangent plane at .

If , the test gives no information: could have a local maximum or local minimum at , or could be a saddle point of .

To remember the formula for , it’s helpful to write it as a determinant:

The proof of theorem follows from Taylor’s series of two variables function which is given at the end of this section.

EXAMPLE4

Classify the critical points of .

Solution. Suppose is a critical point of , then

.

Solving the above equation for , , we get three critical points , and . Look at the Figure 6 and Figure 7. It is clear that has two local maximum and one saddle point.

Figure 6                                      Figure 7

Now let us use the second derivative test to classify these critical points. We have

, and .

At the critical point , and . That means . Hence is a saddle point.

At the critical point , and . That means and . Hence is a local minimum.

At the critical point , and . That means and . Hence is also a local minimum. ■

http://matrix.skku.ac.kr/cal-lab/m-Sec13-8-Exm-4.html

var('x,y')

f(x,y)=x^4+y^4-4*x*y+1

fx=f.diff(x); fy=f.diff(y)

cpoints=solve([fx==0,fy==0],[x,y],  solution_dict=True)

for sol in cpoints:

if ((sol[x] in RR) and (sol[y] in RR)):

show([sol[x],sol[y]])

var('x,y')

f(x,y)=x^4+y^4-4*x*y+1

fxx=diff(f,x,2);fyy=diff(f,y,2);fxy=diff(f,x,y)

a,b=-1,-1

show([fxx(a,b),fyy(a,b),fxy(a,b)])

D=fxx(a,b)*fyy(a,b)-fxy(a,b)^2

print bool(D>0)

print bool(fxx(a,b)>0)

c=f(a,b)

print c #local minimum

print "Since D>0 and \$f_{xx}>0\$, f(-1,-1)=-1 is a local minimum."

Answer : [12,12,−4], True, True, -1

Since D>0 and , is a local minimum.

a,b=0,0

show([fxx(a,b),fyy(a,b),fxy(a,b)])

D=fxx(a,b)*fyy(a,b)-fxy(a,b)^2

TF=bool(fxx(a,b)>0)

print bool(D>0)

print bool(fxx(a,b)>0)

c=f(a,b)

print c

print "Since D<0, (0,0,1) is a saddle point."

Answer : [0,0,−4], False, False, 1

Since D<0, (0,0,1) is a saddle point.

a,b=1,1

show([fxx(a,b),fyy(a,b),fxy(a,b)])

D=fxx(a,b)*fyy(a,b)-fxy(a,b)^2

TF=bool(fxx(a,b)>0)

print bool(D>0)

print bool(fxx(a,b)>0)

c=f(a,b)

print c

print "Since D>0 and \$f_{xx}>0\$, f(-1,-1)=-1 is a local minimum."

Answer : [12,12,−4], True, True, -1

Since D>0 and , is a local minimum.

EXAMPLE5

Find the local extreme values of .

Solution. The domain of is the entire plane and the partial derivatives  and exist everywhere. Therefore, local extreme values can occur only when

and  .

The only possibility is the origin, where the value of is zero. Since is never negative, we see that the origin gives a local minimum. (See Figure 8.) This can be written by using Theorem 4. We have

,      and   .

Hence, .

Since and , is a point of local  minimum.

Figure 8  The paraboloid has a local minimum value of at the origin.

EXAMPLE6

Find the local extreme values of the function

.

Solution. Note that has continuous second order partial derivatives at all points in the plane. The function therefore has extreme values only at the points where and are simultaneously zero. This leads to

,

or

.

Therefore, the point is the only point where may have extreme value. We calculate

.

At ,

and .

Then has a local maximum at . The value of at this point is .

EXAMPLE7

Find the local maximum and minimum of

in the domain .

Solution. We have

From the second equation, or . That is, or , is an integer number.

When , from the first equation, , is an integer number. In this case, we have three critical points and in the given domain.

And in another case, when , then . So critical points are and in the given domain. We will check that these points are wether a local minimum point or a local maximum point or a saddle point.

Next we compute the second partial derivatives;

and evaluate the discriminant at each critical point;

For , since , is a saddle point.

For , since and , is a local minimum.

For , since , is a saddle point.

For , since and , is a local minimum.

Therefore has a local minimum at and .

EXAMPLE8

Find the point on the plane nearest the origin.

Solution. Let be any point on the plane . Then the distance from the origin to the plane is .

Since , we obtain

.

Let .

If is minimum value, then is minimum value. So we get

,

Solving the above equations, we get a critical point .

Next we compute the second partial derivatives;

and evaluate the discriminant at each critical point;

and .

Thus has a local minimum at .  Hence the nearest point in the plane is    . ■

Just see how to implement the user defined function to list all critical points and tabulate along with its type (nature). This appears in the attached sage worksheet.

Absolute Maximum and Minimum Values

For any continuous function deﬁned on a closed interval of ﬁnite length , we know should have an absolute maximum and an absolute minimum value on . In this section, we want to determine the analogue of , a function of two variables and .

We will study how to find the absolute maximum and the absolute minimum values of a continuous function on a closed and bounded region in the -plane.

DEFINITION5  Absolute Maximum and Minimum

(i) If for all in the domain of , then has an absolute maximum at . is an absolute maximum value.

(ii)If for all in the domain of , then has an absolute minimum at . is an absolute minimum value.

Analogous to have extreme values at endpoint, a function of two variables can have extreme values on the boundary of the closed set .

PROCEDURE

Absolute Maximum and Minimum Values on a Closed Bounded Set

Let be continuous on a closed bounded set in . To find absolute maximum and minimum values of on ,

1. Determine the values of at all critical points in .

2. Find the maximum and minimum values of on the boundary of .

3.The greatest function value found in 1 and 2 is the absolute maximum value of on , and the least function value found in 1 and 2 is the absolute minimum value of on .

EXAMPLE9

Find the absolute maximum and minimum values of the on the closed set

.

Solution. To find critical points, we have

and .

Then is a critical point and so .

We now determine the maximum and minimum values of on the boundary of , which is a circle of radius described by the parametric equations

and for .

Substituting and in terms of   into the function , we obtain a new function that gives the values of on the boundary of . Thus

The critical points of satisfy

or . Therefore, has critical points and , which correspond to the points and .

The function values are

(critical point)

(boundary point)

(boundary point)

After comparing these values, we can decide that        is an absolute minimum value of and is an absolute maximum value of .

* Extreme of Implicit function

Let be an implicit function and assume that has second order continuous partial derivatives.

In order to find extremum of , we will find the point such that

, .

Such points are called singular points of . We have

,  and  .

If is a point of local maximum or minimum, then since .

THEOREM 6

Let be a extreme point and , then

(i) If , then has a local minimum at and  is called a point of local minimum.

(ii) If , then has a local maximum at and  is called a point of local maximum.

EXAMPLE10

Find the extreme values of the implicit function

.

Solution. Let .

To find singular points, we must solve the followings;

, .

Since , we have . Then two singular points are

.

Since , and . Thus,

,

By Theorem 2, is the local maximum value of .

var('x, y');

f(x, y) = x^3 -3*x*y + y^3

p=implicit_plot(f(x, y)==0, (x, -3, 3), (y, -3, 3))

pts=point([(0, 0), (2^(1/3), 4^(1/3))], rgbcolor='red', size=50)

show(p+pts)

Figure 9

Notice that at the tangent is parallel to axis, but it is not a  point of local extremum. Can you see this from the graph? The is a local maximum.

We have and .

To classify singular points we need to find the sign of . At , . Therefore is not a point of maximum/minimum value. At , . Theorem 6 and the graph shows  is a point of local maximum. The maximum of is which occurs at .

EXAMPLE11

Find the extreme values of the implicit function

.

Solution. Let . Solving the above two equations;

,

we get three singular points

.

Since ,

.

Then we have two extreme points; and .

For and , since ,

at and .

Hence the implicit function has local maximum value at .

*Expansion of Taylor's Theorem

In this section we shall look at Taylor’s Theorem.

Taylor’s Theorem for function of two variables is as follows.

THEOREM 7

Suppose the function has order continuous partial derivatives at . Let and be small enough.

Proof.  If  we let in ,

which is a function of . This single variable function can be expanded as following by Maclaurin formula:

.

Let in the above formula,

.

Differentiate   with respect to

.

Let in the above equation.

.

Similarly, we can differentiate with respect to

.

Let in the above equation.

.

In a similar way, we have a general form;

.

Substituting , we get

.  ■

When we replace and with and in Taylor’s Theorem for a two-variable function, it is transformed as follows:

.

Placing , in .

.

This is Maclaurin’s Theorem for two-variable functions which is a special case of the Taylor Theorem.

The case of at  in (Taylor) Theorem 7 is

which is the Mean Value Theorem for the two variable function.

EXAMPLE12

Find the Taylor series for the function at the point up to degree .

Solution. ,              ,

,            ,

,         ,

,           .

.

,           .

Therefore

.

EXAMPLE13

Expand the Taylor series for the function at .

Solution.

x, y=var('x, y');

taylor(x*y^3, (x, 1), (y, -1), 4)

Answer : (y + 1)^3*(x - 1) + (y + 1)^3 - 3*(y + 1)^2*(x - 1) - 3*(y + 1)^2 +3*(y+1)*(x-1)-x+3*y + 3

EXAMPLE14

Plot the surface . Find Taylor's polynomial of degrees 1, 2, 3, and 4. Plot the surface and graph of these polynomial together and show the Taylors polynomial approximates the function as the degree increases.

Solution.

var('x,y')

f = cos(x)*cos(y)

a=0

b=0

f1=taylor(f(x,y),(x,a),(y,b),1)

f2=taylor(f(x,y),(x,a),(y,b),2)

f3=taylor(f(x,y),(x,a),(y,b),3)

f4=taylor(f(x,y),(x,a),(y,b),4)

p=plot3d(f(x,y),(x,-3,3),(y,-3,3))

p1=plot3d(f1,(x,-1,1),(y,-1,1),color='red')

p2=plot3d(f2,(x,-1.5,1.5),(y,-1.5,1.5),color='goldenrod')

p3=plot3d(f3,(x,-2,2),(y,-2,2),color='green')

p4=plot3d(f4,(x,-2,2),(y,-2,2),color='violet')

p+p2+p1+p3+p4

Figure 10

13.8 EXERCISES (Extrema of Multivariate Functions)

1. Let . Find the critical points of and classify them.  Solution. Solve and

. So we have critical points, or . If , then . If , then we have .

The critical points are

, , , .

Next, we consider second order partial derivatives to get , , .

Then and thus we obtain at points , . This implies that , are saddle points.

At points , , we observe that .

Moreover, since , has a local maximum at . On the other hand, due to , has a local minimum at .

2. Find the extreme values of the function when .

Solution.

: critical points

=> has no local minimum. or maximum at .

At ,

, so has a local maximum

at .

3-4. Locate the maxima, minima, and saddle points of the functions.

3. .

Solution.

var ('x, y, z')

f(x,y)=2*(x^2-y^2)-x^4+y^4

P=implicit_plot3d (z==f(x, y), (x,-1.5,3/2), (y,-3/2,3/2), (z,-1,1), color= 'goldenrod', opacity=0.6)

P.show()

contour_plot(f, (x,-2,2), (y,-2,2), contours= srange(-2,2,0.25), fill=False, cmap= 'cool', labels=True)

var ('x, y, z')

f(x,y)=2*(x^2-y^2)-x^4+y^4

fx=f.diff(x)

fy=f.diff(y)

fxx=diff(f,x,x)

fyy=diff(f,y,y)

fxy=diff(f,x,y)

cpoints=solve([fx==0,fy==0],[x,y],solution_dict=True)

for sol in cpoints:

if ((sol[x] in RR) and (sol[y] in RR) ):

print((sol[x],sol[y]))

(0, 0), (1, 0), (-1, 0), (0, 1), (1, 1), (-1, 1), (0, -1), (1, -1), (-1, -1)

def extreme(f,a,b):

f11=diff(f,x,x)(a,b)

f22=diff(f,y,y)(a,b)

f12=diff(f,x,y)(a,b)

D=f11*f22-f12^2

if(D>0):

if(f11>0):

return "local minimum"

else:

if(f11<0):

return "local maximum"

else:

return "inconclusive"

else:

if(D<0):

else:

if(D==0):

return "inconclusive"table = [["Critical Point", "Type"]]

f(x,y)=2*(x^2-y^2)-x^4+y^4

fx=f.diff(x)

fy=f.diff(y)

fxx=diff(f,x,x)

fyy=diff(f,y,y)

fxy=diff(f,x,y)

cpoints=solve([fx==0,fy==0],[x,y],solution_dict=True)

for sol in cpoints:

if ((sol[x] in RR) and (sol[y] in RR)):

a=sol[x].n()

b=sol[y].n()

table.append([(sol[x],sol[y]), extreme(f,a,b)])

Critical Point  Type

(1, 0)          local maximum

(-1, 0)         local maximum

(0, 1)          local minimum

(0, -1)         local minimum

4. .

Solution.   Try this on your own.

5. Let . Answer the following:

(a) Find points of local maximum/minimum and a saddle point when .

(b) Give a condition on for the case when has only one critical point.

Solution.      (a)

and

and

are points of local minimum.

(b)

If has only one critical point has a solution and should not have a solution. So .

6. Find maximum value of on .

Solution.   ,

So the critical point is and thus critical value is

Let ,

,

and .

On , we have and

, .

On , we have and  , .

On , we have and

.

On , we have and

. .

So the maximum value is 2.

7. Find the absolute maximum and minimum of  in the domain which is a closed triangle made of three points (0. 0), (2, 1), (1, 2).

Solution.       (1)

critical point :

(2) 1. moves on

The absolute maximum , and the absolute minimum on .

2. moves on   The absolute maximum , and the absolute minimum on .

3. moves on

The absolute maximum  , and the absolute minimum on .

Hence the absolute maximum is 2 and the absolute minimum is 0.

8. Find the absolute maximum and minimum values  on the disk  D:
.

Solution.   interior of :

Then implies

If implies

Thus, we get the critical points

If then

This implies .

Critical points are

Thus C

onsider , boundary of :

so

Moreover, is smallest when and largest when   But

Thus on D the absolute maximum of is and the absolute minimum is

9. Find the Taylor series for the function

at the point .

Solution. , ,

, ,

, ,

, ,

, ,

, .

Therefore

.

10. Expand the Maclaurin series for the function .

Solution.   ,

,

,

,

,

,

In general,

13.9 Lagrange Multiplier

Constrained Optimization (Lagrange Multiplier)

So far we have dealt with finding maximum or minimum of a function of one or more variables without any constraints. Such problems are called unconstrained optimization problems. However, most of real life problems of maximization or minimization involves certain outside conditions or constraints. Such problems are called constrained optimization problems. This section deals with such problems where the constraints are of equality types. The method of Lagrange multipliers is a powerful tool for solving this class of problems without the need to explicitly solve the conditions and use them to eliminate extra variables.

First of all let us consider a minimization/maximization problem of a function of two variables.

Find extreme values of subjected to .

Let us look at this problem geometrically. We wish to find the maximum and minimum value of on the unit circle .

The point at which such a minimum (maximum) occurs is called a minimizer (maximizer).

Note that , for various values of represent parallels lines. The value of increases as we move from left to right along the line . Thus we are looking for a point on the circle at which the value of is minimum and maximum.

Look at the Figure 1. It appears that this happens when these curves just touch each other, that is, when they have a common tangent line. In particular, the normal vectors (gradient) to the level curves of and at the point of maximum or minimum are parallel to each other.

Figure 1

p=contour_plot(f(x,y), (x,-2,2), (y, -2, 2), contours=40, fill=False, cmap='cool', linestyles=['solid'])

p+=implicit_plot(g(x,y)==0, (x,-2,2), (y,-2,2), cmap=['blue'])

p+=points([[sqrt(2)/2,sqrt(2)/2],[-sqrt(2)/2,-sqrt(2)/2]], pointsize = 30, color = 'green')

p+=implicit_plot(f(x,y)==sqrt(2), (x, -2, 2), (y, -2, 2), color= 'red')

p+=implicit_plot(f(x,y)==-sqrt(2), (x, -2, 2), (y, -2, 2), color='red')

p.show(figsize=4, dpi=200)

This turns out to be the necessary condition for a point to be minimum of maximum in general under certain conditions.

Let us consider finding a minimizer of subjected to .

Suppose is a point of minimum  on the level curve and that the minimum value is .

Let be a parameterized curve on with . Since has minimum value at , the composition function has minimum at . Hence

.

In particular, is orthogonal to . We already know that the is orthogonal to the . Thus at the point of minimizer , is parallel to provided

(We shall see later why do we need .)

More precisely we have the following theorem:

THEOREM 1

Let have continuous first order partial derivatives. Let be a point of minimizer or maximizer of subjected to . Then and are parallel to each other. In particular, if , then there exists a scalar such that . Here is called the Lagrange multiplier.

Let be a point at which has maximum or minimum subjected to . Then there exists such that we have

, and .

The are called the Lagrange conditions.

In order to find minimum/maximum of subjected to , we use the following steps :

Step 1. Find all the points that satisfy the Lagrange conditions .

Step 2. Evaluate at all the points obtained in Step 1. The largest of these values is the maximum value of and the smallest is the minimum value of .

Lagrange Conditions in Three Variables

If is a point at which has maximum or minimum subjected to with , then there exists such that we have

, , and .

EXAMPLE1

Optimize subjected to .

Solution.  Look at the Figure 2 in which level curves of and the curve are shown. It is clear from the Figure that there are fours points at which the two curves have common tangents. In particular, we can expect to get four points at which has extreme values.

Figure 2

Using the Lagrange necessary conditions, there exits such that we have the following equations

and

.

From , we have . This mean    or .

If , then . So the points are .

If , then from the second equation, we have .      Hence from third equation, we get . Thus the points are .

We have four possible points of optimizers, and . Look at the Figure 2. From this figure, it is clear that at these points, the contours of and have common tangents. Look at the Figure 3, it is clear that at these points the gradients of and are parallel to each other.

Figure 3

The value of at these points are , . Hence the minimizer occurs and  the minimum value is . The maximum occurs at two points

with maximum value .       ■

var('x,y,lam,t')

f(x,y)=4+x^2-y

g(x,y)=x^2+y^2-1

fx=f.diff(x)

fy=f.diff(y)

gx=g.diff(x)

gy=g.diff(y)

sol=solve([fx==lam*gx,fy==lam*gy,

g==0],x,y,lam,solution_dict=True)

show(sol)

n=len(sol)

for j in range(n):

print f(sol[j][x], sol[j][y])

print "The Solution is tabulated as follows"

html.table([['x, y, (x, y)']] + [(sol[j][x], sol[j][y],

f(sol[j][x], sol[j][y]))  for j in range(n)], header = True)

EXAMPLE2

Find the extreme values(maximum and minimum) of subjected to the constrained .

Solution. Look at the Figure 4 which represent the level curves of and the curve . It is clear that there are four points at which the two level curves have common tangents. In particular, we can expect to have four points where has extreme values.

Figure 4

Using the Lagrange conditions, if is a solution of this problem then

and

.

Combining, the first two equations we get . This implies . Therefore, we have four points

, , , .

The value of the function at the first two points is and the value of the function at the last two points is . Thus the maximum value of and occurs at two points , . The minimum value of and it occurs at , .

Look at the following Figure 5 which show that the and are parallel at point of extremes.

Figure 5

var('x, y, lam, t')

f(x,y)=x*y

g(x,y)=x^2/8+y^2/2-1

fx=f.diff(x)

fy=f.diff(y)

gx=g.diff(x)

gy=g.diff(y)

sol=solve([fx==lam*gx, fy==lam*gy, g==0], x,y, lam,solution_dict=True)

show(sol)

n=len(sol)

print "The Solution is tabulated as follows"

html.table([["\$x\$", "\$y\$", "\$f(x, y)\$"]] + [(sol[j][x], sol[j][y],

f(sol[j][x], sol[j][y])) for j in range(n)], header = True)

−2   −1    2

2    1     2

−2   1    −2

2   −1    −2

EXAMPLE3

Find the dimensions of a cylindrical tin (with bottom and top) made up of a metal sheet to maximize its volume such that the total surface area is .

Solution.  Let and be the radius of the base and height of the cylinder. Then the total surface area of the metal sheet is and the volume is . Thus mathematically, we can write the above problem as:

maximize subjected to .

Using the Lagrange conditions, we get

.

After solving we get . Suppose is a solution of the above system of equation, then further using the constrained we obtain the solution

, , , .                ■

EXAMPLE4

Find the points on the ellipsoid that are closest and farthest from the point .

Solution.  If is any point in , then its distance from is given by  .

This means we need to optimize subjected to . Note that is minimizer (maximizer) of iff is minimizer(maximizer) of . Thus we need to optimize

subjected to .

Using the Lagrange conditions, we get

, , , .

Substituting the values , and from the first three equations  in the fourth, we get

.

Solving the above equation (using sage)  for we get

and .

For , the solution (using sage) is

and .

For , the solution is

and .

var('x,y,z,lam')

f=(x-2)^2+(y+1)^2+(z-2)^2

g=x^2+4*y^2+3*z^2-12

fx=f.diff(x)

fy=f.diff(y)

fz=f.diff(z)

gx=g.diff(x)

gy=g.diff(y)

gz=g.diff(z)

cpoints=solve([fx==lam*gx,fy==lam*gy,fy==lam*gy,fz==lam*gz,

g==0],x,y,z,lam,solution_dict=True)

cpoints

for sol in cpoints:

if ((sol[x] in RR) and (sol[y] in RR) and

(sol[z] in RR) and (sol[lam] in RR) and

(sol[lam] in RR)):

show([sol[x].n(),sol[y].n(),sol[z].n(),f(x=sol[x],y=sol[y],z=sol[z]).n()])

We should plot the points along with the surfaces.

Now let us consider the following example which explains why do we need, in Theorem 1.

EXAMPLE5

Maximize/Minimize subjected to .

Solution.

var('x,y,lam')

f(x)=x

g(x,y)=y^2+x^4-x^3

fx=f.diff(x)

fy=f.diff(y)

gx=g.diff(x)

gy=g.diff(y)

solve([fx==lam*gx,fy==lam*gy, g==0],x,y,lam)

Answer :  [[x == 1, y == 0, lam == 1]]

that is a solution of the above problem however, Lagrange method fails to detect this point. As in this case. Look the Figure 6.

t=var('t')

cf=contour_plot(f,(x,-.2,1.2),(y,-0.5,0.5),contours=40,fill=false,cmap='cool')

cg=implicit_plot(g,(x,-.2,1.2),(y,-0.5,0.5))

l1=parametric_plot((0,t),(t,-0.5,0.5),color='green')

l2=parametric_plot((1,t),(t,-0.5,0.5),color='red')

show(cf+cg+l1+l2,figsize=5)

Figure 6

Lagrange Multipliers for Two and More Constraints

Here we consider problems of minimization or maximization with two constraints. The method can be generalized to more than two constraints in a similar manner. In particular, we assume that we want to find the maximum and minimum values of a function subject to two constraints  of the form and . We assume that and are non zero and not parallel (that is, they are linearly independent).

Geometrically, this means that we are looking for the extreme values of f that lies on the curve of intersection of the level surfaces and .

Suppose, is a point on the curve of intersection of the level surfaces and and at which has an extreme value say . Let us see what this mean in terms of gradients.

Since is a point of extremum of , is orthogonal to the tangent vector to the level surface . On the other hand, we also have is orthogonal to the level curve and is orthogonal to the level curve . This means that lies in the plane spanned by two vectors and . That is, there exist scalars and such that

.

We summarize this in the following theorem (without proof).

THEOREM 2

Let , and be three functions having first order continuous partial derivatives. If is a solution of the problem

minimize/maximize subjected to and

where and are non zero and parallel. Then there exist scalars and such that

.

The scalars and are called Lagrange multipliers.

Witting the above conditions () along with the constraints, we get the Lagrange conditions

Many time it is continent to define a Lagrangian function

.

Then the Lagrange conditions ( to ) is equivalent to

, , and , .

EXAMPLE6

The cone is cut by the plane in some curve . Find the point on that is closest to the origin.

This problem can be stated as

minimize

subjected to , .

We define the Lagrangian function

Using the necessary condition for optimization we get the following

equations:

.

Now adding to and we reduce the above system to equations in unknowns;

.

Now we need to solve - for , , , .

From we get and from we get .

Equating the two values of and simplifying we get

.

This implies either or .

(Case I) when , from , we have

and from , we get

.

Using the above tow equations and solving for we get which does not have a real solution. Thus is not possible.

(Case II) when , from , we have

and from , we get

.

Thus

Solving this equation for we get . Now

.

Finally

.

Thus the critical points(possible optimizers) are

.

Note that and

.

Hence is a point of maximum.

Hence is a point of minimum. ■

x, y, z, lam, mu = var('x, y, z, lam, mu')

f = x^2+y^2 + z^2

g1 = x^2 + y^2 - z^2 - 1

g2 = x + y +z - 4

L = f - g1 * lam - g2*mu

cpoints

n=len(cpoints)

for sol in cpoints:

if ((sol[x] in RR) and (sol[y] in RR) and (sol[z] in RR) and (sol[lam] in RR) and (sol[mu] in RR)):

show([sol[x].n(), sol[y].n(), sol[z].n(), f(x=sol[x],y=sol[y],z=sol[z]).n()])

[1.26138721247417,1.26138721247417,1.47722557505167,5.36439079917344]

[6.73861278752583,6.73861278752583,−9.47722557505166,180.635609200827]

13.9 EXERCISES (Lagrange Multiplier)

http://matrix.skku.ac.kr/Cal-Book/part2/CS-Sec-13-9-Sol.html

1. In each of the following problems, find the extreme(maximum and minimum) values of   subjected to the given constrained:

(i) subject to .

(ii) subject to .

(iii) subject to .

(iv) subject to .

(v) subjected to

(vi) subjected to .

(vii) subjected to .

Can you generalize this?

2. Find the points on the sphere that are closest and farthest from the point .

3. Determine the dimensions of  a rectangular box, open at the top having  volume pf 32 cubic feets and requiring the least amount of material for its construction.

4. Find the maximum and minimum of

on the ellipse given by the intersection of the cylinder and the plane

5. Find the maximum and minimum of

on the ellipse given by the intersection of the cylinder and the plane .

6. Find the maximum and ninimum of when .

7. In the following exercises find the extreme values of subjected to the two constraints.

(a) ; ; .

(b) ; ; .

(c) ; ;

(d) ; ; .

8. (a) Use Lagrange multipliers to find the highest and lowest points on the ellipse

.

(b) Use Lagrange multipliers to show  that the rectangle with maximum area that has a given perimeter is a square.

(c) Use Lagrange multipliers to show that the triangle with maximum area that has a given perimeter is equilateral.

(d) Find the maximum and minimum volumes of a rectangular box whose surface area is \$1200 cm^2\$ and whose total edge length is \$.

(e) Use Sage to ind the maximum of

, subject to the constraint

.

9. Find the absolute maximum value and minimum value of the function

on the ellipse .

Solution.

Using ,

Substituting in , then

Substituting in

The absolute maximum value is

The absolute minimum value is

.

10. Find the absolute maximum value of the function on the ellipse .

Solution.

Using ,

Substituting in  > Substituting in

Hence and

Now the absolute maximum value of the function is

Calculus