I am practising some old exams for my calculus class, and got stuck on a Lagrange problem I can't seem to figure out entirely.
I have a function $f(x,y) = 2x^2-x^4+y^2$ and the question is to find the maxima and minima of $f$ on the curve $x^4+y^2=4$
My general approach is to use the method of Lagrange multipliers $\nabla f(x,y) = \lambda \nabla g(x,y)$ and $g(x,y) = 0$
My approach:
$g(x,y) = x^4+y^2-4$
$$\nabla f = [4x-4x^3, 2y]$$ $$\nabla g = [4x^3, 2y]$$
From this I obtain the following equations:
1) $$4x-4x^3 = \lambda4x^3$$ 2) $$2y = 2\lambda y$$ 3) $$x^4+y^2-4=0$$
I solve 2) first to obtain that $\lambda = 1$. Plugging this into 1) I obtain that $4x-4x^3=4x^3$, which means $x=0$ or $x=\pm \frac{1}{\sqrt{2}}$.
Moving forward I plug my $x$ value into my restrictive boundary $g(x,y) = x^4+y^2-4$. When $x=0$ I obtain $y=\pm 2$. When $x=\frac{1}{\sqrt{2}}$ I obtain $y=\pm \frac{\sqrt{15}}{2}$. When $x=-\frac{1}{\sqrt{2}}$, I obtain the same; $y=\pm \frac{\sqrt{15}}{2}$.
In the end I am left with the following points to evaluate: $$f(0, 2)$$ $$f(0, -2)$$
$$f(\frac{1}{\sqrt{2}}, \frac{\sqrt{15}}{2})$$ $$f(\frac{1}{\sqrt{2}}, \frac{-\sqrt{15}}{2})$$ $$f(-\frac{1}{\sqrt{2}}, \frac{\sqrt{15}}{2})$$ $$f(-\frac{1}{\sqrt{2}}, -\frac{\sqrt{15}}{2})$$
My issue is that the first two points evaluate to $4$ where as the last 4 points all evaluate to $\frac{9}{2}$. The maximum being $\frac{9}{2}$ is apparently correct, but my minima is supposed to be $0$, not $4$ as my calculations would suggest. I would greatly appreciate if someone were to point out my mistake and correct it. Thank you!
(PS: The solution I have access to uses this method in a slightly different way that I am not familiar with, I'm hoping the method I've used still holds and I've just screwed up somewhere. There's also a more elegant solution to this problem (as usual when it comes to Lagrange problems), but I'm more interested in learning the brute force method than hoping to come up with something creative during the exam which isn't likely). Thank you!
This problem can be easily handled by doing the transformations
$$ u = x^2\\ v = y^2 $$
and then the lagrangian reads
$$ L(u,v,\lambda_i, \epsilon_j) = 2u-u^2+v+\lambda_1(u^2+v-4)+\lambda_2(u-\epsilon_1^2)+\lambda_3(v-\epsilon_2^2) $$
The stationary points are then the solutions for
$$ \left\{ \begin{array}{rcl} 2 + \lambda_2 - 2 u + 2 \lambda_1 u & = & 0\\ 1 + \lambda_1 + \lambda_3 & = & 0\\ -4 + u^2 + v & = & 0\\ -\epsilon_1^2 + u & = & 0\\ -\epsilon_2^2 + v & = & 0\\ \epsilon_1 \lambda_2 & = & 0\\ \epsilon_2 \lambda_3 & = & 0 \end{array} \right. $$
Solving we get the solution which give the minimum value
$$ u = 2, v = 0 \Rightarrow x = \sqrt2, y = 0 $$