Evaluate the following integrals:
$\int \frac{\sin 2 x}{\sqrt{\cos ^{4} x-\sin ^{2} x+2}} d x$
Let $t=\cos ^{2} x$
$d t=2 \cos x \sin x d x=-\sin 2 x d x$
therefore, $\int \frac{\sin 2 x}{\sqrt{\cos ^{4} x-\sin ^{2} x+2}} d x=\int-\frac{d t}{\sqrt{t^{2}-\left(1-t^{2}\right)+2}}$
since, $\left[\sin ^{2} x=1-\cos ^{2} x\right]$
$\int-\frac{d t}{\sqrt{t^{2}-\left(1-t^{2}\right)+2}}=\int-\frac{d t}{\sqrt{t^{2}+t+1}}=\int-\frac{d t}{\sqrt{t^{2}+t+\frac{1}{4}+\frac{3}{4}}}$
$=\int-\frac{d t}{\sqrt{\left(t+\frac{1}{2}\right)^{2}+\frac{3}{4}}}$
Since, $\int \frac{1}{\sqrt{\left(x^{2}-a^{2}\right)}} d x=\log \left[x+\sqrt{\left(x^{2}-a^{2}\right)}\right]+c$
$=\int-\frac{\mathrm{dt}}{\sqrt{\left(\mathrm{t}+\frac{1}{2}\right)^{2}+\frac{3}{4}}}=\log \left[\mathrm{t}+\frac{1}{2}+\sqrt{\left(\mathrm{t}+\frac{1}{2}\right)^{2}-\left(\frac{\sqrt{3}}{2}\right)^{2}}+\mathrm{c}\right.$
$=\log \left[t+\frac{1}{2}+\sqrt{t^{2}}+t+1+c=\log \left[\cos ^{2} x+\frac{1}{2}+\right.\right.$
$\sqrt{\cos ^{4} x+\cos ^{2} x+1}+c$