How do I integrate this. How can I find the integral of 
$$\int\frac{x+2}{(x^2+2x+2)\sqrt{x+1}} dx $$ 
So that the answer=$\sqrt{2}\tan^{-1}(\frac{x}{\sqrt{2(x+1)}})+c$
 A: After noting that $x^2+2x+2 = (x+1)^2+1$ and $x+2 = x+1+1$ make the change of variable $y = x+1$ and try for yourself. it becomes easier. You can even try $y = \sqrt{x+1}$.
A: First of all, just substitute $u=\sqrt{x+1}$ and $\text{d}u=\frac{1}{2\sqrt{x+1}}\space\text{d}x$, then we get:
$$\text{I}=\int\frac{x+2}{(x^2+2x+2)\sqrt{x+1}}\space\text{d}x=2\int\frac{u^2+1}{u^4+1}\space\text{d}u$$
Now, use partial fractions:
$$\frac{u^2+1}{u^4+1}=\frac{1}{2(u^2+u\sqrt{2}+1)}-\frac{1}{2(u\sqrt{2}-u^2-1)}$$
So, we get:
$$\text{I}=2\int\frac{u^2+1}{u^4+1}\space\text{d}u=\int\frac{1}{u^2+u\sqrt{2}+1}\space\text{d}u-\int\frac{1}{u\sqrt{2}-u^2-1}\space\text{d}u=$$
$$\int\frac{1}{\left(u+\frac{1}{\sqrt{2}}\right)^2+\frac{1}{2}}\space\text{d}u-\int\frac{1}{-\left(u-\frac{1}{\sqrt{2}}\right)^2-\frac{1}{2}}\space\text{d}u$$
Now, for $\int\frac{1}{\left(u+\frac{1}{\sqrt{2}}\right)^2+\frac{1}{2}}\space\text{d}u$, substitute $s=u+\frac{1}{\sqrt{2}}$ and $\text{d}s=\text{d}u$ and for $\int\frac{1}{-\left(u-\frac{1}{\sqrt{2}}\right)^2-\frac{1}{2}}\space\text{d}u$, substitute $w=u-\frac{1}{\sqrt{2}}$ and $\text{d}w=\text{d}u$:
$$\text{I}=2\int\frac{1}{2s^2+1}\space\text{d}s+2\int\frac{1}{2w^2+1}\space\text{d}w$$
