So I have a hard time understanding these kinds of problems. For example:
$$f(x,y)=ye^{-x^2-2y^2}$$ with constraint $D$ given by $x^2+y^2\leq 1$ and $y\geq0$. So I understand that I must find the partial derivative and then find out if there are any extremas on the boundary.But it is the last part I struggle with. What is the boundary? My book also says I should rearrange D and set $x^2=1-y^2$ in $f(x,y)$ and get a new function $g(y)$ with $0\leq y\leq1$. And then I must differentiate this function and set it equal to zero. I then have to plug the y-values I get back in to $g(y)$, and the values I get is my extremas.
Does this work for every function: rearrange and make a function with one variable and then my new function gives me the extremas? This confusses me. And when should I use Lagrange multiplieres, is it only for constraints with equal sign?
When working with this kind of problems we have to take advantage of the constrain. We can decompose the region $\text{D}$ into the inner part $\text{I}= \{ x, y \in \mathbb{R} \ : \ x^2+y^2< 1, \ y>0 \}$ and the boundary $\text{B}$. Furthermore, we can divide $\text{B}$ into two sections:
$$ \text{P}_{1} = \{ x,y \in \mathbb{R} \ : \ y=0, \ x \in [-1,1] \} \text{ and}$$
$$ \text{P}_{2} = \{ x,y \in \mathbb{R} \ : \ x^2+y^2=1 , \ y>0 \}. $$
We see that this decomposition satisfies the following condition $\text{D} = \text{B} \cup \text{P}_1 \cup \text{P}_2$ and that the regions $\text{D}, \ \text{P}_1 , \ \text{P}_2$ are pairwise disjoint.
On $\text{I}$ we find extrema of $f$ by computing partial derivatives $f_{x}$ and $f_{y}$ and then solving the system of equations: $f_{x}=0, \ f_{y}=0$. To determine whether the solution is a maximum or a minimum we use Hessian matrix of the function $f$.
On $\text{P}_{1}$ and $\text{P}_{2}$ we can use the fact that one of the variables is now dependent on the other one; hence, the function becomes a function of one variable. On region $\text{P}_{1}$ we denote it $f_1$ and the region $\text{P}_{2}$ we denote it $f_2$. Next, we see that:
$$ f_1 (x) = 0, \ x \in [-1, 1 ] \text{ and } f_2 (y) = y \ e^{-1-y^2} , \ y \in (0, 1]. $$
On $\text{I}$ there is only one maximum at $ (0, 0.5)$ and on $\text{P}_{2}$ there are two maxima at $ ( \pm 1/ \sqrt{2}, 1/ \sqrt{2} )$ and one minimum at $(0,1)$.
One can always use the method of Lagrange multipliers. However, the computation are difficult and it is better to find these kind of workarounds.