Optimization – Lagrange Multipliers with Inequality Constraints

calculuslagrange multipliermultivariable-calculusoptimization

I do not have much experience with constrained optimization, but I am hoping that you can help. My current problem involves a more complex function, but the constraints are similar to the ones below. Just so that I can see how to apply Lagrange multipliers to my problem, I want to look at a simpler function.

Suppose that I would like to minimize the function

$$
f(x,y) = a + bx + cy
$$

subject to the constraints
$$
0 \le x, y \le 1.
$$

If I understand the Lagrange multipliers technique correctly, I should create 4 constraint functions: $x = 0$, $x = 1$, $y = 0$, and $y = 1$. This would lead to minimizing the function
$$
a + bx + cy – \lambda_1 x + \lambda_2 (x-1) – \lambda_3y + \lambda_4(y-1)
$$

with respect to $x,y,\lambda_1, \lambda_2,\lambda_3$, and $\lambda_4$.

Does this look correct? If not, where did I go wrong? Your help is greatly appreciated.

Best Answer

That might work, but it has far more variables than equations. I recommend thinking instead as follows:

The region $ 0 \leq x, y \leq 1$ is a square. More importantly, it's a compact region. So we know that our function will take a maximum and a minimum somewhere. So it will either attain its extrema in the interior, or on the boundary.

To check the interior, perform the usual max/min test: take the gradient and set to zero. Either use the multivariable 'second-derivative test' or just compare the points to check for maxima and minima. Now, you should check the boundaries. This means you could do the regular Lagrange multipliers method 4 times, one with each constraint $$\begin {align} y &= 0; \quad x = 0 \\ y &= 0; \quad x = 1 \\ y &= 1; \quad x = 0 \\ y &= 1; \quad x = 1 \end{align}$$ I want to emphasize that I would do these constraints separately rather than together. Each one is very trivial to solve - but you only pay attention to solutions within your region of interest. There is one more place that you need to check, and that's the corners (here, the boundary of the boundary: it's as if we treated our domain as 4 separate lines, themselves closed and bounded).

Finally, you compare these three areas: the interior, the line-boundaries, and the corner boundaries. Because the region is compact, there will be an absolute max and absolute min (perhaps multiple). That seems to be the easiest way to do this, especially as all the equations in this case are very simple to solve (all linear).

I should note that you do not need to use Lagrange multipliers if you don't want. You could interpret the lines as paths, and maximize/minimize the curve along each of the paths (which does not require lagrange, but instead a parameterization). Then you still compare the interior and the boundary. But this sounds not so fun to me, and not worth it in this case.

Related Question