Finding extrema with a constraint of the function

lagrange multipliermultivariable-calculus

So I have a hard time understanding these kinds of problems. For example:

$$f(x,y)=ye^{-x^2-2y^2}$$ with constraint $D$ given by $x^2+y^2\leq 1$ and $y\geq0$. So I understand that I must find the partial derivative and then find out if there are any extremas on the boundary.But it is the last part I struggle with. What is the boundary? My book also says I should rearrange D and set $x^2=1-y^2$ in $f(x,y)$ and get a new function $g(y)$ with $0\leq y\leq1$. And then I must differentiate this function and set it equal to zero. I then have to plug the y-values I get back in to $g(y)$, and the values I get is my extremas.

Does this work for every function: rearrange and make a function with one variable and then my new function gives me the extremas? This confusses me. And when should I use Lagrange multiplieres, is it only for constraints with equal sign?

Best Answer

To find the local extrema of a function subject to inequality constraints, we can't just carelessly split the problem into the boundary and the interior as stated by @Alexandra. To demonstrate why, let's consider one of the points found by @Alexanda, namely $P = \left(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right)$. If this was a local maxima subject to the constraints, then there should be some neighbourhood around this point that's in the feasible region decribed by the constraints where $f$ is always less than it's value at $P$. Notice that at point $P$ the gradient of $f$ is: $$\nabla f_P = - \left[\begin{matrix}e^{- \frac{3}{2}}\\e^{- \frac{3}{2}}\end{matrix}\right]$$ which points towards the interior of the circle (since it points radially inwards). Therefore, we can move in that direction to increase $f$ and so $f$ does not attain a local maximum at $P$.

You can always turn inequality constraints to equality constraints and use regular Lagrange multipliers. In your example, you have the objective function $f(x,y) = ye^{-x^2-2y^2}$ and constraints $g_1(x,y):= x^2 + y^2 -1 \leq 0$ and $g_2(x,y):= -y \leq 0$. If we bump up dimensions from say 2 dimensions to 4 dimensions, we can look at the constraints as $g_1(x,y,a,b):= x^2 + y^2 -1 + a^2 = 0$ and $g_2(x,y,a,b):= -y + b^2 = 0$. Now we can use the regular Lagrange multiplier method to get our solutions in this $4$-D space:

$$\Lambda(x,y,a,b,\lambda_1,\lambda_2) = f - \lambda_1g_1 - \lambda_2g_2$$ $\nabla \Lambda = 0$ gives us the solutions: $(x,y,a,b,\lambda_1,\lambda_2) = (-1, 0, 0, 0, 0, -e^{-1}) \left( 0, \frac{1}{2}, \pm \frac{\sqrt{3}}{2}, \mp \frac{\sqrt{2}}{2}, 0, 0\right), \left(0, 1, 0, \pm1, - \frac{3}{2 e^{2}}, 0\right), \left( 1,0, 0, 0, 0, - \frac{1}{e}\right)$

You can use the bordered hessian to check minima or maxima. Turns out first $(-1,0)$ is a saddle, $\left(0,\frac{1}{2}\right)$ is a max, $(0,1)$ is a min and $(1,0)$ is a saddle.

Related Question