<s>[INST] $\int \frac{x^2+4x+4}{(x^2+5x+7)\sqrt{x+2} } dx$ The question is to evaluate $$\int \frac{x^2+4x+4}{(x^2+5x+7)\sqrt{x+2} } dx$$
I tried rewriting the integral as $$\int \frac{dx}{\sqrt{x+2}} - \int\frac{x+3}{(x^2+5x+7)\sqrt{x+2}} dx$$ the first integral is simply $2\sqrt{x+2}$.I tried using Integration by parts on second integral but it got complicated.Any ideas?
 [/INST] Hint:
With substitution $x+2=u^2$ we have
$$\int \frac{x^2+4x+4}{(x^2+5x+7)\sqrt{x+2} } dx=2\int\dfrac{u^4}{u^4+u^2+1}du=2u-2\int\dfrac{u^2+1}{u^4+u^2+1}du$$
for the second write denominator as 
$$u^4+u^2+1=(u^2+\dfrac12)^2+(\dfrac{\sqrt{3}}{2})^2=\left(u^2+\dfrac{1+i\sqrt{3}}{2}\right)\left(u^2+\dfrac{1-i\sqrt{3}}{2}\right)$$
and use fractions decomposition.
</s>