That might work, but it has far more variables than equations. I recommend thinking instead as follows:
The region $ 0 \leq x, y \leq 1$ is a square. More importantly, it's a compact region. So we know that our function will take a maximum and a minimum somewhere. So it will either attain its extrema in the interior, or on the boundary.
To check the interior, perform the usual max/min test: take the gradient and set to zero. Either use the multivariable 'second-derivative test' or just compare the points to check for maxima and minima. Now, you should check the boundaries. This means you could do the regular Lagrange multipliers method 4 times, one with each constraint
$$\begin {align} y &= 0; \quad x = 0 \\ y &= 0; \quad x = 1 \\ y &= 1; \quad x = 0 \\ y &= 1; \quad x = 1 \end{align}$$
I want to emphasize that I would do these constraints separately rather than together. Each one is very trivial to solve - but you only pay attention to solutions within your region of interest. There is one more place that you need to check, and that's the corners (here, the boundary of the boundary: it's as if we treated our domain as 4 separate lines, themselves closed and bounded).
Finally, you compare these three areas: the interior, the line-boundaries, and the corner boundaries. Because the region is compact, there will be an absolute max and absolute min (perhaps multiple). That seems to be the easiest way to do this, especially as all the equations in this case are very simple to solve (all linear).
I should note that you do not need to use Lagrange multipliers if you don't want. You could interpret the lines as paths, and maximize/minimize the curve along each of the paths (which does not require lagrange, but instead a parameterization). Then you still compare the interior and the boundary. But this sounds not so fun to me, and not worth it in this case.
Assume $\mathbf{w}\neq\mathbf{0}$. We have
$$
<\mathbf{w},\mathbf{x}>=||\mathbf{w}||\, ||\mathbf{x}|| \cos(\varphi)=||\mathbf{w}|| \cos(\varphi),
$$
where $0\leq\varphi\leq\pi$ the angle between $\mathbf{w}$ and $\mathbf{x}$.
If $w_i\leq 0$ for all $i$ we obtain the minimal value in the only case $\varphi=\pi$ and $\mathbf{x}=\frac{\mathbf{w}}{||\mathbf{w}||}$.
If there are $i_0, j_0$ such that $w_{i_0}>0$ and $w_{j_0}<0$ then choose $\mathbf{y}$ such that $y_{i_0}:=0$ and $y_{j_0}:=-w_{j_0}$. Then $\mathbf{x}=\frac{\mathbf{y}}{||\mathbf{y}||}$.
If $w_i\geq 0$ for all $i$ then project $\mathbf{w}$ to the coordinate-axes. We obtain the vectors $\mathbf{w}_1,\ldots,\mathbf{w}_n$. The angles between $\mathbf{w}$ and $\mathbf{w}_i$ are $\varphi_i$. Choose $i_0$ such that the angle would be maximal (it is not necessarily unique). Then $\mathbf{x}=\frac{\mathbf{w}_{i_0}}{||\mathbf{w}_{i_0}||}$.
Best Answer
As barrycarter suggests, just set the two partial derivatives to 0: $$\frac {\partial f}{\partial x} = 0, \qquad \frac {\partial f}{\partial y} = 0$$ This gives you a pair of linear equations in $x, y$ that you can solve. The solution will be rational functions of $a, b, c, d, e$ that may or may not satisfy $0 \le x \le 1,\ \ 0 \le y \le 1$, depending on the values. If not, then in turn set $x = 0$, then $x = 1$, then $y = 0$, then $y = 1$. In each case, mimimize the function with respect to the other variable. Then select the lowest overall value among the four.