Documente Academic
Documente Profesional
Documente Cultură
MATH1251 Calculus
Chapter 4: Functions of Several Variables
1 2
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)
5 6
Gradient Example 3
1 The gradient of g(x, y) = x 2 + y 2 is
g(x, y) =
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
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
Taylor series and tangent planes 13 Taylor series and tangent planes 14
Taylor series and tangent planes 15 Taylor series and tangent planes 16
Taylor series approximation Taylor polynomial of degree 3 of f (x, y )
Taylor series and tangent planes 17 Taylor series and tangent planes 18
Example 11
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.
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:
To facilitate visualisation, in the sequel we restrict to two-variable other points, called saddle points. See Example 1.
functions.
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.
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.
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
Remarks
Roughly speaking, is closed if it contains its boundary. A more
precise definition will be given in second year.
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.
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