Lời giải:
$B=\cos 2x+\sqrt{1+2\sin ^2x}=\cos ^2x-\sin ^2x+\sqrt{1+2\sin ^2x}$
$=1-2\sin ^2x+\sqrt{1+2\sin ^2x}$
Đặt $\sqrt{1+2\sin ^2x}=a$ thì $1\leq a\leq \sqrt{3}$
Cần tìm min, max của $B=1-(a^2-1)+a=-a^2+a+2$
Ta có:
$B=a(1-a)+2\leq 2$ do $a\geq 1$
Vậy $B_{\max}=2$
-------
Tìm min:
$B=-a(a-\sqrt{3})-\sqrt{3}a+a+2$
$=-a(a-\sqrt{3})+(1-\sqrt{3})(a-\sqrt{3})+\sqrt{3}-1$
$=(a-\sqrt{3})(1-\sqrt{3}-a)+\sqrt{3}-1$
$\geq \sqrt{3}-1$ do $1\leq a\leq \sqrt{3}$
Vậy $B_{\min}=\sqrt{3}-1$