# How do you maximize and minimize f(x,y)=e^-x+e^(-3y)-xy subject to x+2y<7?

Jun 15, 2016

Local minimum at $x = 3.52143 , y = 1.73929$

#### Explanation:

We will using the so called slack variables to transform inequality into equality relations. So considering $s$ as a slack variable, the initial problem

Find local extrema for

$f \left(x , y\right) = {e}^{-} x + {e}^{- 3 y} - x y$ subject to $x + 2 y < 7$

is transformed into an equivalent one

$f \left(x , y\right) = {e}^{-} x + {e}^{- 3 y} - x y$ subject to $g \left(x , y , s\right) = x + 2 y + {s}^{2} - 7 = 0$

Forming the lagrangian

$L \left(x , y , s , \lambda\right) = f \left(x , y\right) + \lambda \left(x , y , s\right)$

The local extrema are included in the lagrangian stationary points. This is true mainly because $L \left(x , y , s , \lambda\right)$ is analytical.

The stationary points are determined finding the solutions to

$\nabla F \left(x , y , s , \lambda\right) = \vec{0}$

The resulting equations are

 { (-e^-x + lambda - y=0), (-3 e^(-3 y) + 2 lambda - x=0), (2 lambda s=0), (-7 + s^2 + x + 2 y=0) :}

This system of equations must be solved numerically using an iterative procedure like Newton-Raphson.
https://en.wikipedia.org/wiki/Newton%27s_method

Calling $X = \left\{x , y , s , \lambda\right\}$ and $F \left(X\right)$ the vector of equations the iterative procedure is

${X}_{k + 1} = {X}_{k} - \kappa H {\left({X}_{k}\right)}^{- 1} F \left({X}_{k}\right)$

where $H \left(X\right) = \nabla \left(\nabla F \left(X\right)\right)$

H(X) = ((e^-x, -1, 0, 1),(-1, 9 e^(-3 y), 0, 2),(0, 0, 2 lambda, 2 s),(1, 2, 2 s, 0))

$\kappa$ is a convergence factor here choosed as $1$

After some tries we find

${X}_{0} = \left\{3.52143 , 1.73929 , - 3.33992 \cdot {10}^{-} 20 , 1.76884\right\}$ as a stationary point. This point is at the restriction boundary because $s = - 3.33992 \cdot {10}^{-} 20 \approx 0$

$f \left(x , g \left(x , y , 0\right) = 0\right) = \left({f}_{g}\right) \left(x\right) = {e}^{\frac{3}{2} \left(x - 7\right)} + {e}^{-} x + \frac{1}{2} \left(x - 7\right) x$
Calculating $\frac{{d}^{2} {f}_{g}}{{\mathrm{dx}}^{2}}$ for $x = 3.52143$ we have
$\frac{{d}^{2} {f}_{g}}{{\mathrm{dx}}^{2}} = 1.04175 > 0$ characterizing the stationary point as a local minimum.