Max and min of a two variable function in $\Bbb R^2$

compactnesslimitsmaxima-minimamultivariable-calculusoptimization

I'm trying to find max and min of the following function with the condition
$$ f(x,y) = (x^2 +y) e^{-x-y} , \qquad D=[(x,y) \in \Bbb R^2: x,y \geq 0] $$
I thought directly that since $f(x,y) \geq 0$, $\forall(x,y) \in \Bbb R^2$, the min is $f(0,0)=0$.

To determine max, I checked the limit of
$$ \lim_{t \to \infty} f(t,t) = \lim_{t \to \infty} (t^2+t) e^{-2t} = 0$$
and according to the definition of limit it exists for every $\epsilon > 0$ an $\omega >0$ such that
$$ |(t^2+t) e^{-2t}| < \epsilon $$
i.e if $\omega$ is great enough, the max of $f(x,y)$ should be included in a compact area.
So i tried to determine the max value using partial derivative and got the following
$$ f(\frac{1}{2} , \frac{3}{4}) = \frac{1}{e^{\frac{5}{4}}}. $$
But apparently the answer is wrong since this point is a saddle point (I checked the quadratic form).

What did I miss, and is there any other way do determine the max?

Best Answer

Since, as you found out, there is indeed no local maximum in $D$, you must look for maximum function values on the boundary of $D$.

Firstly, as you have seen, the function does not approach infinity as x and y go to infinity. Hence, the maximum must be on $x=0$ or $y=0$.

Plugging those into $f(x, y)$ gives:

$$f(0, y)=ye^{-y}$$ $$f(x, 0)=x^{2}e^{-x}$$

Now we are simply left with finding the maximal values for these functions (using the usual single variable calculus). To slightly shorten the process, we can notice that since both x and y are non-negative, the maximal value for $x^{2}e^{-x}$ is at least that of $ye^{-y}$. So, for the overall maximal value, we only need to look at $f(x)=x^{2}e^{-x}$:

$$f'(x)=2xe^{-x}-x^{2}e^{-x}$$ $$f''(x)=2e^{-x}-2xe^{-x}-2xe^{-x}+x^{2}e^{-x}=e^{-x}(x^2-4x+2)$$

Setting the derivative equal to $0$:

$$2xe^{-x}-x^{2}e^{-x} \implies 2x-x^{2}=0 \implies x(x-2)=0 \implies x=0 \space\text{or}\space x=2$$

Only $x=2$ is a maximum (because $f''(0)=2>0$ and $f''(2)=-2e^{-2}<0$).

Therefore, the maximum value is achieved at $(x, y)=(2, 0)$. Then, the maximal value is: $$\fbox{$f(2, 0)=4e^{-2}$}$$

Related Question