$x^2+y^2=1$, find min/max of $(3x+2y)^2+(x+2y)^2$

Let $$f(x,y)=(3x+2y)^2+(x+2y)^2=10x^2+16xy+8y^2.$$ If $f(x,y)=a$ for some $x$, $y$ on the unit circle then $$f(x,y)-a(x^2+y^2)=0\tag1$$ has nonzero real solutions. But if $(1)$ has a nonzero real solution, one can scale it so that $x^2+y^2=1$, and then $f(x,y)=a$ for that $(x,y)$.

But $$f(x,y)-a(x^2+y^2) =(10-a)x^2+16xy+(8-a)y^2.$$ This has a nonzero real solution iff the discriminant $$16^2-4(10-a)(8-a)\ge0.$$ Solve this inequality for $a$ to get the values of $f$ on the unit circle.


$$y=10\sin^2t+16\sin t\cos t+8\cos^2t$$

Divide both sides by $\cos^2t$ and set $\tan t=a$

$$(1+a^2)y=10a^2+16a+8\iff a^2(10-y)+16a+8-y=0$$ which is a Quadratic Equation in $y$

So, the discriminant must be $\ge0$

$$\implies16^2\ge4(10-y)(8-y)\iff(y-9)^2\le64+1\iff-\sqrt{65}\le y-9\le\sqrt{65}$$


Substituting with trig functions gives, $$y=10\sin^2t + 16\sin t\cos t+8\cos^2t$$ Using the identity $\sin^2x+\cos^2x=1$, it simplifies to $$y=8 + 2\sin^2t + 16\sin t \cos t$$ Use the double-angle formula $\sin{2x}=2\sin x \cos x$ and half-angle formula $\sin^2t = \frac{1-\cos{2t}}{2}$. $$y=9+8\sin 2t-\cos 2t$$

Now, $$y = 9+\sqrt{65}\left(\frac{8}{\sqrt{65}} \sin 2t - \frac{1}{\sqrt{65}} \cos 2t\right)$$ $$y=9+\sqrt{65} \sin{(2t-\alpha)}$$ where $\cos\alpha=8/\sqrt{65}, \sin\alpha=1/\sqrt{65}$

Thus maximum is $9+\sqrt{65}$, minimum is $9-\sqrt{65}$.