Cal 8
Cal 8
Cal 8
f : Rn → R
8.1 Introduction
We shall now turn our attention to the very important special case of functions that
are real, or scalar, valued. These are sometimes called scalar fields. In the very, but
important, special subcase in which the dimension of the domain space is 2, we can
reasonably nice function, then S is what we call a surface. We shall see more of this later.
Let us now return to the general case of a function f : R n → R . The derivative of f is just
∂f ∂f ∂f
a row vector f '( x) = L
∂ x n
. It is frequently called the gradient of f
∂ x 1 ∂ x2
temperature at points ( x , y , z) in space, and we might want to know the rate at which the
d
Du f ( a) = f (a + tu) t =0 .
dt
8.1
Now that we are experts on the Chain Rule, we know at once how to compute such a
thing. It is simply
d
D u f (a ) = f ( a + t u) t =0 = ∇f ⋅ u .
dt
Example
the point (x, y), the height is f (x, y). The positive y-axis points North, and, of course,
then the positive x-axis points East. You are on the mountain side above the point (2, 4)
and begin to walk Southeast. What is the slope of the path at the starting point? Are you
going uphill or downhill? (Which!?).
The answers to these questions call for the directional derivative. We know we are at
the point a = (2 ,4 ) , but we need a unit vector u in the direction we are walking. This is,
1
of course, just u = (1,− 1) . Next we compute the gradient ∇f ( x , y ) = [ −2 x ,− 10 y] . At
2
the point a this becomes ∇f ( 2,4) = [ −2,− 40] , and at last we have
−2 + 40 38
∇f ⋅ u = = . This gives us the slope of the path; it is positive so we are going
2 2
uphill. Can you tell in which direction the path will be level?
Another Example
directional derivative is simply ∇T ⋅ u =|∇ T|cosθ , where θ is the angle between ∇T and
u. Anyone can see that this will be largest when θ = 0. Thus T in creases most rapidly in
8.2
the direction of the gradient of T. Here that direction is [2 xy, x 2 + z 3 ,3 yz 2 ] . At (1,1,1),
Exercises
4. The surface of a hill is the graph of the equation z = 1000 + x 2 − x 4 − y 2 . You stand
on the hill above the point (5,3) and pour out a glass of water. In which direct will it
begin to run? Explain.
is the rate of change of the distance between the two particles? Are they getting
closer to one another, or are they getting farther apart? (Which!) Explain.
8.3
Let f : R 3 → R be a function and let c be some constant. Recall that the set
d
f ( r(t )) = ∇f ⋅ r'( t ) = 0 .
dt
In other words, the gradient of f and the tangent to the curve are perpendicular. Note there
was nothing special about our choice of r(t); it is any curve on the surface. The gradient
∇f is thus perpendicular, or normal to the surface f ( x, y, z) = c .
Example
Suppose we want to find an equation of the plane tangent to the surface
x 2 + 3y 2 + 2z 2 = 12
at the point (1, -1, 2). For an equation of a plane, we need a point a on the plane and a
vector N normal to the plane. Then the equation we seek is simply N ⋅ ( x − a) = 0 ,
where x = ( x , y , z) . In the case at hand, we have a point on the plane: a = (1, -1, 2).
Let’s find a normal vector N. We have just learned that the gradient of
∇f ( x , y , z) = [2 x ,6 y ,4 z] ,
8.4
and so N = ∇ f (1,− 12
, ) = [2 ,−68
, ] . The tangent plane is thus given by the equation
2( x − 1) − 6( y + 1) + 8( z − 2) = 0 .
You should note that the discussion here didn’t depend on the dimension of the
Exercises
6. Find an equation for the plane tangent to the surface z = x 2 + 2 y 2 at the point (1,1,3).
7. Find an equation for the plane tangent to the surface z = log( x + y ) at the point
2 2
(10
, ,0) .
9. Find an equation of the straight line tangent to the curve of intersection of the surfaces
8.5
8.4 Maxima and Minima
function, then this means the directional derivative Du f ( a) ≥ 0 for all unit vectors u. In
a local minimum at a point at which it has a derivative only if the derivative is zero there.
You should guess the definition of a local maximum and see why it must be true that
the gradient is zero at such a point. Thus if a is a local minimum or a local maximum of f,
and if f has a derivative at a, then the derivative ∇f (a ) = 0. You should be aware of the
fact that here, just as in Mrs. Turner’s elementary calculus class, the converse is not
necessarily true. We may have ∇f (a ) = 0 without a being either a local minimum or a
local maximum.
Example
Let us find all local maxima and local minima of the function
f ( x , y ) = x 2 + xy + y 2 + 3x − 3y + 4 .
Meditate on just how should proceed. This function clearly has a derivative everywhere,
so at any local maximum or minimum, this derivative, or gradient, must be zero. So let’s
begin by finding all points at which ∇f (a ) = 0 . In other words, we want (x, y) at which
∂f ∂f
= 0 and = 0:
∂x ∂y
8.6
∂f
= 2x + y + 3 = 0
∂x
∂f
= x + 2y − 3 = 0
∂y
We are thus faced with the border-line trivial problem of solving the system of equations
2 x + y = −3
.
x + 2y = 3
There is just one solution: ( x , y ) = (−3, 3) . Now let us reflect on what we have here.
What we have actually found is all the points that cannot possibly be local minima or
maxima. These are all points except (-3, 3).. All we know right now is that this point is
the only possible candidate. Let’s find out what we have by the hammer and tongs
method of examining the quantity f (− 3 + x , 3 + y ) − f ( − 3,3 ) :
f ( − 3 + x , 3 + y ) − f ( − 3,3 ) = f ( − 3 + x , 3 + y ) − ( − 5)
= ( − 3 + x ) 2 + ( − 3 + x)( 3 + y) + ( 3 + y) 2 + 3( − 3 + x) − 3( 3 + y) + 9
2
y 3y 2
= x 2 + xy + y 2 = x + +
2 4
minimum.
Exercises
8.7
10. f ( x , y ) = x 2 + 3xy + 3y 2 − 6 x + 3 y − 6
11. f ( x, y) = x 2 + xy + 3x + 2 y + 5
12. f ( x, y) = 2 xy − 5x 2 − 2 y 2 + 4x − 4
13. f ( x, y) = x 2 + 2 xy
14. f ( x, y) = y − x 2
and we seek the straight line that "best" fits this collection of points. We first decide
what we mean by "best". Let's say we mean the line that minimizes the sum of the
squares of the vertical distances from the points to the line. We can describe all
nonvertical lines in the world by means of two variables, traditionally called m and b.
Thus every such line has the form y = mx + b . Our quest is thus for the values of m and
has its minimum value. Knowing these values will give us our line.
We simply apply our vast and growing knowledge of calculus and find where the
gradient of f is 0:
8.8
∂f ∂f
∇f = ( , ) =0 .
∂m ∂ b
Now,
∂f n n n n
= ∑ 2 x i (mxi + b − yi ) = 2[m∑ x i2 + b∑ x i − ∑ xi y i ], and
∂ m i =1 i =1 i= 1 i =1
∂f n n n
= ∑ 2( mxi + b − yi ) = 2[m∑ xi + nb − ∑ yi ].
∂ b i =1 i =1 i =1
n n n
m∑ x i2 + b ∑ xi = ∑ x i y i
i= 1 i =1 i =1
n n
m∑ x i + bn = ∑ yi
i= 1 i= 1
x y
0 1
1 2
2 4
3 3.5
4 5
8.9
5 4
7 7
8 9
9 12
10 18
12 21
15 29
255 993
Solving this system gives us m = and b = − . In other words, the line that best
142 568
fits the data in the “sense of least squares” is
255 993
y= x−
142 568
8.10
Looks pretty good!
Exercises
15. Here is a table of Köchel numbers versus year of composition for the compositions of
W. A. Mozart. Find the "least squares" straight line approximation to this table and
use it to estimate the year in which Mozart's Sinfonia Concertante in E-flat major was
composed.
Köchel Year
Number composed
1 1761
75 1771
155 1772
219 1775
271 1777
351 1780
425 1783
503 1786
575 1789
626 1791
[This problem is taken from Calculus and Analytic Geometry (8th Edition), by
Thomas & Finney.]
8.11
16. Find some data somewhere (The Statistical Abstract of the United States is a good
source of interesting data.), find the least squares linear approximation to the data, and
say something intelligent about your results.
maxima and minima. (Here D is a subset of R n .). To begin, let's think a moment about
how we can tell if there is a maximum or minimum value of f on D. First, we suppose
that f is continuous—otherwise, anything can happen! Next, what properties of D will
insure the existence of a biggest and smallest value of f ? The answer is fairly simple.
D = (01
, ) . Having the domain be closed, however, is not sufficient to guarantee the
maximum nor a minimum. We need also to have the domain be bounded. It turns out that
for continuous f , if the domain D is both closed and bounded, then there must necessarily
be a maximum and a minimum value for f on D. Let's think a moment about what the
candidates for such points are. If the biggest or smallest value of f occurs in the interior of
D, then surely the point at which it occurs is a local maximum (or minimum). If f has a
gradient there, then the gradient must be 0 . The points at which the largest or smallest
values occur must therefore be either i)points in the interior of D at which the gradient of f
vanishes, ii)points in the interior at which the gradient of f does not exist, or iii)points in
D but not in the interior of D (that is, points on the boundary of D).
Hark back to Mrs. Turner's third grade calculus class. How did you find the
maximum value of a function f whose domain D is a closed interval [a , b] ⊂ R ? Recall
8.12
found all points in the interior (that is, in the open interval (a,b)) at which the derivative
vanishes. You then simply evaluated f at these points, evaluated f at any points in (a,b)
at which there is no derivative, evaluated f at the two end points of the interval (in this
one dimensional case, the boundary of D is particularly simple.), and then picked out the
biggest and smallest numbers you computed. The situation in higher dimensions is a bit
more complicated, mostly because the boundary of even a nice domain D is not a nice
finite set as in the case of an interval, but is an infinite set. Let's look at an example.
Example
assignment is to find the hottest and coldest points on the plate. According to our
previous discussion, candidates for the hottest and coldest points are all points inside the
circular boundary at which the gradient of T is 0 and all points on the boundary. (Note
that T has a gradient at all points inside the circle.) First, let's find where among all points
1
should be clear there is just one such point: ( ,0) . Now for the more difficult part,
2
finding the candidates on the boundary. Note that the boundary may be described by the
vector equation
r(t ) = cos t i + sin t j , where 0 ≤ t ≤ 2π .
[Here we are abusing the notation, as we have done before, by using the same name for
the function T( x , y ) and the composition T( r(t )) .] We are now faced with the one
dimensional problem of finding the maximum and minimum values of a nice differentiable
function of one variable on a closed interval. First, we know the endpoints of the interval
are candidates: t = 0, and t = 2π . We have at this point added one more point to our list
8.13
of candidates: r(0) = r(2π ) = (10
, ) . Now for candidates inside the interval, we seek
dT
places at which the derivative = 0 . From the Chain Rule, we know
dt
dT
= ∇ T( r(t )) ⋅ r'( t ) = (2 cos t − 14
, sin t ) ⋅ (− sin t ,cos t ) = 2 cos t sin t + sin t .
dt
dT
The equation = 0 now becomes
dt
2 cos t sin t + sin t = 0, or
sin t ( 2 cos t + 1) = 0
1
Thus sint = 0 , or 2 cos t + 1 = 0. We have, in other words, y = 0 , or x = − . When
2
1 3 3
y = 0 , then x = 1 or x = −1; and when x = − , then y = or y = − . Thus our
2 2 2
1 3 1 3
new candidates are (1,0), (− 10
, ), (- , ), and (− ,− ) . These together with the one
2 2 2 2
1
we have already found, ( ,0) , make up our entire list of possibilities for the hottest and
2
coldest points on the plate. All we need do now is to compute the temperature at each of
these points:
1 1 1 1
T( ,0) = − = − .
2 4 2 4
T(10, ) = 1− 1 = 0
T( −10, ) = 1+ 1 = 2
1 3 1 3 1 3 1 9
T( − , ) = T( − ,− ) = + + =
2 2 2 2 4 2 2 4
1
Finally, we have our answer. The coldest point is ( ,0) , and the hottest points are
2
1 3 1 3
(− , ) and (− ,− ).
2 2 2 2
8.14
Exercises
area in the first quadrant bounded by the triangle formed by the lines x = 0 , y = 4 ,
and y = x .
18. Find the maximum and minimum values of f ( x , y ) = (4 y − y 2 )cos x on the closed
π π
area bounded by the rectangle 1 ≤ y ≤ 3 , − ≤x≤ .
4 4
function. (In other words, D is a level curve of g .) Suppose r(t ) is a vector description
of the curve D. Now then, we are seeking a maximum or minimum of the function
dF
F (t ) = f ( r( t )) . At a maximum or minimum, we must have = 0 . (Here g is
dt
sufficiently nice to insure that g ( x , y ) = 0 is a closed curve, and so there are no endpoints
dF
to worry about.) The Chain Rule tells us that = ∇f ⋅ r' = 0 . Thus at a maximum or
dt
minimum, the gradient of f must be perpendicular to the tangent to g ( x , y ) = 0 . But if
∇f is perpendicular to the tangent to the level curve g ( x , y ) = 0 , then it must have the
8.15
same direction as the normal to this curve. This is just what we need to know, for the
gradient of g is normal to this curve. Thus at a maximum or minimum, ∇f and ∇g must
"line up". Thus ∇f = λ ∇ g , and there is no need actually to know a vector representation
r for g ( x , y ) = 0 .
Let's see this idea in action. Suppose we wish to find the largest and smallest
2x = λ (2 x − 2)
2 y = λ ( 2 y − 4)
We obtain a third equation from the requirement that the point ( x , y ) be on the curve
2 x = λ (2 x − 2)
2 y = λ (2 y − 4)
x 2 − 2 x + y2 − 4 y = 0
λ 2λ
Thus x = and y = . (What about the possibility that λ − 1 = 0 ?). The last
λ −1 λ −1
λ2 2λ 4λ 2 8λ
equation then becomes − + − = 0 ; or,
(λ − 1) 2
λ − 1 (λ − 1) 2
λ −1
λ2 − 2λ (λ − 1) = 0,
λ2 − 2λ = 0
We have two solutions: λ = 0 and λ = 2 . What do you make of the solution λ = 0 ?
These values of λ give us two candidates for places at which extrema occur: x = 0 and
8.16
we have them—the minimum value is 0 and it occurs at (0,0); and the maximum value is
20, and it occurs at (2,4).
This method for finding "constrained" extrema is generally called the method of
Exercises
19. Use the method of Lagrange multipliers to find the largest and smallest values of
f ( x, y) = 4 x + 3y on the circle x 2 + y 2 = 1 .
20. Find the points on the ellipse x 2 + 2 y 2 = 1 at which f ( x, y) = xy has its extreme
values.
21. Find the points on the curve x 2 + xy + y 2 = 1 that are nearest to and farthest from the
origin.
8.17