I have a function $f=x^3+xy^2$ and a constraint $xy=z^2$ where $z\in \mathbb R$ that I have to solve using Lagrangian multipliers. This is what I have done so far:
The Lagrangian function is as follows: $L(x,y,z)=x^3+xy^2+\lambda(xy-z^2)$
Calculating the first order derivatives and setting them equal to zero:
(1)$\quad\frac{\partial L}{\partial x}=3x^2+y\lambda+y^2=0$
(2)$\quad\frac{\partial L}{\partial y}=x(2y+\lambda)=0$
(3)$\quad\frac{\partial L}{\partial z}=-2z\lambda=0$
(4)$\quad\frac{\partial L}{\partial \lambda}=xy-z^2=0$
Solving the system of equations:
$\quad$Using (2) I get that $x=0$.
$\quad$Using (4) I get $z=\sqrt{xy}$, which substituting $x=0$ is $z=\sqrt{0\times y}=0$, so $z=0$.
$\quad$Substituting $x=0$ and $z=0$ back into (4) I get that $y=0$.
$\quad$Shifting (2) around, I get that $\lambda=-2y$, and substituting in $y=0$ gets me $\lambda=0$.
So I get that $x=y=z=\lambda=0$. This feels like a strange result to me, could anyone verify that this is correct?
Note that $z$ is a constant, so you don't care about the derivative with respect to $z$. Then: $$3x^2+\lambda y+y^2=0\\x(2y+\lambda)=0\\xy=z^2$$ Let's discuss now the case $z=0$. From the 3rd equation it implies $y=0$ or $x=0$ (or both). If $y=0$, from the first equation you get $x=0$. If $x=0$ you get $y=-\lambda$. This makes sense, since $x=0$ implies $f(x,y)=0$, independent of $y$. So the minimum value of $f(x,y)$ is $0$ for $x=0$ and any $y$.
Now for $z\ne 0$, it means $x\ne 0$ and $y\ne 0$. Then, from the second equation $\lambda=-2y$. Plugging into the first equation you get $$3x^2-y^2=0$$Together with $xy=z^2$ you can now solve for $x$ and $y$.