<s>[INST] Insights needed for the following Lagrange Multipler problem Find the point of the paraboloid $z = \frac{x^2}{4} + \frac{y^2}{25}$ that is closest to the point $(3, 0, 0)$. 
So this seems like a pretty standard question of Lagrange multiplier, except I ran into some problems but cant figure out where I went wrong.
Attempt:
I maximuse $D^2$ instead of D to remove the square-root
1.) Constraint equation : $\frac{x^2}{4} + \frac{y^2}{25} - z$
2.) $D^2 = (x-3)^2 + y^2 + z^2$
3.) Do the usual Lagrange procedure
4.) $2z = -\lambda \\ 25y = \lambda y \\4(x-3) = \lambda x$
5.) Assume $x \neq 0, y\neq0$, we get $z = -\frac{25}{2}$
6.) This is where I got stuck, how can z be negative where is the sum of 2 positive number?
Which part of my attempt did I commit a mistake, and how do I rectify it?
Any insights and help is deeply appreciated.      
 [/INST] You want to minimize $$F=(x-3)^2+y^2+z^2+\lambda  \left(\frac{x^2}4+\frac{y^2}{25}-z\right)$$ So $$F'_x=\frac{\lambda  x}{2}+2 (x-3)=0$$ $$F'_y=\frac{2 \lambda  y}{25}+2 y=0$$ $$F'_z=2 z-\lambda=0$$ $$F'_\lambda=\frac{x^2}{4}+\frac{y^2}{25}-z=0$$ Eliminating $x,y,z$ from the first derivatives leads to $x=\frac{12}{\lambda +4}$, $y=0$, $z=\frac{\lambda }{2}$.
Plugging these expressions in $F'_\lambda$ leads to $$\frac{36}{(\lambda +4)^2}-\frac{\lambda }{2}=0$$ that is to say $$\lambda ^3+8 \lambda ^2+16 \lambda -72=0$$ $\lambda=2$ is an obvious root by inspection. So,$$\lambda ^3+8 \lambda ^2+16 \lambda -72=(\lambda-2)(\lambda ^2+10 \lambda +36)=0$$ and the quadratic does not show any real solution. 
So, $\lambda=2$, $x=2$, $y=0$, $z=1$ which makes $D^2=2$.
</s>