Sunteți pe pagina 1din 11

Outline

MATH1251 Calculus
Chapter 4: Functions of Several Variables

A/Prof Thanh Tran 1 Taylor series and tangent planes

School of Mathematics and Statistics


The University of New South Wales
Sydney, Australia 2 Classification of critical points
Red Centre Room 4061
Email: thanh.tran@unsw.edu.au
3 Lagrange multipliers and constrained extrema

1 2

What will be learnt? Revision

You have learnt functions of several variables in MATH1151. You


should review how to sketch the graph of some simple functions of
two variables. E.g., z = x 2 + y 2 . This is a surface in R3 . A surface in R3 can be given explicitly in the form z = f (x, y). E.g.,
z = x 2 y 2.

This chapter is to address the following problems:


It can also be given implicitly as F (x, y, z) = 0. E.g., the above
1 Approximation of f (x ) by a polynomial in n variables (Taylor surface can be given as F (x, y, z) = 0 where
polynomial). F (x, y, z) = x 2 y 2 z.

2 Finding (local/global) maxima and minima of f (if these exist).


The unit sphere in R3 is given implicitly as x 2 + y 2 + z 2 = 1.

3 Finding the maximum and minimum values of f over a given subset


of Rn .

3 4
Example 1 A Matlab script to sketch the graph of z = x 2 y 2
The graph of f (x, y) = x 2 y 2 .
% Plot z = x^2 - y^2 with axes
clear all, close all
x=linspace(-2,2);y=x;
[X,Y] = meshgrid(x,y); Z = X.^2 - Y.^2;
figure(1), surf(X,Y,Z), shading interp
xlabel(x), ylabel(y), zlabel(z)

hold on
x1 = linspace(-4,4); y1 = zeros(size(x1));
[X1,Y1] = meshgrid(x1,y1); Z1 = zeros(size(X1));
surf(X1,Y1,Z1) % x-axis passing through (0,0,0)
surf(Y1,X1,Z1) % y-axis passing through (0,0,0)
surf(Y1,Z1,X1) % z-axis passing through (0,0,0)

Try this in the lab!

5 6

Gradient Example 3
1 The gradient of g(x, y) = x 2 + y 2 is

g(x, y) =

Definition 2 2 The gradient of g(x, y, z) = sin(xy 2 ) yz 2 is


The gradient of g : Rn R is the vector of partial derivatives of g:
g(x, y, z) =
 
g g
g(x) = (x ), . . . , (x) , x = (x1 , . . . , xn ).
x1 xn

Thus, g is a function from Rn to Rn .

Taylor series and tangent planes 7 Taylor series and tangent planes 8
Gradient and normal vectors

Theorem 4
Warning!
Suppose that S is a smooth surface in Rn (n 2) defined by
Many students find this counterintuitive. The gradient is the derivative
F (x) = 0. of F , so why isnt the gradient tangential to the surface?
The answer is that we are looking at the level surface of F , not the
If x 0 is a point on S, then the gradient F (x 0 ) is normal to S at x 0 . graph of F .
You will see in Example 7 that, as in the case of one-variable functions,
A remark
the gradient at a point x 0 defines the tangent plane to the graph at that
If a surface S in R3 is given explicitly by z = f (x, y) then the vectors point.
 
f f
(x0 , y0 , z0 ), (x0 , y0 , z0 ), 1
x y

are normal to S at (x0 , y0 , z0 ).

Taylor series and tangent planes 9 Taylor series and tangent planes 10

Example 5 Example 6
The set S = {(x, y) R2 | x 2 + y 2 = 1} is the unit circle in R2 . Find a Find the normal, and hence the equation of the tangent plane to the
vector normal to the circle S at x 0 = (cos , sin ). surface x 2 + y 2 xyz = 1 at the point x 0 = (1, 2, 2).

Taylor series and tangent planes 11 Taylor series and tangent planes 12
Example 7 Graphs and linear approximation
Let S be the graph of a function f : R2 R, i.e., S is defined by
z = f (x, y). Show that the equation of the tangent plane to S through In one variable we have
the point (x0 , y0 , z0 ) = (x0 , y0 , f (x0 , y0 )) is
f (x) f (x0 ) + f (x0 )(x x0 ),
z = f (x0 , y0 ) + f (x0 , y0 ) (x x0 , y y0 )
f f which is the equation of the tangent line to the graph of f at x0 .
= f (x0 , y0 ) + (x 0 )(x x0 ) + (x 0 )(y y0 ).
x y
For a function f (x, y) of two variables, the tangent plane to the
graph of f at x 0 = (x0 , y0 ) gives the best degree 1 polynomial
approximation to f (x, y) near (x0 , y0 ). We have

