<s>[INST] Finding minimum of trigonometric function Let $$v=\sqrt{a^2\cos^2(x)+b^2\sin^2(x)}+\sqrt{b^2\cos^2(x)+a^2\sin^2(x)}$$
Then find difference between maximum and minimum of $v^2$.
I understand both of them are distance of a point on ellipse from origin, but how do we find maximum and minimum?
I tried guessing, and got maximum $v$ when $x=45^{o}$ and minimum when $x=0$, but how do we justify this?
 [/INST] Let $v=\sqrt{a^2\cos^2(x)+b^2\sin^2(x)}+\sqrt{b^2\cos^2(x)+a^2\sin^2(x)}$
$v^2=a^2+b^2+2\sqrt{\left(a^2\cos^2(x)+b^2\sin^2(x)\right)\left(b^2\cos^2(x)+a^2\sin^2(x)\right)}$
$v^2=a^2+b^2+2\sqrt{a^2b^2\left(\cos^4(x)+\sin^4(x)\right)+\left(a^4+b^4\right)\cos^2(x)\sin^2(x)}$
$v^2=a^2+b^2+\sqrt{4a^2b^2\left(1-2\sin^2(x)\cos^2(x)\right)+\left(a^4+b^4\right)\sin^2(2x)}$
$v^2=a^2+b^2+\sqrt{4a^2b^2-2a^2b^2\sin^2(2x)+\left(a^4+b^4\right)\sin^2(2x)}$
$v^2=|a|^2+|b|^2+\sqrt{4a^2b^2+\left(a^2-b^2\right)^2\sin^2(2x)}$
To find minimumvalue of $v^2$ 
put $\sin^2(2x)=0$ 
to obtain $v^2=\left(|a|+|b|\right)^2$. So 
$v_{min}=|a|+|b|$
And to obtain maximum value of $v^2$ put $\sin^2(2x)=1$
$v_{max}=\sqrt{2(a^2+b^2)}$
</s>