Lagrange multiplier when decisions variables are not in the same set 
Find the maximum of $2x+y$ over the constraint set $$S = \left\{ (x,y) \in \mathbb R^2 : 2x^2 + y^2 \leq 1, \; x \leq 0 \right\}$$

I want to use Lagrange multipliers to find the optimal solution. However, Lagrange requires $\vec x \in A$. In our case $R$, however $x$ can only be negative or zero. How can I get rid of this constraint? My idea is to do $x=w-z, w-z \le 0, w,z \in R$, but I am not sure if this is the right way to do it.

You can solve this problem introducing convenient slack variables in order to eliminate inequalities. The inequalities
$$
2x^2+y^2 \le 1 \rightarrow 2x^2+y^2-1+\epsilon_1^2 = 0\\
x \le 0 \rightarrow x+\epsilon_2^2 = 0
$$
and the lagrangian thus is
$$
L(x,y,\lambda_1,\lambda_2,\epsilon_1,\epsilon_2) = 2x+y+\lambda_1(2x^2+y^2-1+\epsilon_1^2)+\lambda_2(x+\epsilon_2^2)
$$
the stationary condition $\nabla L = 0$ gives the conditions
$$
\left\{
\begin{array}{rcl}
 \lambda_2+4 \lambda_1 x+2& = & 0 \\
 2 \lambda_1 y+1& = & 0 \\
 \epsilon_1^2+2 x^2+y^2-1& = & 0 \\
 \epsilon_2^2+x& =& 0 \\
 \epsilon_1 \lambda_1& =& 0 \\
 \epsilon_2 \lambda_2& =& 0
\end{array}
\right.
$$
after solving we have
$$
\begin{array}{ccccccc}
x & y & \lambda_1 & \lambda_2 & \epsilon_1 & \epsilon_2 & 2x+y \\
 0 & -1 & \frac{1}{2} & -2 & 0 & 0 & -1 \\
 0 & 1 & -\frac{1}{2} & -2 & 0 & 0 & 1 \\
 -\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{3}} & \frac{\sqrt{3}}{2} & 0 & 0 & -\frac{1}{\sqrt[4]{3}} & -\sqrt{3} \\
\end{array}
$$
Here when $\epsilon_i = 0$ it means that the corresponding restriction is active. 
