# Maximize $x^2+2y^2$ subject to $y-x^2+1=0$

Maximize $$x^2+2y^2$$ subject to $$y-x^2+1=0$$

I tried using Lagrange multiplier method. We have:

$$L(x,y)=x^2+2y^2+\lambda(y-x^2+1)$$

So we have:

$$L_x=2x(1-\lambda)=0$$ $$L_y=4y+\lambda=0$$

One possible solution with $$y-x^2+1=0$$ is

$$x=0$$, $$y=-1$$, $$\lambda=4$$

But when we calculate Hessian determinant at $$(0,-1)$$ for this we have:

$$L_{xx}=2-2\lambda=-6 \lt 0$$

$$L_{yy}=4$$ $$L_{xy}=0$$

So $$L_{xx}L_{yy}-L^2_{xy} \lt 0$$

Does it not mean saddle point at $$(0,-1)$$

But it actually maximizes $$x^2+2y^2$$

What am I missing here?

• Consider substituting $x^2=y+1$ so that you are maximizing $y+1+2y^2$ subject to $y + 1 \ge 0$. The left boundary $y=-1$ yields a local maximum, but $\lim_{y->\infty}$ is $\infty$. – Rob Pratt Jan 24 at 4:13
• all of you are telling different approaches, but i am asking why Lagrange method is not working here? why hessian determinant is becoming negative thereof – Ekaveera Kumar Sharma Jan 24 at 4:22
• Also, there are critical points other than $(x,y,\lambda)=(0,-1,4)$. Consider $\lambda=1$. – Rob Pratt Jan 24 at 4:27

As in the answer by amd, you need to construct what is called the Bordered Hessian, which is nothing more that the Hessian when $$\lambda$$ is deliberately included as a new variable. Maybe give it a new name, $$h(\lambda, x,y) = x^2 + 2 y^2 + \lambda (y-x^2 +1)$$ The gradient is the triple $$h_\lambda = y-x^2 + 1, \; \; h_x = 2x - 2 \lambda x, \; \; h_y = 4y + \lambda$$ while the "bordered Hessian" is

$$W = \left( \begin{array}{rrr} 0 & -2x & 1 \\ -2x & 2-2\lambda & 0 \\ 1 & 0 & 4 \\ \end{array} \right)$$

First, at one of the side critical points where $$x \neq 0,$$ we have $$x = \frac{\sqrt 3}{2}, \; \; y = \frac{-1}{4}, \; \; \lambda = 1.$$ Here $$W = \left( \begin{array}{rrr} 0 & -\sqrt 3 & 1 \\ - \sqrt 3 & 0 & 0 \\ 1 & 0 & 4 \\ \end{array} \right)$$ This determinant comes out $$-12$$ and we have a local min of $$x^2 + 2 y^2$$

You were worried about the critical point where $$x = 0, \; \; y = -1, \; \; \lambda = 4.$$ Here $$W = \left( \begin{array}{rrr} 0 & 0 & 1 \\ 0 & -6 & 0 \\ 1 & 0 & 4 \\ \end{array} \right)$$ This determinant comes out $$6$$ and we have a local maximum of $$x^2 + 2 y^2$$

NOTE: as long as there is just one constraint function, this description of the "second derivative test" is good enough, even if we have more than two original variables. That is, we could ask for critical points of $$x^2 + 2 y^2 + 3 z^2$$ constrained to $$z - xy - 7 = 0$$ and do the same steps, in the end calculating just one determinant for each critical point. It does get messier if we have more than one constraint.

We don't need Lagrange's

$$x^2+2y^2=y+1+2y^2=1+\dfrac{(4y+1)^2-1}8\ge1-\dfrac18$$

So, we don't have any upper bound

• That shows a lower bound, not a maximum. – Rob Pratt Jan 24 at 4:32
• @Rob, that's the only bound it has, Right? – lab bhattacharjee Jan 24 at 4:32
• Yes, there is no upper bound, but this lower bound doesn't answer the question, which is about maximization. And there is a tighter lower bound of $7/8$. – Rob Pratt Jan 24 at 4:33
• Recheck your calculations, they are wrong. – Martund Jan 24 at 6:42
• @Martund, Thanks – lab bhattacharjee Jan 24 at 6:45

The second derivative test that you’re using doesn’t apply when you’re trying to find constrained extrema. It is used to determine the nature of a critical point of a function, but the points at which constrained extrema of that function occur aren’t generally critical points of the function: the Lagrange multiplier method requires non vanishing gradients. Now, there is a second derivative test that you can use for constrained optimization problems, but it involves what’s called a bordered Hessian.