Max/min for functions of two variables
Notice: this material must not be used as a substitute for attending
the lectures
1
0.1
Reminder
For a function of one variable, f (x), we find the local maxima/minima by differenti-
ation. Maxima/minima occur when f (x) = 0.
• x = a is a maximum if f (a) = 0 and f (a) < 0;
• x = a is a minimum if f (a) = 0 and f (a) > 0;
A point where f (a) = 0 and f (a) = 0 is called a point of inflection.
Geometrically, the equation y = f (x) represents a curve in the two-dimensional (x, y)
plane, and we call this curve the graph of the function f (x).
0.2
Functions of two variables
Our aim is to generalise these ideas to functions of two variables. Such a function
would be written as
z = f (x, y)
where x and y are the independent variables and z is the dependent variable. The
graph of such a function is a surface in three dimensional space. A simple example
might be
z =
1
1 + x
2
+ y
2
.
z is the height of the surface above a point (x, y) in the x − y plane.
For functions z = f (x, y) the graph (i.e. the surface) may have maximum points or
minimum points (or both). But for surfaces there is a third possibility - a saddle
point.
A point (a, b) which is a maximum, minimum or saddle point is called a stationary
point. The actual value at a stationary point is called the stationary value. What
we need is a mathematical method for finding the stationary points of a function
f (x, y) and classifying them into maximum, minimum or saddle point. This method
is analogous to, but more complicated than, the method of working out first and
second derivatives for functions of one variable.
Let’s remind ourselves about partial derivatives. The sort of function we have in mind
might be something like
f (x, y) = x
2
y
3
+ 3y + x
and the partial derivatives of this would be
∂f
∂x
= 2xy
3
+ 1
∂f
∂y
= 3x
2
y
2
+ 3
∂
2
f
∂x
2
= 2y
3
∂
2
f
∂y
2
= 6x
2
y
2
∂
2
f
∂x∂y
= 6xy
2
∂
2
f
∂y∂x
= 6xy
2
,
same as
∂
2
f
∂x∂y
Note that
∂
2
f
∂x∂y
=
∂
2
f
∂y∂x
This is true for any well behaved function. In terms of notation, we will frequently
use the other, subscript, notation for partial derivatives:
f
x
=
∂f
∂x
,
f
y
=
∂f
∂y
,
f
xx
=
∂
2
f
∂x
2
,
f
yy
=
∂
2
f
∂y
2
,
f
xy
=
∂
2
f
∂y∂x
or
∂
2
f
∂x∂y
0.3
Finding stationary points
To find the stationary points of f (x, y), work out
∂f
∂x
and
∂f
∂y
and set both to zero.
This gives you two equations for two unknowns x and y. Solve these equations for x
and y (often there is more than one solution, as indeed you should expect. After all,
even functions of one variable may have both maximum and minimum points).
0.4
Classifying stationary points
The procedure for classifying stationary points of a function of two variables is anal-
ogous to, but somewhat more involved, than the corresponding ‘second derivative
test’ for functions of one variable. Below is, essentially, the second derivative test for
functions of two variables:
Let (a, b) be a stationary point, so that f
x
= 0 and f
y
= 0 at (a, b). Then:
• if f
xx
f
yy
− f
2
xy
< 0 at (a, b) then (a, b) is a saddle point.
• if f
xx
f
yy
− f
2
xy
> 0 at (a, b) then (a, b) is either a maximum or a minimum.
Distinguish between these as follows:
– if f
xx
< 0 and f
yy
< 0 at (a, b) then (a, b) is a maximum point
– if f
xx
> 0 and f
yy
> 0 at (a, b) then (a, b) is a minimum point
If f
xx
f
yy
− f
2
xy
= 0 then anything is possible. More advanced methods are required
to classify the stationary point properly.
Let’s give some idea where the above conditions come from. It is all based on Taylor’s
theorem for a function of two variables. Taylor’s theorem for a function of one variable
is
f (a + h) = f (a) + hf (a) +
h
2
2!
f (a) + · · ·
3
For a function of two variables Taylor’s theorem is
f (a + h, b + k) = f (a, b) + h
∂f
∂x
(a, b) + k
∂f
∂y
(a, b) +
1
2!
h
2 ∂
2
f
∂x
2
(a, b) + 2hk
∂
2
f
∂x∂y
(a, b) + k
2 ∂
2
f
∂y
2
(a, b)
+higher order (and more complicated) terms
The higher order terms can be neglected in straightforward cases. Lets suppose (a, b)
is a maximum point. Then f
x
= 0 and f
y
= 0 at (a, b) and, because (a, b) is a local
maximum the function must be smaller at neighbouring points, i.e. when h and k are
sufficiently small,
f (a + h, b + k) < f (a, b)
But from Taylors theorem, neglecting higher order terms and noting that the first
derivative terms are zero at (a, b),
f (a + h, b + k) = f (a, b) +
1
2
[h
2
f
xx
+ 2hkf
xy
+ k
2
f
yy
]
at (a, b).
However f (a + h, b + k) < f (a, b), hence
h
2
f
xx
+ 2hkf
xy
+ k
2
f
yy
< 0
at (a, b)
for all small values of h and k. Dividing by k
2
gives
h
k
2
f
xx
+ 2
h
k
f
xy
+ f
yy
< 0.
Let ξ = h/k. Then even though h and k are both small, ξ doesn’t have to be small.
So we have
f
xx
ξ
2
+ 2f
xy
ξ + f
yy
< 0
for all real numbers ξ.
Thus we have a quadratic expression that is negative for all values of its variable ξ
(and so, in particular, has no roots). A few graphs will show that this is only possible
if f
xx
< 0, f
yy
< 0 and f
xx
f
yy
− f
2
xy
> 0 - the latter condition is the one to do with
having no roots. All these inequalities hold at (a, b).
Similar analysis yields the conditions under which a stationary point is a minimum
or saddle point.
0.5
Example
Lets work out the stationary points for the function
f (x, y) = x
2
+ y
2
and classify them into maxima, minima and saddles.
We need all the first and second derivatives so lets work them out. we have
f
x
= 2x
f
y
= 2y
f
xx
= 2
f
yy
= 2
f
xy
= 0
4
For stationary points we need f
x
= f
y
= 0. This gives 2x = 0 and 2y = 0 so that
there is just one stationary point, namely (x, y) = (0, 0). We now need to classify it.
Now
f
xx
f
yy
− f
2
xy
= (2)(2) − 0
2
= 4 > 0
so it is either a max or a min. But f
xx
= 2 > 0 and f
yy
= 2 > 0. Hence it is a
minimum. Our conclusion is that this function has just one stationary point (0, 0)
and that it is a minimum.
The example we have just done is very straightforward. It is untypical in that most
functions have more than one stationary point. The next example again has just one
stationary point but the analysis is slightly more involved.
0.6
Example
f (x, y) = e
−(x
2
+y
2
)
The first and second order partial derivatives of this function are:
f
x
= −2xe
−(x
2
+y
2
)
f
y
= −2ye
−(x
2
+y
2
)
f
xx
= −2e
−(x
2
+y
2
)
(1 − 2x
2
)
by the product rule
f
yy
= −2e
−(x
2
+y
2
)
(1 − 2y
2
)
f
xy
= 4xye
−(x
2
+y
2
)
Stationary points are whenf
x
= 0 and f
y
= 0 and so there is only one stationary
point, at (x, y) = (0, 0). Substituting (x, y) = (0, 0) into the expressions for f
xx
, f
yy
and f
xy
gives
f
xx
= −2,
f
yy
= −2,
f
xy
= 0
Therefore
f
xx
f
yy
− f
2
xy
= (−2)(−2) − 0
2
= 4 > 0
so that (0, 0) is either a min or a max. Since f
xx
< 0 and f
yy
< 0 it is a maximum.
0.7
Example
f (x, y) = 2 − x
2
− xy − y
2
For this function
f
x
= −2x − y
f
y
= −x − 2y
f
xx
= −2
f
yy
= −2
f
xy
= −1
For stationary points, −2x − y = 0 and −x − 2y = 0 so again the only possibility is
(x, y) = (0, 0). We have
f
xx
f
yy
− f
2
xy
= (−2)(−2) − (−1)
2
= 3 > 0
so that (0, 0) is either a max or a min. Since f
xx
< 0 and f
yy
< 0 it is a maximum.
5
0.8
Example
The function in this example has four stationary points. Lets consider
f (x, y) = 2x
3
+ 6xy
2
− 3y
3
− 150x
The first and second order partial derivatives of this function are
f
x
= 6x
2
+ 6y
2
− 150
f
y
= 12xy − 9y
2
f
xx
= 12x
f
yy
= 12x − 18y
f
xy
= 12y
For stationary points we need
6x
2
+ 6y
2
− 150 = 0 and 12xy − 9y
2
= 0
i.e.
x
2
+ y
2
= 25 and y(4x − 3y) = 0
The second of these equation s implies either that y = 0 or that 4x = 3y and both of
these possibilities now need to be considered. If y = 0 then the first equation implies
that x
2
= 25 so that x = ±5 giving (5, 0) and (−5, 0) as stationary points.
If 4x = 3y then x =
3
4
y and so the first equation becomes
9
16
y
2
+ y
2
= 25
so that y = ±4. y = 4 gives x = 3 and y = −4 gives x = −3, so we have two further
stationary points (3, 4) and (−3, −4).
Thus in total there are four stationary points (5, 0), (−5, 0), (3, 4) and (−3, −4).
Each of these must now be classified into max, min or saddle.
• Lets start with (5, 0). For this stationary point, f
xx
f
yy
− f
2
xy
= 60
2
> 0 so it is
either a max or a min. But f
xx
= 60 > 0 and f
yy
= 60 > 0. Hence (5, 0) is a
minimum.
• Now deal with (−5, 0). For this stationary point, f
xx
f
yy
− f
2
xy
= (−60)
2
> 0 so
it is either a max or a min. But f
xx
= −60 < 0 and f
yy
= −60 < 0. Hence
(−5, 0) is a maximum.
• Now deal with (3, 4). For this stationary point, f
xx
f
yy
− f
2
xy
= −3600 < 0 so
(3, 4) is a saddle.
• Now deal with (−3, −4). For this stationary point, f
xx
f
yy
− f
2
xy
= −3600 < 0
so (−3, −4) is a saddle.
6
0.9
Practical Example 1
A container with an open top is to have 10 m
3
capacity and be made of thin sheet
metal. Calculate the dimensions of the box if it is to use the minimum possible
amount of metal.
Solution: Let A be the total area of metal used to make the box, and let x and y be
the length and width and z the height. Then
A = 2xz + 2yz + xy
Also
xyz = 10
because the volume is 10 m
3
. This implies that z =
10
xy
. Putting this into the formula
for A gives A as a function of x and y only:
A = 2x
10
xy
+ 2y
10
xy
+ xy
=
20
y
+
20
x
+ xy
We shall apply our techniques to this function. Now
∂A
∂x
= −
20
x
2
+ y,
∂A
∂y
= −
20
y
2
+ x
and for a stationary point we need ∂A/∂x = ∂A/∂y = 0. this gives
y =
20
x
2
and x =
20
y
2
.
Therefore
y =
20
(20/y
2
)
2
=
y
4
20
Since the zero root y = 0 is obviously not consistent with having a volume of 10 m
3
we reject y = 0 and conclude that y
3
= 20 so that y = 20
1/3
= 2.714 metres.
From x = 20/y
2
we conclude x = 2.714 metres also. To find z, use z =
10
xy
so that
z = 1.357 m.
We have to show that these values do indeed give a minimum. Now
∂
2
A
∂x∂y
= 1,
∂
2
A
∂x
2
=
40
x
3
,
∂
2
A
∂y
2
=
40
y
3
So, when (x, y) = (2.714, 2.714),
A
xx
A
yy
− A
2
xy
= (2)(2) − 1
2
= 3 > 0
so it is either a max or a min. But A
xx
> 0 and A
yy
> 0 so it is a minimum.
Our conclusion is that the box should have length 2.714 m, width 2.714 m and height
1.357 m. The actual area of metal used will then (from the formula for A) be 22.1 m
2
.
7
0.10
Practical Example 2
Let’s make some guttering from a strip of metal 12 in wide. We want to determine
where to bend it (i.e. the value of x in the notation introduced below) and what angle
to bend it at so as to maximise the cross-sectional area and hence the capacity of the
guttering.
Solution. Look at the cross-section of the gutter. Let x be the length of each of the
“sloping” bits so that the base length is 12 − 2x. Let θ be the angle that each sloping
side makes with the horizontal.
The ‘height’ of the cross section is x sin θ. the rectangular part of the cross-section
(the middle part) has area (12 − 2x)x sin θ.
Each triangle at the end has area
1
2
(base)(height) =
1
2
(x cos θ)(x sin θ) =
1
2
x
2
sin θ cos θ.
Thus the total area A of the cross-section is given by
A = (12 − 2x)x sin θ + x
2
sin θ cos θ
which is a function of x and θ and we have to find the values of x and θ which
maximise it.
Now
∂A
∂x
= (12 − 4x) sin θ + 2x sin θ cos θ
and
∂A
∂θ
= (12 − 2x)x cos θ + x
2
(cos
2
θ − sin
2
θ)
= (12 − 2x)x cos θ + x
2
(2 cos
2
θ − 1)
For a stationary point we need ∂A/∂x = 0 and ∂A/∂θ = 0. setting ∂A/∂x = 0 gives
us
(12 − 4x) sin θ + 2x sin θ cos θ = 0
We would like to cancel sin θ although we should examine the possibility that sin θ
might be zero first. if this were so then we would have θ = 0 or θ = π. These
possibilities imply, respectively, that the metal has not been folded at all or that it
has been folded completely and neither of these possibilities is likely to result in a
sensibly designed gutter. Hence it is OK to cancel sin θ and in doing so we get
2x cos θ = 4x − 12
so that
cos θ =
2x − 6
x
Putting this into the equation ∂A/∂θ = 0 gives
(12 − 2x)x
2x − 6
x
+ x
2
2
2x − 6
x
2
− 1 = 0
which after some algebra gives
3x
2
− 12x = 0
8
so that x = 0 or x = 4. The metal obviously cannot be folded at x = 0 so we choose
x = 4. This gives cos θ =
2x−6
x
=
1
2
so that θ = π/3 radians or 60
o
.
Strictly speaking we should now evaluate the second derivatives and check that we
have indeed found a maximum. However we shall not do so in this case.
9
Dostları ilə paylaş: |