# Find absolute maximum and minimum with domain

Find absolute maximum and minimum of the function

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

on the region

$R = \{(x,y):1≥x≥0, 2≥y≥0\}$

I found that the gradient is

$∇f(x,y)=(2x,2y)$

and that the critical point inside the domain is (0,0) and it is a local minimum. I know I have to check the boundary, and I know how to do it for a fixed equation like $x^2+y^2=1$ but not for the domain I'm given. Can someone explain how this type of problem is to be solved? I don't seem to understand this problem logically or intuitively.

• @Emanuele Paolini I see that you created (laz) tag: math.stackexchange.com/posts/985305/revisions Would you care to explain what this tag is intended for? – Martin Sleziak Oct 22 '14 at 16:35
• Is there a typo somewhere in your post? If $f(x,y)=3-x^2+y^2$, then $\nabla f=(-2x,2y)$. Is there an incorrect sign in some place? – Martin Sleziak Oct 22 '14 at 18:05
• @Martin: You're too polite. I'd have removed it already. (But since you asked, I won't do it until you get an answer...) – Asaf Karagila Oct 22 '14 at 18:08
• @MartinSleziak sorry it was a typo. No tagging intended. – Emanuele Paolini Oct 23 '14 at 14:02

As Paul said, the boundary consists of four line segments: $$L_1: x=0,2\ge y\ge 0$$ $$L_2: x=1,2\ge y\ge 0$$ $$L_3: y=0,1\ge x\ge 0$$ $$L_4: y=2,1\ge x\ge 0$$ Let's look at $L_1$, the left border. To find the maxima and minima of $f$ on $L_1$, you use the equation $x=0$ to think of $f(x,y)$ as a single variable function, $f(0,y)$. To find the critical points on $L_1$, take the derivative with respect to $y$: $$f'(0,y)=\frac{d}{dy}(3-x^2+y^2)=2y$$ Since $2y$ is only zero when $y$ is zero, the only critical point is at $y=0$. The max and min of $f$ on $L_1$ are either at critical points or the endpoints $(0,0)$ and $(0,2)$, so max is $f(0,2)=7$ and the min is $f(0,0)=3$.

Now, check for the max and min of $f$ on all other boundaries. The biggest of these maxes will be the global max, similarly for min. As Milly pointed out, there other clever observations you can make to simplify this, but this method is the most general.

• This makes sense! To clarify, for L3 and L4, I am to take the derivative of those lines with respect to x, correct? – user3507072 Oct 22 '14 at 4:49
• That is absolutely right :^) – Mike Earnest Oct 22 '14 at 4:55
• I now see the observations Milly was talking about, and this problem makes total sense! Thank you! – user3507072 Oct 22 '14 at 4:57

Hint: border of $R$ has 4 parts, $[0,1]\times \{0\}$, $[0,1]\times \{2\}$, $\{0\}\times [0,2]$, $\{1\}\times [0,2]$.

Moreover you can solve this without gradient: note that $f$ is decreasing in $x$ and increasing in $y$ in your domain...

The boundary is:

$\{(x,0): 0\le x\le 1\}$ and $\{(x,1): 0\le x\le 1\}$;

$\{(0,y): 0\le y\le 2\}$ and $\{(1,y): 0\le y\le 2\}$

• I have this graph drawn as well, and as clear as this picture is, I still am not sure what to do in situations where my domain is an inequality and not some fixed function. I appreciate this but I'm still not sure what to do with it. – user3507072 Oct 22 '14 at 4:22
• Logically, I do not understand this problem. And if the graph is supposed to make it obvious, I don't seem to understand it intuitively either. – user3507072 Oct 22 '14 at 4:23

It is not necessary to use derivatives ad all... just notice that your function $f(x,y)$ apart from a constant and a sign, is the square distance from the origin. So you are looking for the points of your domain which are closer, farther from the origin...