1. Find the maximum of f(x,y) = x2 + xy + 2y2 - 3x + 2y on the triangle
with vertices (0,0), (0,1) and (1,0).
First, find the min/max points of the function:
Fx
= 2x + y – 3
Fy
= 4y + x + 2
Where Fx and Fy are the partial derivatives of f(x,y) with respect to x,y respectively. Setting both to zero yields:
y = 3 – 2x
12 – 8x + x +2 = 0
14 – 7x = 0
x = 2 , y = -1
This point does not lie in the triangle, so we need to look for local min/max along the edges of the triangle, that is the lines (0,0) -> (1,0), (0,0) -> (0,1), and (1,0) -> (0,1):
On the (0,0) -> (1,0) line, y=0 everywhere, so f(x,y=0) = g(x) = x2 – 3x
g’(x) = 2x – 3 so x = 3/2 which lies outside the (0,1) interval, so f(x,y) has a local min/max at the endpoints of the interval, and we will check those later.
On the (0,0) -> (0,1) line, x=0
everywhere, so f(x=0,y) = h(y) = 2y2 + 2
h’(y) = 4y + 2 so y = -1/2 which lies outside the (0,1) interval as well.
On the (1,0) ->(0,1) line, y = 1 – x, so let
f(x,y =
1-x) = k(x) = x2 + x(1-x) +2 (1-x)2 -3x +
2(1-x)
k(x) = x2 + x
– x2 + 2(1 – 2x –x2) - 3x +2 -2x = -4x +2 +2 -4x +2x2
k(x) = 2x2 -
8x + 2
k’(x) = 4x – 8 so x = 2 which lies outside the (0,1) interval as well.
So all critical points of the function f(x,y) = x2 + xy + 2y2 - 3x + 2y have to be at the corners, so just check the values of the function there:
f(0,0) = 0
f(1,0) = 1 – 3 = -2
f(0,1) = 2 + 2 = 4
so the function has a maximum at
the (0,1) corner (and a minimum a the (1,0) corner).
2. Maximize f(x, y) = 3xy + 1 on the ellipse (x/a)2 + (y/b)2 = 1 (with a, b >0).
Although we could substitute in for x or y here as well, it is much better to use the method of Lagrange multipliers:
L = 3xy + 1 – λ ((x/a)2 + (y/b)2 - 1)
Lx = 3y – 2 λ x / a2
Ly = 3x – 2 λ y / b2
Lλ = (x/a)2 + (y/b)2 – 1
Where Lx, Ly, Lλ are the partial derivatives of L wtr. x,y, and λ respectively.
Setting all three to equal zero and solving Lx for λ we get
![]()
plugging into Ly we get
which
yields ![]()
plugging into Lλ we get
which
yields ![]()
or
and thus solving for x
we get![]()
So the function has four critical points on the ellipse, and
we can easily see the maxima are at (
) and (
).