How do you maximize and minimize #f(x,y)=x-siny# constrained to #0<=x+y<=1#?

1 Answer
May 27, 2017

Write a Lagrange function with 2 multipliers and 2 slack variables.
Compute the partial derivatives.
Solve the system of equations.

Explanation:

For the constraint, #0<=x+y<=1#, written separately:

#x+y>=0# and #1-x - y>= 0#

We add two slack variables into two constraint functions:

#g_1(x,y,s) = x+y-s^2=0#

#g_2(x,y,t) = 1-x-y-t^2=0#

Note: squaring the slack variables assures that the constraint is enforced by disallowing negative values.

We can write the Lagrange function:

#\mathcalL(x,y,s,t,u,v) = f(x,y)+ug_1(x,y,s)+vg_2(x,y,t)#

#\mathcalL(x,y,s,t,u,v) = x-sin(y)+u(x+y-s^2)+v(1-x-y-t^2)#

#\mathcalL(x,y,s,t,u,v) = x-sin(y)+ux+uy-us^2+v-vx-vy-vt^2#

Compute the partial derivatives:

#(del(\mathcalL(x,y,s,t,u,v)))/(delx) = 1+u-v#

#(del(\mathcalL(x,y,s,t,u,v)))/(dely) = -cos(y)+u-v#

#(del(\mathcalL(x,y,s,t,u,v)))/(dels) = -2us#

#(del(\mathcalL(x,y,s,t,u,v)))/(delt) = -2vt#

#(del(\mathcalL(x,y,s,t,u,v)))/(delu) = x+y-s^2#

#(del(\mathcalL(x,y,s,t,u,v)))/(delv) = 1-x-y-t^2#

Set the partial derivatives equal to 0 and the solve as a system of nonlinear equations:

#0 = 1+u-v" [1]"#

#0 = -cos(y)+u-v" [2]"#

#0 = -2us" [3]"#

#0 = -2vt" [4]"#

#0 = x+y-s^2" [5]"#

#0 = 1-x-y-t^2" [6]"#

Please observe that the extrema are located at the points are where equations [3] and [4] are satisfied by #s = t= 0#; this makes the remaining equations become:

#0 = 1+u-v" [1]"#

#0 = -cos(y)+u-v" [2]"#

#0 = x+y" [5.1]"#

#0 = 1-x-y" [6.1]"#

Because u and v are not forced to be zero, we can subtract equation [2] from equation [1]

#0 = 1 +cos(y)#

#cos(y) = -1#

#y = cos^-1(-1)#

#y = pi#

Using equation [5.1] , we obtain the value for x:

#x = -pi#

This gives the function's minimum:

#f(-pi,pi) = -pi#

For the maximum, we have the condition where #u =s = t = 0#

#cos(y) = 1#

#y = 0#

Equation [6.2] gives us the value for x:

#x = 1#

#f(1,0) = 1#