f (x, y) f (x0 , y0 ) + f (x0 , y0 ) (x x0 , y y0 )


f f
= f (x0 , y0 ) + (x 0 )(x x0 ) + (x 0 )(y y0 ).
x y

Taylor series and tangent planes 13 Taylor series and tangent planes 14

Example 8 Two-variable polynomials


Approximate f (x, y) = x 2 + y 2 2xy near (x0 , y0 ) = (1, 3).

A polynomial in two variables x and y is an expression of the form


N X
X M
p(x, y) = anm x n y m .
n=0 m=0

The degree of the term x n y m is n + m. The degree of the polynomial is


the largest degree of all the terms.
Example 9
What is the degree of the polynomial
p(x, y) = 1 + x y + x 2 xy + x 3 y 2 ?

Taylor series and tangent planes 15 Taylor series and tangent planes 16
Taylor series approximation Taylor polynomial of degree 3 of f (x, y )

Taylors Theorem in more than one variable is not simple to state T3 (x , y )


(especially with the error term). Even writing down the Taylor f f
= f (x 0 ) + (x 0 )(x x0 ) + (x 0 )(y y0 )
polynomial of degree n for f near x 0 is a little hard. x y
1 2f 2f 2f
 
2
+ (x 0 )(x x0 ) + 2 (x 0 )(x x0 )(y y0 ) + (x 0 )(y y0 )2
2! x 2 x y y 2
In this chapter, we will give you the Taylor polynomial of degree 3,  3
1 f 3f
T3 (x, y), for f around x 0 = (x0 , y0 ). The more general formula will + (x 0 )(x x0 )3 + 3 2 (x 0 )(x x0 )2 (y y0 )
3! x 3 x y
be given in second year.
3f 3f

+3 (x 0 )(x x 0 )(y y0 )2 + (x 0 )(y y0 )3
x y 2 y 3

Taylor series and tangent planes 17 Taylor series and tangent planes 18

Example 10 Maxima and minima


Find the best degree 3 polynomial approximation to f (x, y) = exy
near (0, 0). To find the local maxima and minima of a function f : [a, b] R,
one looks at the critical points of f . These points are
1 x (a, b) satisfying f (x ) = 0 or f (x ) does not exist;

2 x is one of the endpoints, i.e., x = a or x = b.

We generalise this idea to a multivariable function f : Rn R.


However, there are complications.
1 What is differentiability of the function f ? Roughly speaking,
differentiability of f at x 0 means the graph of f can be
well-approximated by the tangent plane to the graph at x 0 . Is
differentiability required? Or just the existence of f ?

2 The boundary of is (usually) an infinite set, so we cannot just


check on the boundary points individually.
Taylor series and tangent planes 19 Classification of critical points 20
Can f (x 0 ) exist but f is not differentiable at x 0 ?

Example 11

Consider the function f : R2 R defined by


