<s>[INST] Compute definite integral Question: Compute 
$$\int_0^1 \frac{\sqrt{x-x^2}}{x+2}dx.$$
Attempt: I've tried various substitutions with no success. Looked for a possible contour integration by converting this into a rational function of $\sin\theta$ and $\cos \theta$.
 [/INST] Let us make the problem a bit more general considering $$I=\int \frac{\sqrt{x-x^2}}{x+a}dx$$ and let us apply the same approach Mario G proposed. We then arrive to $$\begin{align*}
I=\int\frac{\sqrt{x-x^2}}{x+2}dx
&=\frac{1}{2}\int\frac{\cos^2( t)}{\sin t+(2a+1)}\,dt\\
\end{align*}$$ Now, let use the tangent half-angle substitution $y=\tan(\frac t2)$
$$I=\int\frac{ \left(y^2-1\right)^2}{\left(y^2+1\right)^2 \left((2 a+1) y^2+2
   y+(2 a+1)\right)}\,dy$$ Now, partial fraction decomposition which gives for the integrand $$\frac{2 a+1}{y^2+1}-\frac{2
   y}{\left(y^2+1\right)^2}-\frac{4 a\left(a+1\right)}{(2 a+1)y^2+2y+(2 a+1) }$$
Integrating the different species, we then arrive to $$I=(2 a+1) \tan ^{-1}(y)+\frac{1}{y^2+1}-2 \sqrt{a(a+1)} \tan ^{-1}\left(\frac{(2 a+1) y+1}{2 \sqrt{a(a+1)}}\right)$$
</s>