<s>[INST] Determine the nature of a critical point (Lagrange multipliers) 
Let $F \colon \mathbb R^2 \to \mathbb R$ be the function 
  $$
F(x,y):=xye^x + ye^y - e^x+1 
$$
  and denote with $C$ the set of zeroes of $F$, i.e. $C:=\{(x,y) \in \mathbb R^2 : F(x,y)=0\}$. Let also $f \colon \mathbb R^2 \to \mathbb R$ be a function which is $C^2$ in a neighbourhood of $(0,0)$ and such that 
  $$
\nabla f(0,0) = (-2,2), \qquad \qquad H_f(0,0) = \begin{pmatrix} 2 & 1 \\ 1 & 0  \end{pmatrix}.
$$
  Question: is $(0,0)$ a minimum for $f$ on $C$?

Well, I show you what I have done so far. First of all, some routine calculations yield
$$
\nabla F(0,0) = (-1,1) \qquad \qquad H_F(0,0) = \begin{pmatrix} -1 & 1 \\ 1 & 2  \end{pmatrix}
$$
Indeed, the fact that 
$$
\nabla f(0,0) = 2\nabla F(0,0)
$$
does agree with the theory of Lagrange multipliers: the gradients are parellel, so I think that $(0,0)$ is an extremum for $f$ on $C$. The problem is how to classify it without any information on $f$: we have only its hessian matrix, which is - I suppose - the key to solve this. Both $H_f(0,0)$ and $H_F(0,0)$ are indefinite. 
How can we establish the nature of the critical point $(0,0)$? 
Thanks in advance for your help.
 [/INST] In order to find the Hessian, we need to know the change in $f$ to second order in the deviation from $(0,0)$.
Expanding $F(x,y)$ around this point, we have up to second order
$$ F(x,y) = \nabla F(0,0)\begin{pmatrix} x \\y\end{pmatrix}
+ \tfrac12 \begin{pmatrix} x & y\end{pmatrix} H_F \begin{pmatrix} x \\y\end{pmatrix}.$$
Similarly, expanding $f(x,y)$ we obtain
$$ f(x,y) = \nabla f(0,0)\begin{pmatrix} x \\y\end{pmatrix}
+ \tfrac12 \begin{pmatrix} x & y\end{pmatrix} H_f \begin{pmatrix} x \\y\end{pmatrix}.$$
In the last step, we need to implement the constraint $F(x,y)=0$. To first order, we have $\nabla F(0,0) \begin{pmatrix} x \\y\end{pmatrix}=0$ and because $\nabla f \parallel \nabla F$, we have that $f(0,0)$ is an extremum. In particular, we have $y=x$ to first order.
To second order, we have 
$$\tfrac12 \begin{pmatrix} x & y\end{pmatrix} H_F \begin{pmatrix} x \\y\end{pmatrix} = \tfrac12 \begin{pmatrix} x & x\end{pmatrix} H_F \begin{pmatrix} x \\x\end{pmatrix} = \frac{3}{2} x^2. $$
In order that $F(x,y)=0$ to second order, we need to compensate this via the first term, so we have $y= x - \frac{3}{2} x^2$.
Plugging this into the expansion of $f(x,y)$, we obtain a term from the gradiant and a term from the Hessian (Tunococ just considered the term from the Hessian). In total, we have
$$f(x,y) = -3 x^2 + 2 x^2 =-x^2.$$
So it is a local maximum.
</s>