I'm trying to find the points on $\displaystyle x^2+8xy+7y^2=225$ which are nearest the origin.

Let:

$\displaystyle D^2=f(x,y)=x^2+y^2$

$\displaystyle g(x,y)=x^2+8xy+7y^2-225=0$

So:

$\displaystyle f_x+\lambda g_x=0\Longrightarrow 2x+\lambda(2x+8y)=0 \Longrightarrow \lambda = -\frac{x}{x+4y}$

$\displaystyle f_y+\lambda g_y=0\Longrightarrow 2y+\lambda(8x+14y)=0 \Longrightarrow \lambda = -\frac{y}{4x+7y}$

Hence:

$\displaystyle \frac{x}{x+4y}=\frac{y}{4x+7y} \Longrightarrow 4x^2+6xy-4y^2=0 \Longrightarrow (x+2y)(2x-y)=0$

Which yields: $\displaystyle x=-2y,y=2x$

Inserting x=-2y into g(x,y) gives imaginary solutions which are ignored.

Inserting y=2x into g(x,y):

$\displaystyle x^2+16x^2+28x^2=225 \Longrightarrow x=\pm \sqrt 5$

So the solutions are $\displaystyle (\sqrt 5, 2\sqrt 5), (-\sqrt 5, -2\sqrt 5)$

The problem is when I look at the graph the solutions seem to be:

$\displaystyle (2\sqrt 5, \sqrt 5), (-2\sqrt 5, -\sqrt 5)$

Any ideas?