# How do you minimize and maximize f(x,y)=(2x-y)+(x-2y)/x^2 constrained to 1<yx^2+xy^2<3?

##### 1 Answer
Jul 3, 2016

Two local maxima at
$\left\{x = - 2.43526 , y = 0.716915\right\}$
$\left\{x = - 1.75902 , y = 0.426693\right\}$
Two local minima at
$\left\{x = 1.60753 , y = - 2.38878\right\}$
$\left\{x = 1.39063 , y = - 1.79193\right\}$

#### Explanation:

With the so called slack variables ${s}_{1} , {s}_{2}$ we transform the maximization/minimization with inequality constraints problem, into a formulation amenable for the Lagrange Multipliers technique.

Now the lagrangian formulation reads:

minimize/maximize
$f \left(x , y\right) = f \left(x , y\right) = 2 x - y + \frac{x - 2 y}{x} ^ 2$

subjected to
${g}_{1} \left(x , y , {s}_{1}\right) = x {y}^{2} + {x}^{2} y - {s}_{1}^{2} - 1 = 0$
${g}_{2} \left(x , y , {s}_{2}\right) = x {y}^{2} + {x}^{2} y + {s}_{1}^{2} - 3 = 0$

forming the lagrangian

$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 local minima/maxima points are included into the lagrangian stationary points found by solving

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

or

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

Solving for $x , y , {s}_{1} , {s}_{2} , {\lambda}_{1} , {\lambda}_{2}$ we obtain

( (x = -2.43526, y= 0.716915, l1 = 0, s1= -1.41421, l2= 0.548335, s2 = 0), (x = -2.43526, y = 0.716915, l1= 0, s1 = 1.41421, l2 = 0.548335, s2= 0), (x= 1.60753, y= -2.38878, l1 = 0, s1 = -1.41421, l2= -0.348111, s2 = 0), (x = 1.60753, y = -2.38878, l1 = 0, s1 = 1.41421, l2= -0.348111, s2 = 0), (x = -1.75902, y = 0.426693, l1 = 1.03348, s1 = 0, l2= 0, s2= -1.41421), (x = -1.75902, y = 0.426693, l1 = 1.03348, s1 = 0, l2 = 0, s2 = 1.41421), (x = 1.39063, y = -1.79193, l1 = -0.666958, s1 = 0, l2 = 0, s2 = -1.41421), (x = 1.39063, y = -1.79193, l1 = -0.666958, s1= 0, l2 = 0, s2 = 1.41421) )

Those eight points are truly four. The first and second activate constraint ${g}_{2} \left(x , y , 0\right)$ and the two other activate constraint ${g}_{1} \left(x , y , 0\right)$ and their qualification will be done with

$f \circ {g}_{1} \left(x\right) = \frac{2}{x} + \frac{5 x}{2} + \frac{\sqrt{4 + {x}^{3}}}{x} ^ \left(\frac{5}{2}\right) + \frac{\sqrt{4 + {x}^{3}}}{2 \sqrt{x}}$ and
$f \circ {g}_{2} \left(x\right) = \frac{2}{x} + \frac{5 x}{2} + \frac{\sqrt{12 + {x}^{3}}}{x} ^ \left(\frac{5}{2}\right) + \frac{\sqrt{12 + {x}^{3}}}{2 \sqrt{x}}$

giving

${d}^{2} / \left({\mathrm{dx}}^{2}\right) f \circ {g}_{1} \left(- 1.75902\right) = - 8.29064$ local maximum
${d}^{2} / \left({\mathrm{dx}}^{2}\right) f \circ {g}_{1} \left(1.39063\right) = 5.90567$ local minimum
${d}^{2} / \left({\mathrm{dx}}^{2}\right) f \circ {g}_{2} \left(- 2.43526\right) = - 8.85699$ local maximum
${d}^{2} / \left({\mathrm{dx}}^{2}\right) f \circ {g}_{2} \left(1.60753\right) = 5.10192$ local minimum

Attached a figure with the $f \left(x , y\right)$ contour map inside the feasible region, with the local maxima/minima points.