# Find the maximum and minimum of a multivariable function on a circle

This question is a continuation from a previous question I recently asked: Stationary points of a multivariable function

I now have to find the maximum and minimum values of my function on the circle: $$x^2 +y^2 = 4$$

I'll repeat what I have so you don't have to keep checking back to my previous post:

The function: $$f(x,y) = (x^2+2y^2)e^{-x^2-y^2}$$

The partial derivatives: $$f_x = (-2x(x^2+2y^2)+2x)e^{-x^2-y^2}$$, $$f_y=(-2y(x^2+2y^2)+4y)e^{-x^2-y^2}$$

From here I set up my Lagrange equations (Since I know that that $$\nabla f = \lambda \nabla g$$ where $$g$$ is the function of the given circle):

(I also know that $$e^{-x^2-y^2}$$ simply becomes $$e^{-4}$$ since $$x^2 +y^2 =4$$)

$$(-2x(x^2+2y^2)+2x)e^{-4} = 2\lambda x \space (1)$$

$$(-2y(x^2+2y^2)+4y)e^{-4} = 2\lambda y \space (2)$$

$$x^2+y^2 = 4 \space (3)$$

From here I wasn't entirely sure what to do but I tried dividing both sides of $$(1)$$ by $$2x$$ to get: $$-e^{-4}(x^2+2y^2)+e^{-4} = \lambda$$, and similarly divide both sides of $$(2)$$ by $$2y$$ to get: $$-e^{-4}(x^2+2y^2)+2e^{-4} = \lambda$$

So my new Lagrange equations would be:

$$-e^{-4}(x^2+2y^2)+e^{-4} = \lambda \space (4)$$

$$-e^{-4}(x^2+2y^2)+2e^{-4} = \lambda \space (5)$$

$$x^2 +y^2 = 4 \space (3)$$

I'm not even sure if what I did is correct and even so I'm not sure where I would go from here, equating $$(4)$$ and $$(5)$$ wouldn't help (At least I don't think it will) and so I'm quite confused on where to go from here or where I've made a mistake.

If anyone can guide me in the right direction or show me a better method it would really help, thanks in advance

Before analyzing your solution, I'll use a simpler method: the function to study is $$F(x)=(8-x^2)e^{-4}$$ for $$x\in[-2,2]$$. The minimum is $$4e^{-4}$$ and the maximum is $$8e^{-4}$$.

If you want to go the hard way, the equations to solve are $$\begin{cases} 2x(1-x^2-2y^2)e^{-x^2-y^2}=2\lambda x \\[6px] 2y(2-x^2-2y^2)e^{-x^2-y^2}=2\lambda y \\[6px] x^2+y^2=4 \end{cases}$$ Since $$x^2+y^2=4$$ you can't have both $$x=0$$ and $$y=0$$, so there are three cases.

## Case 1

$$\begin{cases} x=0 \\[6px] (2-x^2-2y^2)e^{-4}=\lambda \\[6px] x^2+y^2=4 \end{cases}$$ This leads to $$y=\pm2$$.

## Case 2

$$\begin{cases} (1-x^2-2y^2)e^{-x^2-y^2}=\lambda \\[6px] y=0 \\[6px] x^2+y^2=4 \end{cases}$$ This leads to $$x=\pm2$$

## Case 3

$$\begin{cases} (1-x^2-2y^2)e^{-x^2-y^2}=\lambda \\[6px] (2-x^2-2y^2)e^{-x^2-y^2}=\lambda \\[6px] x^2+y^2=4 \end{cases}$$ This has no solution.

Hence you have to consider $$f(0,\pm2)=8e^{-4} \qquad f(\pm2,0)=4e^{-4}$$

• This makes sense to me, and yes unfortunately on my course they want us to use Lagrange equations, just to make it harder for us :) Thanks for the quick reply Aug 16, 2021 at 15:19
• Sorry, I'm just looking through your method and trying to replicate it myself but I can't get the equations you do. The initial 3 equations, I can't seem to get the first two. From the partial derivatives I've provided I'm not sure how you got $2x(1-x^2-2y^2)e^{-x^2-y^2} = 2\lambda x$ and $2y(2-x^2 -2y^2)e^{-x^2-y^2}=2\lambda y$, when I try to expand and simplify my partial derivatives I get: $(-2x^3-2xy^2+2x)e^{-x^2-y^2} =2\lambda x$ which then becomes $2x(1-x^2-y^2)e^{-x^2-y^2}=2\lambda x$, and similarly for the equations for $2\lambda y$. Inside my bracket I'm getting $-y^2$, not $-2y^2$ Aug 16, 2021 at 15:41
• Ok I fixed my comment Aug 16, 2021 at 15:41
• nevermiiiiiiind, I've misread what I'm writing AGAIN. I think I've done this on my last 5 posts Aug 16, 2021 at 15:43
• I put $x^2 +y^2$ in my bracket instead of $x^2 +2y^2$, I always make these mistakes... Aug 16, 2021 at 15:43

We are given that $$x^2+y^2=4$$ and we want to minimize $$f(x,y)=(x^2+2y^2)e^{-x^2-y^2}$$.

Since $$x^2+y^2=4$$, we know that on this curve, $$f(x,y)=(4+y^2)e^{-4}$$ This is now just a single variable expression dependent on $$y$$.

On the curve $$x^2+y^2=4$$, we have that $$-2\leq y\leq 2$$. Taking the derivative wrt $$y$$, $$\frac{\partial f(x,y)}{\partial y}=2e^{-4}y$$ Hence, there is a critical value when $$y=0$$

We can then use candidates test and evaluate the function when $$y\in\{-2,0,2\}$$ to conclude that the minima of $$\boxed{4e^{-4}}$$ occurs when $$y=0$$ and the maxima of $$\boxed{8e^{-4}}$$ occurs when $$y=\pm 2$$.

• I think I understand your method but I feel like this method only really works because we're able to substitute in $x^2 +y^2 = 4$ into our $f(x,y)$. Which is rarely the case in these questions, at least for me. In your method you also find $y=+-2$, but I also believe there is a way we can find $x = +-2$ so I believe there are $4$ points, not $2$. Your method gives the correct answer, which I guess is what matters most, but I'm trying to learn the Lagrange equations method since it can be applied to almost any question of this type. Thank you for the quick reply though Aug 16, 2021 at 15:13
• Since we converted it into a single variable function in $y$, we don't really care about the values of $x$. You are right in that when $x=\pm 2$, we have $y=0$, which yields the minimum. Aug 16, 2021 at 15:15
• Ah ok, I'll definitely keep this method in mind since it's much simpler than Lagrange equations Aug 16, 2021 at 15:20