( xy
2 2 if (x, y) 6= (0, 0),
f (x, y) = x +y
0 if (x, y) = (0, 0).

You can show that f (0, 0) = (0, 0) but f is not continuous at (0, 0).

A note
In this course we will not look further into non-differentiable
multi-variable functions. You do not have to worry about this type of
functions!
Graph of the function f given in Example 11.

Classification of critical points 21 Classification of critical points 22

Critical points Local maxima, local minima, saddle points

Definition 12 If (x0 , y0 ) is a stationary point, then the tangent plane to the graph
Suppose that f is a function from Rn into R. of f at (x0 , y0 ) is horizontal and given by

z = f (x0 , y0 ).
1 A point x 0 Rn is a critical point of f if

f (x 0 ) = 0, or
This can occur at:

f (x 0 ) does not exist. the top of a hill (a local maximum),

the bottom of a valley (a local minimum),


2 A point x 0 Rn is called a stationary point of f if f (x 0 ) = 0.

To facilitate visualisation, in the sequel we restrict to two-variable other points, called saddle points. See Example 1.
functions.

Classification of critical points 23 Classification of critical points 24


Example 13 Classification of stationary points
Find the stationary points of f (x, y) = 8x 3 + y 2 6xy 2y + 3.
Example 14
The function f (x, y) = x 2 + y 2 has a critical point at (0, 0). Clearly,

f (x, y) f (0, 0) = 0 (x, y) R2 .

Hence f has a local (and global) minimum at (0, 0).

Example 15
The function f (x, y) = x 2 y 2 has a critical point at (0, 0). However, for
all t near 0,
f (0, t) = t 2 < f (0, 0) < f (t, 0) = t 2 .
Hence (0, 0) is neither a max nor a min point. Thus it is a saddle point.

Is there a test like the second derivative test for one-variable


functions?
But what is the second derivative of a two-variable function?
Classification of critical points 25 Classification of critical points 26

Hessian The Second Order Partial Derivative Test

Theorem 17
Suppose that f : R2 R has a stationary point at x 0 (i.e., f (x 0 ) = 0).
Definition 16
1 If det(Hf (x 0 )) > 0 then f has
The Hessian of a function f : R2 R at x 0 is the matrix
2 2f
2f

f 1 a local minimum at x 0 if (x 0 ) > 0,
x 2 (x 0 ) xy (x 0 ) x 2
Hf (x 0 ) =
2f
.
2f
(x 0 ) (x 0 ) 2f
yx y 2 2 a local maximum at x 0 if (x 0 ) < 0.
x 2
The matrix is named after the German mathematician Ludwid Otto
Hesse (18111874). 2 If det(Hf (x 0 )) < 0 then x 0 is a saddle point.

3 If det(Hf (x 0 )) = 0 then the test is inconclusive.

Classification of critical points 27 Classification of critical points 28


Standard functions to remember Example 19
Find and classify all the critical points of f (x, y) = x 3 y 3 + 3xy.

Example 18
 
2 0
f (x, y) = x 2 + y 2 , Hf (0, 0) = ,(0, 0) is a local max,
0 2
 
2 0
g(x, y) = x 2 y 2 , Hg (0, 0) = , (0, 0) is a local min,
0 2
 
2 0
h(x, y) = x 2 y 2 , Hh (0, 0) = , (0, 0) is a saddle point.
0 2

Classification of critical points 29 Classification of critical points 30

Domains with boundaries


Theorem 20 (Max-Min Theorem)
If f is a continuous function on a closed bounded set R2 , then f
attains a maximum and a minimum value on .
These extreme points can only occur at critical points inside or on
the boundary of .

Remarks
Roughly speaking, is closed if it contains its boundary. A more
precise definition will be given in second year.

As in one dimension, if is unbounded, or if is not closed, then


f need not have a maximum or minimum.

One method to test the boundary points is to parametrise the


boundary to reduce the problem to a one-variable problem.
Classification of critical points 31 Classification of critical points 32
Example 21

Find the maximum and minimum values of f (x, y) = x 2 + 4xy + y 2 on


the closed unit disk = {(x, y) | x 2 + y 2 1}.

Classification of critical points 33 Classification of critical points 34

Constrained extrema Lagrange Multiplier Theorem

The problem of finding the extrema of f on the boundary of as Theorem 22


in Example 21 is the problem of finding the extrema with
constraints. Suppose that the level set C = {(x, y) R2 : g(x, y) = 0} is a smooth
closed curve and that f is differentiable on C. Then

The problem can be rephrased as: Find the extrema of 1 f attains a maximum and minimum value on the curve C;
f (x, y) = x 2 + 4xy + y 2 subject to the constraint g(x, y) = 0 where
g is defined by g(x, y) = x 2 + y 2 1.
2 If g 6= 0 on C then the extreme values occur at points where f
and g are parallel, i.e., where f = g for some R, which
The set C = {(x, y) R2 : g(x, y) = 0} is a level set or level is called the Lagrange multiplier.
curve of g.

Lagrange multipliers and constrained extrema 35 Lagrange multipliers and constrained extrema 36
Maximise (minimise) f (x, y ) subject to the constraint Example 23
g(x, y ) = 0 Maximise f (x, y) = x 2 + 4xy + y 2 subject to the constraint
g(x, y) = x 2 + y 2 1 = 0.

1 Check that g(x, y) 6= 0 when g(x, y) = 0;

2 Find all points (x, y) satisfying


(
f (x, y) = g(x, y)
(1)
g(x, y) = 0.

This is a set of 3 equations in the 3 unknowns x, y, and . (The


equations are usually nonlinear and so they can be hard to solve.)

3 Typically, there are only finitely many solutions to (1). Check which
points give the maximum and/or minimum value.

Lagrange multipliers and constrained extrema 37 Lagrange multipliers and constrained extrema 38

Example 24
Find the points on the curve x 4 + 7x 2 y 2 + y 4 = 1 which are closest
and furthest to the origin.

Lagrange multipliers and constrained extrema 39 Lagrange multipliers and constrained extrema 40
Example 25
Let x 0 = (0, a) with a > 0. Find the point on the parabola y = x 2
closest to x 0 .

Lagrange multipliers and constrained extrema 41 Lagrange multipliers and constrained extrema 42

Lagrange multipliers and constrained extrema 43

S-ar putea să vă placă și