<s>[INST] Evaluate $ \int_{-2}^{1}\sqrt{\frac{\left ( 1-x \right )\left ( x+2 \right )^2}{x+3}}\,dx$ I want to evaluate the integral:
$$\int_{-2}^{1}\sqrt{\frac{\left ( 1-x \right )\left ( x+2 \right )^2}{x+3}}\,dx$$
but I have no clue of how to start in order to attack it.
I cannot even split that root because it does not make sense otherwise.
Any hints on how to begin?
Edit: Typos were corrected...
 [/INST] Hint:
Notice that
$$\int_{-2}^{1}\sqrt{\frac{\left ( 1-x \right )\left ( x+2 \right )^2}{x+3}}\,dx = \int_{-2}^{1} (x+2)\sqrt{\frac{1-x}{x+3}}\,dx, \text{because $ x\geq -2$}.$$
Take $t^2 = \frac{1-x}{x+3} \implies x= \frac{1-3t^2}{t^2+1}\implies dx = \frac{-8t}{(t^2+1)^2}\,dt.$
Hence,
$$\int_{-2}^{1}\sqrt{\frac{\left ( 1-x \right )\left ( x+2 \right )^2}{x+3}}\,dx = 8\int_{0}^{\sqrt{3}}\frac{(3-t^2)t^2}{(t^2+1)^3}\,dt.$$
Now, let $f(t) = t^3$ and $g(t) = (t^2+1)^2$. Notice that
$$\frac{(3-t^2)t^2}{(t^2+1)^3} = \frac{f'(t)g(t) - f(t)g'(t)}{g(t)^2}.$$
I think you can finish now!
</s>