Find the Minimum Value of $x^2+y^2$ Given:
$x+y=2\sin{a}-\cos{b}\\
xy=2\cos{a}+\sin{b}$
Find the minimum value of $x^2+y^2$.
Attempt:
$\begin{aligned}
x^2+y^2&=(x+y)^2-2xy\\
&=(2\sin{a}-\cos{b})^2-2(2\cos{a}+\sin{b})\\
&=4\sin^2{a}-4\sin{a}\cos{b}+\cos^2{b}-4\cos{a}-2\sin{b}
\end{aligned}$
$\begin{aligned}
f_{a}(a,b)&=0\\
8\sin{a}\cos{a}-4\cos{a}\cos{b}+4\sin{a}&=0\\
\cos{a}\cos{b}&=2\sin{a}\sin{b}+\sin{a}\\
\end{aligned}$
$\begin{aligned}
f_{b}(a,b)&=0\\
4\sin{a}\sin{b}-2\sin{b}\cos{b}-2\cos{b}&=0\\
2\sin{a}\sin{b}&=\sin{b}\cos{b}+\cos{b}\\
\end{aligned}$
Tried to plot it on a graph, the answer should be -6.


It looks ugly, but fortunately, the $a$ terms can be isolated from both equations:
$$\tan a = \frac{\cos b}{2\sin b +1}$$
$$\sin a = \frac{\cos b(1+\sin b)}{2\sin b}$$
One of the options is to use $1+\tan^{-2} a = \sin^{-2} a$ to get an equation for $b$ where you can use $u=\sin b$ to make it a polynomial equation. However, you must be careful about cases where some of the terms are zero, for example if $\tan a=0$, you can't use $\tan^{-1}a $. It turns out that $a=0$ and $a=\pi$ allow you to find a few solutions directly. It these cases, both expressions above must be zero, so $\cos b=0$ is required (which gives you the solutions
$$a=0, b=\pm \tfrac{\pi}{2}$$
$$a=\pi, b=\pm \tfrac{\pi}{2}$$
Computing the values (and maybe checking second derivatives) shows you what these are. $a=0, b=+\tfrac{\pi}{2}$ turns out to be the global minimum, but to be sure, you should check the full polynomial equation that you get with full reconstruction for other, non-special values of $a$ and $b$.
Hint: it's a periodic function of $a$ and $b$, just plot it from $-\pi$ to $\pi$ in both directions.
