Find the minimum and maximum distances between the ellipse $x^2 + xy + 2y^2 = 1$ and the origin. I know that I'm trying to maximize/minimize $f(x,y)=x^2+y^2$ with the constraint $g(x,y)=x^2+xy+2y^2-1=0$
Here are the partial derivates:
$f_x=2x \qquad$
$f_y=2y \qquad$ 
$g_x=(2x+y)\lambda \qquad$
$g_y=(4y+x)\lambda$
Setting them up to solve:
$\frac{2x}{2y} = \frac{(2x+y)\lambda}{(4y+x)\lambda}$
Cancel $2$ on the left side and $\lambda$ on the right side and I get:
$\frac{x}{y} = \frac{(2x+y)}{(4y+x)}$
I am unable to solve further.
The book says that the answers are min: $0.6731$ and max: $1.1230$
Any help would be appreciated. Thanks!
 A: Let $$d=\sqrt{x^2+y^2}$$
$$f(x,y)=x^2+y^2$$
$$g(x,y)=x^2+xy+2y^2-1=0$$
Using Lagrange Multiplier
$$\frac{2x}{2x+y}=\frac{2y}{x+4y}=k$$
$$x(x+4y)=y(2x+y)$$$$\implies x^2+4xy=y^2+2xy$$
$$\implies x^2+2xy+y^2=y^2+y^2$$
$$\implies(x+y)^2=2y^2$$
$$x=y(-1\pm\sqrt2)$$
Note : I've added following part due to OP's unwillingness towards accepting answer
After solving we get solutions as
$$(1.04,-0.43),(0.26,0.62),(-1.04,0.43),(-0.26,-0.62)$$
And As your book says we get following values

$$d_{min}\approx0.672$$$$d_{max}\approx1.125$$

Here's image showing suck condition

A: At first, you can set \
$x = r \cos(\theta) $ and $ y = r \sin(\theta)$ with $r >= 0 , \theta \in [-2\pi,2\pi]$.
Therefor $0 = x^{2} + x y + 2 y^{2} -1 = r^2 (\cos(\theta)^2 + \sin(\theta) * \cos(\theta) + 2 \sin(\theta) - 1 $, from which we obtain that as following:
$r^2 = \frac{1}{\cos(\theta)^2 + \sin(\theta) * \cos(\theta) + 2 \sin(\theta)^{2} - 1} = \frac{1}{1+\sin(\theta) * \cos(\theta) + \sin(\theta)^2 } \triangleq h(\theta)$.
look at the picture of $h(\theta)$.

And you will get the answers.
