Lagrange Multiplier- question

You are asked to

optimize Z= 4x1x2 + x1

subject to:

x1 ≤ 5 ——(1)

x1 + x2 = 10 ———(2)

x2 ≥ 0 ——— (3)

As a result our whole equation becomes

L= (4x1x2 + x1) + خ»1(5- x1 – x32) + خ»2(10- x1 – x2) + خ»3(x2 – x42)

I want to know is how does (1) becomes x1 + x32 = 5 —-> 5- x1 – x32 = 0. Why do we have the x32 there?

Same for x2 ≥ 0 —–> x2 – x42 = 0. Why is the x42 there?

The only part I understand is (2) where we get 10- x1 – x2 =0



1 Answer


An inequality constraint f(x)≥cf(x) \geq c can be imposed as an equality constraint f(x)−c=y2f(x)-c=y^2, where yy is a new variable (called a slack variable) which is otherwise not constrained by the problem. The key is that no matter what yy is, y2≥0y^2 \geq 0, so this equality constraint forces f(x)−cf(x)-c to be some nonnegative number without imposing any other requirements. This is exactly what you want to achieve.

In your problem you just do this twice, setting 5−x1−x23=05-x_1-x_3^2=0 and x2−x24=0x_2-x_4^2=0. Note that you need two different slack variables (one for each inequality constraint) so that you do not accidentally force 5−x15-x_1 to be equal to x2x_2.



Very helpful thank you!!!
– user225875
Oct 20 at 19:34