<s>[INST] If $u=\sqrt {a\cos^{2}x+b\sin^{2}x} + \sqrt {b\cos^{2}x+a\sin^{2}x}$ , find the maximum and minimum value of $u^2$. 
If $u=\sqrt {a\cos^{2}x+b\sin^{2}x} + \sqrt {b\cos^{2}x+a\sin^{2}x}$ , find the maximum and minimum value of $u^2$.

This problem was bothering me for a while. The minimum value of $u $ seemed relatively easy to find by using AM-GM followed by Cauchy-Schwarz but both equalities don't hold simultaneously. It seems a bit tempting to assume that the maximum occurs at $x= {\pi/4}$ but I couldn't find a proof to the conjecture. Would someone please help me to find the maximum and minimum with a short relevant proof?
Note: I discovered that the function $u $ is periodic  with period ${\pi/2} $.
 [/INST] $u=\sqrt {a\cos^{2}x+b\sin^{2}x} + \sqrt {b\cos^{2}x+a\sin^{2}x}$
Let 
$p = a \cos^2 x + b \sin^2 x$
$q = b \cos^2 x + a \sin^2 x$
and 
$u = \sqrt{p} + \sqrt{q}$
Then $u^2 = p + q + 2 \sqrt{pq}$
Now
$p + q = a + b$
and
$\displaystyle pq = \frac{(a+b)^2}{4} - \frac{(a-b)^2}{8} - \frac{(a-b)^2}{8} \cos 4x$
If $\cos 4x = -1$ then $u^2$ is maximum and is equal to 
$2(a+b)$
If $\cos 4x = 1$ then $u^2$ is minimum and is equal to 
$a+b + 2 \sqrt{ab}$
Please check the calculations.
</s>