# How do you minimize and maximize f(x,y)=(x-2)^2/9+(y-3)^2/36 constrained to 0<x-y^2<5?

Jun 21, 2016

Local minima at
$x = 2.13184 , y = 1.46008$
$x = 1.57632 , y = - 1.25551$
$x = 5.01427 , y = 0.119455$

Local maximum at
x = 0.0418471, y = -0.204566

#### Explanation:

Using slack variables ${s}_{1} , {s}_{2}$ to reduce the optimization problem to an equality restrictions one, the formulation can be stated as

min/max

$f \left(x , y\right) = {\left(x - 2\right)}^{2} / 9 + {\left(y - 3\right)}^{2} / 36$

subjected to

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

The lagrangian

$L \left(x , y , {s}_{1} , {\lambda}_{1} , {s}_{2} , {\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)$

is analytical so the determination of stationary points include the local maxima/minima points.

The stationary points are solutions of

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

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

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

giving

( (x = 2.13184, y = 1.46008, lambda_1 = -0.0292967, s_1 = 0., lambda_2 = 0., s_2 = -2.23607), (x = 0.0418471, y = -0.204566, lambda_1 = 0.435145, s_1 = 0., lambda_2 = 0., s_2 = -2.23607), (x = 1.57632, y = -1.25551 , lambda_1 = 0.0941516, s_1 = 0., lambda_2 = 0., s_2 = -2.23607), (x =5.01427, y = 0.119455, lambda_1 = 0., s_1 = -2.23607, lambda_2 = -0.669838, s_2 = 0.) )

The first three points are located in the boundary defined by ${g}_{1} \left(x , y , 0\right) = 0$ so must be qualified by ${f}_{{g}_{1}}$. The last is located in the boundary defined by ${g}_{2} \left(x , y , 0\right) = 0$ and must be qualified by ${f}_{{g}_{2}}$

${f}_{{g}_{1}} \left(x\right) = \frac{1}{36} \left(25 + 6 \sqrt{x} - 15 x + 4 {x}^{2}\right)$
${d}^{2} / \left({\mathrm{dx}}^{2}\right) {f}_{{g}_{1}} \left(x\right) = \frac{2}{9} - \frac{1}{24 {x}^{\frac{3}{2}}}$

${d}^{2} / \left({\mathrm{dx}}^{2}\right) {f}_{{g}_{1}} \left(2.13184\right) = 0.208836$ local minimum
${d}^{2} / \left({\mathrm{dx}}^{2}\right) {f}_{{g}_{1}} \left(0.0418471\right) = - 4.64511$ local maximum
${d}^{2} / \left({\mathrm{dx}}^{2}\right) {f}_{{g}_{1}} \left(1.57632\right) = 0.201169$ local minimum

and

${f}_{{g}_{2}} \left(x\right) = \frac{1}{36} \left({\left(\sqrt{x - 5}\right)}^{2} + 4 {\left(x - 2\right)}^{2} - 3\right)$
${d}^{2} / \left({\mathrm{dx}}^{2}\right) {f}_{{g}_{2}} \left(x\right) = \frac{2}{9} - \frac{1}{24 {\left(x - 5\right)}^{\frac{3}{2}}}$

${d}^{2} / \left({\mathrm{dx}}^{2}\right) {f}_{{g}_{2}} \left(5.01427\right) = 24.6667$ local minimum

Attached the local extrema location with objetive function contours
and the surfaces involved.