Using lagrange-multipliers to get extrema on the boundary You might skip the example and just jump to the question.
Let's assume we have:
$f(x,y) = \frac{x^2}{2}+\frac{y^2}{2}$ and $M:=\{(x,y)\in\mathbb R^2 | \frac{x^2}{2}+y^2\leq1\}$
We get a minima in $p_1=(0,0)$ and two maxima at $p_{2,3}=(\pm\sqrt{2},0)$
One get's the local extrema by doing $df\overset{!}{=}0$. With the hessian we might be able to decide what kind of points we got.
If only the local extrema are wanted, we are finished. But they might ask me for the global ones. To get them, I either set each variable to zero and look at the resulting points or we use lagrangian-multipliers. [In this problem, it might be overkill, but nevermind]
So let's do it:
Define $g(x,y):=\frac{x^2}{2}+y^2-1=0$
Define $L=f-\lambda g = \frac{x^2}{2}+\frac{y^2}{2}-\lambda(\frac{x^2}{2}+y^2-1)
$\frac{\partial L}{\partial x} x-\lambda x = 0 \Rightarrow \lambda_1 = 1, x = 0$
$\frac{\partial L}{\partial y} y-\lambda 2y = 0 \Rightarrow \lambda_1 = 1/2, y = 0$
$g=0 \Rightarrow x^2 + 2y^2 = 2$
For $\lambda_1$ we get the possible extrem points $p_1(0,1), p_2=(0,-1)$
For $\lambda_2$ we get the possible extrem points $p_3(\sqrt{2},0), p_4=(\sqrt{2},0)$
By evaluating $f(p_i)$ or $Hess(L)$ (wheres the hessian might be not enough) we see what kind of points we got.
Questions:
1. If you look up "lagrangian-multiplier", you see, that it says: "(..)is a strategy for finding the local maxima and minima of a function subject to equality constraints". [Wikipedia] To what function are the points we got with the lagrangian multiplier local? I mean, that are boundary points, I somehow can't think of a function where they are local extrem. [Which implies they are critical points, doesn't it, so it can't be on the boundery] 
 A: Let a compact body $B\subset{\mathbb R}^3$ (with interior, smooth faces, edges, and vertices), and independently a $C^1$-function $f:\>{\mathbb R}^3\to{\mathbb R}$ be given. From general principles we know that the function $f$ takes a global maximum on $B$, i.e., there is at least one point $p\in B$ with $f(p)\geq f(x)$ for all $x\in B$. A fortiori such a point $p$ is also a local maximum of $f$ on $B$: Given any neighborhood $U$ of $p$ we have $f(p)\geq f(x)$ for all $x\in B\cap U$.
If the local maximum $p$ happens to be an interior point of $B$ then we can walk away from $p$ in all directions without leaving $B$. As a consequence the point $p$ is a "full" stationary point of $f$, and will be brought to the fore by solving $\nabla f(x)=0$, $x\in B$. 
If the local maximum $p$ happens to be a boundary point of $B$ then the argument used to prove $\nabla f(p)=0$ does not apply, hence we cannot expect that $\nabla f(p)=0$. Nevertheless calculus can help us: A boundary point $p$ is (a vertex or) an interior point of a lower-dimensional stratum $S$ (a face or an edge) of the boundary of $B$, and we of course have $f(p)\geq f(x)$ for all $x\in S\cap U$ as well. If this $S$ can be parametrized as
$$S:\quad(u,v)\mapsto x(u,v),\qquad x(u_0,v_0)=p,$$
then   the pullback $\hat f(u,v):=f\bigl(x(u,v)\bigr)$ is available explicitly. The function $\hat f$ has a "full" local maximum at $(u_0,v_0)$, and solving the equation $\nabla\hat f(u,v)=0$ will then bring $(u_0,v_0)$, hence $p$, to the fore.
If, however, $S$ is given by an equation $g(x_1,x_2,x_3)=0$ (or by two such equations in the case of an  edge) then we have to resort to Lagrange multipliers. We still have $f(p)\geq f(x)$ for all $x\in S\cap U$. The geometric analysis of the situation  leads to the conclusion that in this case necessarily $\nabla f(p)\perp S_p$, whereby $S_p$ denotes the tangential plane to $S$ at $p$. Under these circumstances the point $p$ is called a conditionally stationary point of $f$, and Lagrange's method will bring it to the fore.
Going in this way through all the strata of $B$ we obtain a hopefully finite candidate list $\{p_1,p_2,\ldots,p_N\}$ consisting of full or conditionally stationary points of $f$, and the vertices of $B$. The global maximum of $f$ on $B$ is then found by comparing the values $f(p_k)$ $(1\leq k\leq N)$ – no second derivatives needed.
