maximum and minimum value of $\frac{x^2+y^2}{x^2+xy+4y^2}$

$K=\frac{1+t^2}{1+t+4t^2}$ To find min and max, set $K'(t)=0$ or $t^2-6t-1=0$ and solve for $t$. Answer $t=3\pm \sqrt{10}$ leading to max and min $K=\frac{20\pm 6\sqrt{10}}{80\pm 25\sqrt{10}}$. or $1.088303688022443$ and $0.245029645310883$

Corrected (stupid error in solving quadratic).


Let $v = (x,y)$, $$ A = \begin{bmatrix} 1 & \frac{1}{2} \\ \frac{1}{2} & 4 \end{bmatrix} $$ and define the Rayleigh cuocient. $$ R_A(v) = \frac{v^T A v}{v^Tv}. $$ Then, it is clear that $$ \frac{x^2+y^2}{x^2+xy+4y^2} = \frac{1}{R_A(v)}. $$ It is well-known (Linear Algebra result) that $\operatorname{min}_{v \neq 0} R_A(v) = \lambda_{\operatorname{min}}$ and $\operatorname{max}_{v \neq 0} R_A(v) = \lambda_{\operatorname{max}}$, where $\lambda_{\operatorname{min}}$ and $\lambda_{\operatorname{max}}$ are the smallest and largest eigenvalues of $A$, respectively.

In this case $\lambda_{\operatorname{min}} = \frac{1}{2} \left(5-\sqrt{10}\right)$ and $\lambda_{\operatorname{max}} = \frac{1}{2} \left(5+\sqrt{10}\right)$. Therefore, $$ \min_{x,y\neq 0} \frac{x^2+y^2}{x^2+xy+4y^2} = \frac{1}{\max_{v\neq 0} R_A(v)} = \frac{1}{\frac{1}{2} \left(5+\sqrt{10}\right)} = \frac{2}{15}(5+\sqrt{10}) $$ and $$ \max_{x,y\neq 0} \frac{x^2+y^2}{x^2+xy+4y^2} = \frac{1}{\min_{v\neq 0} R_A(v)} = \frac{1}{\frac{1}{2} \left(5-\sqrt{10}\right)} = \frac{2}{15}(5-\sqrt{10}). $$