I'm new to optimisation and have a problem. I'm supposed to find stationary points to the following function $f$ under the constrain $g$: $$f(x,y) = xy$$ $$g(x,y) = x^4 + y^4 + 2xy - 4 = 0$$ which gives me: $$\nabla f = (y,x)$$ $$\nabla g = 2(2x^3 + y, 2y^3 + x)$$
The determinant and calculations then give me $y^4 = y^4$ and the stationary points $\pm(1,1)$ and $(\pm \sqrt{2}, \mp \sqrt{2})$. However, my professor said that we should be careful with moving on from this point because there can be other stationary points when $\nabla g = 0$ (??) and if they satisfy the constraint. What does he mean by this? Do I have to check the points where $y = -2x^3$? Do you always have to do this?
You can formulate the Lagrangian function
$$L\left(x,y,\lambda\right) = f\left(x,y\right) + \lambda\cdot g\left(x,y\right),$$
which "removes" the constraint by integrating it into the objective function, using the auxiliary variable $\lambda$ to represent a "penalty" for not satisfying it. Then, you can write the first-order condition
$$\nabla f + \lambda \nabla g = 0.$$
You are thus looking for $\left(x,y,\lambda\right)$ satisfying the above, as well as the feasibility condition $g\left(x,y\right) = 0$. The solutions of $\nabla f = 0$ alone may not satisfy both conditions.