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?

We can restrict to $x\in[0,\pi/2]$, because of symmetries.
The maximum and minimum of $v$ are attained at the same values as the maximum and minimum of $v^2$:
$$
v^2=a^2+b^2+
2\sqrt{(a^2\cos^2(x)+b^2\sin^2(x))(b^2\cos^2(x)+a^2\sin^2(x))}
$$
We can also remove $a^2+b^2$, then the factor $2$ and square again, so we reduce to finding the maximum and minimum of
$$
f(x)=(a^2\cos^2(x)+b^2\sin^2(x))(b^2\cos^2(x)+a^2\sin^2(x))
$$
If we set $t=\cos^2x$, we want to look at
$$
g(t)=((a^2-b^2)t+b^2)((b^2-a^2)t+a^2)
$$
subject to $0\le t\le 1$.
If $a^2=b^2$, the function is constant, so it's not restrictive to assume $a^2\ne b^2$. The (global) function $g$ assumes its maximum at the middle point between its zeros:
$$
\frac{1}{2}\left(\frac{b^2}{b^2-a^2}+\frac{a^2}{a^2-b^2}\right)=\frac{1}{2}
$$
which is in $[0,1]$ so it's our required maximum.
The minimum is either at $0$ or $1$ (the graph of $g$ is a parabola): since $g(0)=a^2b^2=g(1)$, we can choose either one.
Thus we have a maximum for $t=1/2$, which corresponds to $x=\pi/4$, and a minimum at $x=0$ (or $x=\pi/2$).
We have
$$
v(\pi/4)=2\sqrt{\frac{1}{2}(a^2+b^2)}
$$
and
$$
v(0)=v(\pi/2)=|a|+|b|
$$
