# Max and min in several variables

## Main Question or Discussion Point

Find max value and min value of f(x,y)= x^2-2x+y^2 for f(x,y) in the region bounded by the triangle with vertices (1,0) (1,1) (0,1)

Im not sure if i did this right, i used second derivative test to find a min at -1, and by plugging in (0,1) i found the max to be 1. But i can only get max value by plugging in (0,1) is there another way to find max that i am missing? And is the way i did this correct?

Ummm...

Well, first we look for relative extrema. Setting

2x - 2 = 0
2y = 0

We get x = 1, y = 0. So (1, 0) is the only critical point.

We must now check the value of the function at the critical point, as well as for points on the triangular boundary. So

f(1,0) = -1.

The first boundary is (1,0) - (1,1) which means x = 1, y between 0 and 1. So
f(1, y) = y - 1 which is maximum at y = 1, so this boundary has a max of 0 at (1,1).

The second boundary is (1,1) - (0,1), which means y = 1, x between 0 and 1. So
f(x,1) = x^2-2x+1 = (x-1)^2 which is maximum at x = 0, so this boundary has a max of 1 at (0, 1).

The third boundary is (0,1) - (1,0), which means y = 1-x, x between 0 and 1. So
f(x,1-x) = x^2-2x+(1-x)^2 = x^2-2x+1 -2x+x^2 = 2x^2-4x+1 which is maximum at x = 0, so this boundary has a max of 1 at (0, 1).

So the candidates are (1,0)=>-1, (1,1)=>0, (0,1)=>1, and (0,1)=>1.

Clearly, (0,1)=>1 is the maximum in the region.