# Global Max and Min Problem

I'm working on a problem which asks me to find local and global extrema of the following function.

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

I went through and found all of the relevant partial derivatives.

\begin{align*} f_x &= (2xy^2)(e^{(-x^2 - 2y^2)}) + (x^2y^2)(e^{(-x^2 - 2y^2)})(-2x)\\ f_x &= (e^{(-x^2-2y^2)})(2xy^2 -2x^3y^2)\\ \\ f_y & = (2x^2y)(e^{(-x^2-2y^2)}) + (x^2y^2)(e^{(-x^2-2y^2)})(-4y)\\ f_y &= (e^{(-x^2-2y^2)})(2x^2y-4x^2y^3)\\ \\ f_{xx} &= (e^{(-x^2-2y^2)})(-2x)(2xy^2 -2x^3y^2) + (e^{(-x^2-2y^2)})(2y^2 -6x^2y^2)\\ f_{xx} &= (e^{(-x^2-2y^2)})(-10x^2y^2 + 4x^4y^2 + 2y^2)\\ \\ f_{yy} &= (e^{(-x^2-2y^2)})(-4y)(2x^2y-4x^2y^3) + (e^{(-x^2-2y^2)})(2x^2 - 12x^2y^2)\\ f_{yy} &= (e^{(-x^2-2y^2)})(-20x^2y^2 + 16x^2y^4 + 2x^2)\\ \\ f_{xy} &= (e^{(-x^2-2y^2)})(-4y)(2xy^2 -2x^3y^2) + (e^{(-x^2-2y^2)})(4xy-4x^3y)\\ f_{xy} &= (e^{(-x^2-2y^2)})(-8xy^3 + 8x^3y^3 +4xy - 4x^3y)\\ \end{align*}

However, I'm not sure what to do after this. I thought I was supposed to set $f_x$ and $f_y$ equal to 0 but I don't know how to solve the equations that I get. Can someone please help me? Did I make a mistake while I was determining my partial derivatives?

EDIT: I made a mistake calculating the partial derivatives and I edited that

-
wolframalpha.com/input/… –  lemon Jul 15 '14 at 20:34
thank you @user258423! I didn't know I could do that. Also, I used the second derivative test and found that (0,0) failed the test, $(-1,-\frac{1}{\sqrt{2}})$, $(-1,\frac{1}{\sqrt{2}})$, $(1,\frac{1}{\sqrt{2}})$, $(1,-\frac{1}{\sqrt{2}})$ are all local maximums. Now, how do I determine which ones are global maxs? Also, since (0,0) failed the test (made D = 0), what does that mean? –  manny Jul 15 '14 at 22:05
A local maximum $f(x_0,y_0)$ is a global maximum if $f(x_0,y_0)\geq f(x,y)$ for all $(x,y)$. So evaluate $f$ at each of those four local maxima to find the largest. The point $(0,0)$ gave $D=0$ because it is a saddle point. You can see that by plotting the function wolframalpha.com/input/… –  lemon Jul 15 '14 at 22:11
Global optima do not need to be unique; so all four are global maxima. –  lemon Jul 15 '14 at 22:19

Let $g(x,y) = \ln f(x,y)$. Note that, $g(x,y) = 2\ln x + 2\ln y - x^2 - 2y^2$ and $$\begin{cases} \dfrac{\partial g}{\partial x} = \dfrac{2}{x} - 2x\\ \dfrac{\partial g}{\partial y} = \dfrac{2}{y} - 4y\ \end{cases}$$ On the order hand, $$\begin{cases} \dfrac{\partial g}{\partial x} = \dfrac{\partial}{\partial x}\ln f(x,y) = \dfrac{1}{f(x,y)}\dfrac{\partial f}{\partial x}\\ \dfrac{\partial g}{\partial y} = \dfrac{\partial}{\partial y}\ln f(x,y) = \dfrac{1}{f(x,y)}\dfrac{\partial f}{\partial y} \end{cases}$$ Thus, $$\begin{cases} \dfrac{\partial g}{\partial x} = x^2y^2e^{-x^2 -2y^2}\biggl(\dfrac{2}{x} - 2x\biggr) = 0\\ \dfrac{\partial g}{\partial y} = x^2y^2e^{-x^2 -2y^2}\biggl(\dfrac{2}{y} - 4y\biggr) = 0 \end{cases}$$ This system, the critical points are $(0,0)$, $(-1,-\frac{1}{\sqrt{2}})$, $(-1,\frac{1}{\sqrt{2}})$, $(1,\frac{1}{\sqrt{2}})$, $(1,-\frac{1}{\sqrt{2}})$.

-

Well the global minimum is obviously $0$. As for the other part, yes you have to find the values of $x$ and $y$, for which $f_x$ and $f_y$ are bout equal to $0$. From then on (this is quite hard for me to formulate, because English is not my native language), you have to plug those values into a matrix $$\begin{pmatrix} f_{xx} & f_{xy} \\ f_{yx} & f_{yy} \end{pmatrix}$$ and if $D(a,b)>0$ and $f_{xx}(a,b)>0$ then the point $(a,b)$ is a local minimum of f.

If $D(a,b)>0$ and $f_{xx}(a,b)<0$ then the point $(a,b)$ is a local maximum of f.

If $D(a,b)<0$ then the point $(a,b)$ is a saddle point of f.

Hope this helps $\ddot\smile$.

-
Hi thank you so much for your response @randomname! When I did that, I found that one of the critical points gave me D(a,b) = 0. I read online that it means the test is inconclusive. What should I do now? Also, now that I found the local max/min, how do I find the global max/min? –  manny Jul 15 '14 at 22:01

Set $x^2=u,y^2=v$ then

$$f(x,y) = g(u,v)=uv e^{-u - 2v}$$

$$\frac{\partial g} {\partial u}=0 \implies (u-1)v=0$$

$$\frac{\partial g} {\partial v}=0 \implies (2v-1)u=0$$

The solutions are $u=v=0$ and $u=1,v=1/2$. the first is the global min. The second is a global max.

-

You have:

$$0= (e^{(-x^2-2y^2)})(2xy^2 -2x^3y^2)$$

$$0=(e^{(-x^2-2y^2)})(2x^2y-4x^2y^3)$$

Because $0 \neq e^{(-x^2-2y^2)}$:

$$0= 2xy^2 -2x^3y^2$$

$$0=2x^2y-4x^2y^3$$

You have two cases:

1)$x \neq 0$, then from second equation $0=y-2y^2$, so $y=0$ or $y=\frac{1}{2}$, so $(z,0)$ for all $z$ is potential extremum, and for $y=\frac{1}{2}$ from first $0=x-x^3$, so $x=1$ or $x=-1$.

2)$x=0$, then $(0,z)$ is potencial extermum for all $z$.

-

Another route is to change coordinates. If the exponent were $x^2+y^2$ then polar coordinates would be obvious; in lieu of this, we use the parameterization $$(x,y)=\left(r\cos\theta,\frac{1}{\sqrt{2}} r\sin\theta\right)$$ and so obtain $$f(r,\theta) = \frac{1}{2}r^4 e^{-r^2} \cos^2\theta\sin^2\theta=\frac{1}{8}r^4 e^{-r^2}\sin^22\theta.$$ This separates $f(r,\theta)$ into angular and radial parts which are easy to maximize/minimize.

-