I would substitute $$t=\sqrt{\frac{x+2}{x+1}}$$ then we get
$$x=\frac{2-t^2}{t^2-1}$$
so $$dx=-2\,{\frac {t}{ \left( t-1 \right) ^{2} \left( t+1 \right) ^{2}}}dt$$
By the quotient rule we get
$$dx=\frac{-2t(t^2-1)-(2-t^2)2t}{(t^2-1)^2}dt$$
First I got $$-\int\frac{4+2t^{2}}{\left ( t^{2}-3 \right )\left ( t^{2}-1 \right )} $$ and when I did partial fractions I got $$-\int \frac{5}{t^{2}-3}dt$$ and $$ \int \frac{3}{t^{2}-1}dt$$. Is it correct?