The maximum and minimum values of the expression Here is the question:find the difference between maximum and minimum values of $u^2$ where $$u=\sqrt{a^2\cos^2x+b^2\sin^2x} + \sqrt{a^2\sin^2x+b^2\cos^2x}$$

My try:I have just normally squared the expression  and got
$u^2=a^2\cos^2x+b^2\sin^2x + a^2\sin^2x+b^2\cos^2x +2\sqrt{a^2\cos^2x+b^2\sin^2x} \sqrt{a^2\sin^2x+b^2\cos^2x}$ 
$u^2=a^2+b^2 +2\sqrt{a^2\cos^2x+b^2\sin^2x} .\sqrt{a^2\sin^2x+b^2\cos^2x}$ 
I am not getting how to solve the irrational part,so how should we do it.Is there some general way to solve such questions?

Assume WLOG $a > b > 0$, $A = \sqrt{a^2\cos^2x+b^2\sin^2x}, B = \sqrt{a^2\sin^2x+b^2\cos^2x}\Rightarrow A^2+B^2 = a^2+b^2\Rightarrow u^2 = (1\cdot A+1\cdot B)^2\leq (1^2+1^2)(A^2+B^2)=2(a^2+b^2)\Rightarrow u^2_{max} = 2(a^2+b^2)$. To find $u^2_{min}$, you need to find the min of $(a^2\cos^2x+b^2\sin^2x)(a^2\sin^2x+b^2\cos^2x)=f(\cos^2 x)=(a^2-(a^2-b^2)t)(b^2+(a^2-b^2)t), t = \cos^2x, 0 \leq t \leq 1=f(p) = (a^2-p)(b^2+p), p = (a^2-b^2)t, 0 \leq p \leq a^2-b^2\to f(p) = a^2b^2 + (a^2-b^2)p - p^2\Rightarrow f'(p) = a^2-b^2 - 2p=0 \iff p = \dfrac{a^2-b^2}{2}\Rightarrow f\left(\dfrac{a^2-b^2}{2}\right)=\dfrac{(a^2+b^2)^2}{4}$. At end points $p = 0, a^2-b^2, f(0) = a^2b^2, f(a^2-b^2) = a^2b^2$. Thus $u^2_{min} = a^2+b^2 + 2\sqrt{a^2b^2}=(a+b)^2$, since $a^2b^2 \leq \dfrac{(a^2+b^2)^2}{4}$.
