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

Oct 13, 2016

See below.

#### Explanation:

How do you minimize and maximize $f \left(x , y\right) = \frac{x - y}{{x}^{3} - {y}^{3}}$ constrained to $2 < x y < 4$?

Considering that $\frac{{x}^{3} - {y}^{3}}{x - y} = {x}^{2} + x y + {y}^{2}$ we have now the optimization problem

Find extrema of

$f \left(x , y\right) = \frac{1}{{x}^{2} + x y + {y}^{2}}$

subjected to

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

${s}_{1} , {s}_{2}$ are known as slack variables. They are used to transform the inequality into equality relations.

The lagrangian is

$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)$ and it's stationary points are the points obeying

$\nabla L = \vec{0}$ or

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

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

( (x = -2., y = -2., s_1 = -1.41421, s_2 = 0, lambda_1 = 0, lambda_2 -> 0.0208333), (x = 2., y= 2., s_1 = -1.41421, s_2 = 0, lambda_1= 0, lambda_2 = 0.0208333), (x = -1.41421, y= -1.41421, s_1 = 0, s_2 = -1.41421, lambda_1 =0.0833333, lambda_2 = 0), (x = 1.41421, y = 1.41421, s_1 = 0, s_2= -1.41421, lambda_1= 0.0833333, lambda_2 = 0))

The stationary points qualification is done according to the sign of

$\frac{{d}^{2} \left(f \circ {g}_{1}\right) \left({s}_{1} = 0\right)}{{\mathrm{dx}}^{2}}$ and
$\frac{{d}^{2} \left(f \circ {g}_{2}\right) \left({s}_{2} = 0\right)}{{\mathrm{dx}}^{2}}$

Here

$\left(f \circ {g}_{1}\right) \left(x\right) = \frac{1}{2 + \frac{4}{x} ^ 2 + {x}^{2}}$
$\left(f \circ {g}_{2}\right) \left(x\right) = \frac{1}{4 + \frac{16}{x} ^ 2 + {x}^{2}}$

and

$\frac{{d}^{2} \left(f \circ {g}_{1}\right) \left({s}_{1} = 0\right)}{{\mathrm{dx}}^{2}} < 0$ and
$\frac{{d}^{2} \left(f \circ {g}_{2}\right) \left({s}_{2} = 0\right)}{{\mathrm{dx}}^{2}} < 0$ for all points so

${p}_{1} , {p}_{2} , {p}_{3} , {p}_{4}$ are all local maxima.

Attached a plot showing the feasible region and the points location.