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

##### 1 Answer

Write a Lagrange function with 2 multipliers and 2 slack variables.

Compute the partial derivatives.

Solve the system of equations.

#### Explanation:

For the constraint,

We add two slack variables into two constraint functions:

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

We can write the Lagrange function:

Compute the partial derivatives:

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

Please observe that the extrema are located at the points are where equations [3] and [4] are satisfied by

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

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

This gives the function's minimum:

For the maximum, we have the condition where

Equation [6.2] gives us the value for x: