I am trying to calculate the following integral $$I=\int\dfrac{dx}{x\sqrt{2+x-x^2}}$$
The answer in my textbook is $$-\dfrac{1}{\sqrt2}\ln\bigl|\dfrac{\sqrt{2+x-x^2}+\sqrt2}{x}+\dfrac{1}{2\sqrt2}\bigr|$$
Note that $-x^2+x+2=-(x+1)(x-2)=(2-x)(x+1),$ so the second Euler substitution is applicable. Let $$\sqrt{2+x-x^2}=t(x+1)$$ $$\sqrt{x+1}\sqrt{2-x}=t(x+1)$$ $$\sqrt{2-x}=t\sqrt{x+1} $$ $$2-t^2=x(1+t^2)$$ $$ x=\dfrac{2-t^2}{1+t^2}$$ Now we need $$\sqrt{2+x-x^2}=\dfrac{3t}{1+t^2}$$ and $$dx=\dfrac{-6t}{(1+t^2)^2}dt$$
So $$I=\int\dfrac{\frac{-6t}{(1+t^2)^2}dt}{\frac{2-t^2}{1+t^2}\cdot\frac{3t}{1+t^2}}=-2\int\dfrac{dt}{2-t^2}$$
Well, I don't see where my mistake is, but integrating the function $\dfrac{1}{(2-t^2)^2}$ won't be fun, even though it is rational.
So what am I missing, why does this problem become so technically diffucult, and what else should I try? Thanks!
The substitution you used is called Euler's third not second and i say mainly from personal preference it usually gives nasty rational functions
Using the actual Euler's second substitution
$$ \sqrt{2+x-x^2}=xt+\sqrt{2}\\ \ \\ x={1-2t\sqrt{2}\over1+t^2},\quad\sqrt{2+x-x^2}={-\sqrt{2}t^2+t+\sqrt{2}\over t^2+1}\\ \ \\ \mathrm dx={2\sqrt{2}t^2-2t-2\sqrt{2}\over(t^2+1)^2}\mathrm dt $$
Now the integration becomes
$$ \begin{align} I&=\int\frac{\mathrm dx}{x\sqrt{2+x-x^2}}=\int{{2\sqrt{2}t^2-2t-2\sqrt{2}\over(t^2+1)^2}\mathrm dt\over\left({1-2t\sqrt{2}\over1+t^2}\right)\left({-\sqrt{2}t^2+t+\sqrt{2}\over t^2+1}\right)}\\ &=\int{-2\over1-2\sqrt{2}t}\mathrm dt={1\over\sqrt{2}}\ln|2t\sqrt{2}-1|+C \end{align} $$