$f : \mathbb{R} \to \mathbb{R}$ is given by $f(x,y) = -x^2 - y^2$. Calculate $\max[f]$ subject to $x + y \leq 1$.
Define $\mathcal{L}(x,y,\lambda) = -x^2 - y^2 - \lambda (x + y - 1)$. We need to calculate $\nabla (x,y,\lambda) = 0 \implies (x,y,\lambda) = \left(\frac{1}{2}, \frac{1}{2}, 1\right)$.
This neither solves for $\max[f] \text{ subject to } x + y \leq 1$ nor for $\min[f] \text{ subject to } x + y \leq 1$. Why is that the case and how to calculate the two (specifically) using Lagrange multipliers?
The Lagrange method requires that the involved manifolds be continuously derivable. As the restriction $x+1\le 1$ does not fulfill this requirement, we can apply the method after transforming the inequality into an equivalent equation. So we consider instead $x+y-1+s^2=0$, with $s$ a so called slack variable. The Lagrangian now is
$$ L(x,y,\lambda,s) = -x^2-y^2+\lambda(x+y-1+s^2) $$
now the stationary points are the solutions for
$$ \nabla L = 0 = \left\{ \begin{array}{l} \lambda -2 x \\ \lambda -2 y \\ s^2+x+y-1 \\ 2 \lambda s \\ \end{array} \right. $$
etc.