TITLE: Range of quadratic function using discriminant
QUESTION [5 upvotes]: Let $x^2-2xy-3y^2=4$. Then find the range of $2x^2-2xy+y^2$.

Let $2x^2-2xy+y^2=a$.
Then $ax^2-2axy-3ay^2=4a=8x^2-8xy+4y^2\implies (a-8)x^2-(2a-8)xy-(3a+4)y^2=0$.
We divide both side by $y^2$ and let $t=\frac{x}{y}$.
Then it implies $(a-8)t^2-(2a-8)t-(3a+4)=0$.
Since its discriminant is not negative, $\frac{\Delta}{4}\ge 0\implies a^2-7a-4\ge 0$. It gives us $a$ can have negative values like $-1$. But if clearly contracts $a-4=x^2+4y^2\ge 0\implies a\ge 4$. Where did I mistake?

REPLY [3 votes]: Others have pointed out where you went wrong. I just want to provide an alternative proof.
$$x^2-2xy-3y^2=4=(x+y)(x-3y)$$
Denote $z=x+y, w=x-3y$, then $zw=4, x=(3z+w)/4, y=(z-w)/4$.
We want to find the range of $$2x^2-2xy+y^2=\frac{1}{16} (5w^2+14wz+13z^2)=\frac 72+\frac{1}{16} (5w^2+13z^2) \tag 1$$ under the constraint $zw=4$.
Clearly $(1)$ can be as large as you want. And if you apply AM-GM you get the minimum
$$\frac 72+\frac{1}{16} (5w^2+13z^2) \ge \frac 72 + \frac{1}{16} 2 \sqrt{5} \sqrt{13}|wz|=\frac{7+\sqrt{65}}{2}$$