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

Jun 5, 2016

There are two local minima points at ${p}_{1} = \left\{0 , 1\right\}$ and ${p}_{2} = \left\{0 , 0\right\}$

#### Explanation:

We will searching for stationary points, qualifying then as local maxima/minima.

First we will transform the maxima/minima with inequality restrictions into an equivalent maxima/minima problem but now with equality restrictions.

To do that we will introduce the so called slack variables ${s}_{1}$ and ${s}_{2}$ such that the problem will read.

Maximize/minimize $f \left(x , y\right) = x {e}^{x} - y$
constrained to

{ (g_1(x,y,s_1)=x - y - s_1^2=0), (g_2(x,y,s_2)=x - y + s_2^2 - 1=0) :}

The lagrangian is given by

$L \left(x , y , {s}_{1} , {s}_{2} , {\lambda}_{1} , {\lambda}_{2}\right) = f \left(x , y\right) + {\lambda}_{1} {g}_{1} \left(x , y , {s}_{1}\right) + {\lambda}_{2} {g}_{2} \left(x , y , {s}_{2}\right)$

The condition for stationary points is

$\nabla L \left(x , y , {s}_{1} , {s}_{2} , {\lambda}_{1} , {\lambda}_{2}\right) = \vec{0}$

so we get the conditions

{ (e^x + lambda_1 + lambda_2 + e^x x = 0), ( -1 - lambda_1 - lambda_2 = 0), (-s_1^2 + x - y = 0), ( -2 lambda_1 s_1 = 0), ( -1 + s_2^2 + x - y = 0), ( 2 lambda_2 s_2 = 0) :}

Solving for $\left\{x , y , {s}_{1} , {s}_{2} , {\lambda}_{1} , {\lambda}_{2}\right\}$ we have

{(x =0, y = -1, lambda_1 = 0., s_1 = 1, lambda_2 = -1, s_2 = 0.), (x = 0, y = 0, lambda_1 =-1., s_1 = 0, lambda_2 = 0, s_2 = 1.) :}

so we have two points ${p}_{1} = \left\{0 , - 1\right\}$ and ${p}_{2} = \left\{0 , 0\right\}$

Point ${p}_{1}$ activates restriction ${g}_{2} \left(x , y , 0\right) = 0 , \left\{{\lambda}_{2} \ne 0 , {s}_{2} = 0\right\}$ and point ${p}_{2}$ activates restriction ${g}_{1} \left(x , y , 0\right) = 0 , \left\{{\lambda}_{1} \ne 0 , {s}_{1} = 0\right\}$

${p}_{1}$ is qualified with ${f}_{{g}_{2}} \left(x\right) = 1 + \left({e}^{x} - 1\right) x$

and

${p}_{2}$ is qualified with ${f}_{{g}_{1}} \left(x\right) = \left({e}^{x} - 1\right) x$

Computing

$\frac{d}{\mathrm{dx}} \left({f}_{{g}_{2}} \left(0\right)\right) = 0$

and

${d}^{2} / \left({\mathrm{dx}}^{2}\right) \left({f}_{{g}_{2}} \left(0\right)\right) = 2$

we conclude that ${p}_{1}$ local minimum point.

Analogously for ${p}_{2}$

$\frac{d}{\mathrm{dx}} \left({f}_{{g}_{1}} \left(0\right)\right) = 0$

and

${d}^{2} / \left({\mathrm{dx}}^{2}\right) \left({f}_{{g}_{1}} \left(0\right)\right) = 2$

so ${p}_{1} , {p}_{2}$ are local minima points