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

Jul 4, 2016

There are several local maxima/minima

#### 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) = x - x {y}^{2}$

subjected to
${g}_{1} \left(x , y , {s}_{1}\right) = {x}^{2} + y - {s}_{1}^{2} - 1 = 0$
${g}_{2} \left(x , y , {s}_{2}\right) = {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

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

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

( (x = 0, y=1., lambda_1 = 0, s_1 = -1., lambda_2= 0, s_2 = 0), (x = -1.09545, y= -0.2, lambda_1 = 0, s_1= -1., lambda_2 = 0.438178, s_2 = 0), (x = 1.09545, y= -0.2, lambda_1= 0, s_1= -1., lambda_2 = -0.438178, s_2 = 0), (x = -0.66874, y= -0.447214, lambda_1 = 0.59814, s_1 =0, lambda_2 = 0, s_2= -1.), (x = 0.66874, y= -0.447214, lambda_1 = -0.59814, s_1 = 0, lambda_2 = 0, s_2 = -1.) )

Those five points must be qualified. The first second and thirt activate constraint ${g}_{2} \left(x , y , 0\right)$ and the two other activate constraint ${g}_{1} \left(x , y , 0\right)$ Their qualification will be done with

$f \circ {g}_{1} \left(x\right) = x - {x}^{5}$ and
$f \circ {g}_{2} \left(x\right) = - {x}^{3} \left({x}^{2} - 2\right)$

giving

${d}^{2} / \left({\mathrm{dx}}^{2}\right) f \circ {g}_{1} \left(- 0.66874\right) = 5.9814$ local minimum
${d}^{2} / \left({\mathrm{dx}}^{2}\right) f \circ {g}_{1} \left(0.66874\right) = 5.90567$ local maximum
${d}^{2} / \left({\mathrm{dx}}^{2}\right) f \circ {g}_{2} \left(0\right) = 0$ not decidable
${d}^{2} / \left({\mathrm{dx}}^{2}\right) f \circ {g}_{2} \left(- 1.09545\right) = 13.1453$ local minimum
${d}^{2} / \left({\mathrm{dx}}^{2}\right) f \circ {g}_{2} \left(1.09545\right) = - 13.1453$ local maximum

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