I have this integral. $$\int \frac{1}{{1-2x-x^2}} \, \mathrm{d}x $$ But I am unable to do it right and I just don't know where is the problem in my steps.
My steps:
Complete the square $$\int \frac{1}{{2-(x+1)^2}} \, \mathrm{d}x $$ $$\frac{1}{2}*\int \frac{1}{{-(x+1)^2}} \, \mathrm{d}x $$ Substitute $$t=x+1$$ $$\frac{1}{2}*\int \frac{1}{{-t^2}} \, \mathrm{d}x $$ $$\frac{1}{2}*\int {{-t^{-2}}} \, \mathrm{d}x $$ $$\frac{1}{2}* \frac{-t^{{-1}}}{{-1}}+c $$ $$ \frac{1}{{2(x+1)}}+c $$
But the result is different. I will be thankful for any help.
Hint:
$$1-2x-x^2$$ factors as
$$-(x-a)(x-b)$$ where
$$a,b=1\pm\sqrt2.$$
Then you can decompose
$$\frac{b-a}{(x-a)(x-b)}=\frac1{x-b}-\frac1{x-a}$$ and integrate
$$\log|x-b|-\log|x-a|.$$