# Multivariable Calculus: Max/min values inside closed interval?

1. Dec 12, 2013

### MSG100

Hi!

My question is:
Find maximum and minimum values of the function:

f(x,y) = 2x-y+x^2+y^2

when x^2+y^2 ≤ 4

I would like to solve this without using Lagrange method.

I get
x=-1 and y=1/2 when using partial derivative and set it equql to 0.

I can see that the maximum value must be at the edge of the circle, therefore x^2+y^2 = 4

f(x,y) = 2x-y+x^2+y^2 =
2x-y+4 =
2x - sqrt( 4 - x^2 ) + 4

I derivative and get:

2 + x/(sqrt(4-x^2))=0

x=-4/sqrt(5)

Hmm, is this really the right method?

2. Dec 12, 2013

### LCKurtz

You mean $2x \color{red}{\pm} \sqrt{4-x^2}+4$. You get two $y$ values for each $x$ on the circle.

I didn't check your last steps but, yes, that method should work. Don't let the square roots scare you.

3. Dec 12, 2013

### vela

Staff Emeritus
So (-1, 1/2) is one candidate.

Your work is fine, but when you solve for y in terms of x, you get two roots $y=\pm\sqrt{4-x^2}$. You need to consider the second solution still.

4. Dec 12, 2013

### MSG100

Thanks both of you!

I forgotten the second root.
Now I can continue and see what I get for answer.

5. Dec 12, 2013

### MSG100

It wasn't as easy as I thought.

I get x=4/(sqrt(5) and x=-4/sqrt(5)

It seems that x=4/(sqrt(5) is correct when I studie the the 3D picture http://www.wolframalpha.com/input/?i=f%28x%2Cy%29%3D2x-y%2Bx^2%2By^2

Do I need to studie the egde of the circle using 2csot, 2sint? I increase the value by increase x.

6. Dec 12, 2013

### MSG100

Ok let's see if I'm on the right track.

I solve for y:

x^2+y^2=4

y=±sqrt(4-y^2)

I put it in the equation and differentiate:

f(y)=2*±sqrt(4-y^2)-y+4=
f´(y)=±(2 y)/sqrt(4-y^2)-1

When I set it equal to 0:

y= -(2/sqrt(5))
y= (2/sqrt(5))

If I sum it up I have three candidates:

Point I (-1, 1/2)
Point II (4/sqrt(5)), (-2/sqrt(5))
Point III (-4/sqrt(5)), (2/sqrt(5))

If I insert each point into the original equation I get:

Point I = -5/4 =-1.25
Point II = 2(2+sqrt(5)) ≈ 8.47
Point III = 4-2*sqrt(5) ≈-0.47

Point I = minimum
Point II = maximum

Is this solution good enough?

7. Dec 12, 2013

### vela

Staff Emeritus
Looks good.