I've got the next function: $f(x,y)=xy$
I need to find the local minima / maxima in a block domain by $y=0$ and $y=x^2-4$.
Largrange multipilers jumped to my mind. But i don't know how to choose a correct $g(x,y)$
Instinct-wise i would pick: $g(x,y)=0-(x^2-4)$ but i get wrongs answers.
In summary, I'm having problem to determine $g(x,y)$ whenever i have a blocked domain by 2 functions. Any directions?
From what I can tell, the feasible set is $F=\{(x,y) | y \le 0, \ \ y \ge x^2-4 \}$.
$F$ is compact, so a minimum and maximum exists.
Let $g_1((x,y)) = y$, $g_2((x,y)) = x^2-4-y$. Then $F=\{(x,y) |g_i((x,y)) \le 0 , i = 1,2\}$.
There are four possibilities to consider when looking for the extrema, depending on whether $g_i((x,y)) = 0$ or $g_i((x,y)) < 0$.
Suppose neither constraint is active, then we must have $Df((x,y)) = 0$ at an extrema. However, since $D f((x,y)) = (y,x)$, we see the only point that satisfies this condition is $x=y=0$, and since at the points $(\pm 1,-1) \in F$, $f$ takes on the values $\pm1$, we see that $(0,0)$ is not an extrema.
So, at least one constraint must be active. A similar analysis shows that if $g_1((x,y)) = y=0$, then we must have $f((x,y)) = 0$, hence this constraint cannot be active at an extrema.
The only remaining possibility is $g_2((x,y)) = 0$, which gives $y=x^2-4$, and so the cost function has values $\phi(x)=f((x,x^2-4)) = x^3-4x$. Since we must have $(x,y) \in F$, we also need $y \le 0$, which implies $x^2-4 \le 0$ or $x \in [-2,2]$. We notice that $\phi(-2)=\phi(2) = 0$, so the extremizing values of $x$ must occur in $(-2,2)$. Since $\phi$ is a cubic, we may differentiate to get $\phi'(x) = 3 x^2 -4$, which is zero at $x = \pm \frac{2}{\sqrt{3}}$. Since there are only two values and the maximum and minimum are in $(-2,2)$, the maximum and minimum must occur at these points, hence the extremizing points are $(\pm \frac{2}{\sqrt{3}}, -\frac{8}{3})$, and the corresponding cost values are $\pm \frac{16}{\sqrt{27}}$.