Compute difficult integral $\int \frac{dx}{2 + x + \sqrt{1 - x^2}}$ To solve the integral
$$I = \int \frac{dx}{2 + x + \sqrt{1 - x^2}}$$
I have tried several things, such as $t = \arcsin x$, because $\cos(\arcsin x) = \sqrt{1 - x^2}$. If I am not wrong, we can conclude with this variable change
$$
I = \int \frac{\cos t\,dt}{2 + \sin t + \cos t}
$$
but if it were correct, how could I go on?

Bioche's rules say you should set  $\;u=\tan \frac t2,\enspace \mathrm du=\frac12(1+u^2)\,\mathrm dt$, whence the integral of a rational function
$$\int\frac{2(1-u^2)\,\mathrm du}{(1+u^2)(u^2+2u+3)},$$
which is easily calculated using partial fractions decomposition.
Some more details: using the half angle formulæ, we get
\begin{align}
\frac{\cos t}{2 + \sin t + \cos t}\,\mathrm dt&=\frac{\cfrac{1-u^2}{1+u^2}}{2+\cfrac{2u}{1+u^2}+\cfrac{1-u^2}{1+u^2}}\,\frac{2\,\mathrm du}{1+u^2} \\
&=\frac{2(1-u^2)}{(1+u^2)\bigl(2(1+u^2)+2u+1-u^2\bigr)} \\
&=\frac{2(1-u^2)}{(1+u^2)\bigl(u^2+2u+3\bigr)}. \\
\end{align}
