Another messy integral: $I=\int \frac{\sqrt{2-x-x^2}}{x^2}\ dx$ I found the following question in a practice book of integration:-
$Q.$ Evaluate $$I=\int \frac{\sqrt{2-x-x^2}}{x^2}\ dx$$ For this I substituted $t^2=\frac {2-x-x^2}{x^2}\implies x^2=\frac{2-x}{1+t^2}\implies 2t\ dt=\left(-\frac4{x^3}+\frac 1{x^2}\right)\ dx$. Therefore $$\begin{align}I&=\int\frac {\sqrt{2-x-x^2}}{x^2}\ dx\\&=\int \left(\frac tx\right)\left(\frac{2t\ dt}{-\frac4{x^3}+\frac 1{x^2}}\right)\\&=\int \frac{2t^2\ dt}{\frac{x-4}{x^2}}\\&=\int \frac{2t^2(1+t^2)\ dt}{{x-4}\over{2-x}}\\&=\int \frac{2t^2(1+t^2)(5+4t^2-\sqrt{8t^2+9})\ dt}{\sqrt{8t^2+9}-(8t^2+9)}\end{align}$$ Now I substituted $8t^2+9=z^2 \implies t^2=\frac {z^2-9}8 \implies 2t\ dt=z/4\ dz$. So, after some simplification, you get $$\begin{align}I&=-\frac1{512}\int (z^2-9)(z+1)(z-1)^2\ dz\end{align}$$ I didn't have the patience to solve this integration after all these substitutions knowing that it can be done (I think I have made a mistake somewhere but I can't find it. There has to be an $ln(...)$ term, I believe). Is there an easier way to do this integral, something that would also strike the mind quickly? I have already tried the Euler substitutions but that is also messy.
 A: Let $$\displaystyle I = \int \frac{\sqrt{2-x-x^2}}{x^2}dx = \int\frac{\sqrt{(x+2)(1-x)}}{x^2}dx$$
Now Let $\displaystyle (x+2) = (1-x)t^2\;,$ Then $\displaystyle x = \frac{t^2-2}{t^2+1} = 1-\frac{3}{t^2+1}$
So $$\displaystyle dx = \frac{6t}{(t^2+1)^2}dt$$ and $$\displaystyle (1-x) = \frac{3}{t^2+1}$$
So Integral $$\displaystyle I = 18\int\frac{t^2}{(t^2+1)\cdot (t^2-2)^2}dt = 6\int\frac{(t^2+1)-(t^2-2)}{(t^2+1)\cdot (t^2-2)^2}dt$$
so we get $$\displaystyle I = 6\int\frac{1}{(t^2-2)^2}dt-6\int\frac{1}{(t^2+1)(t^2-2)}dt$$
A: Hint: $\sqrt{2-x-x^2}=\sqrt{\frac94-(x+\frac12)^2}$ 
Substitute $x+\frac12=t; dx=dt$ 
$$\int \frac{\sqrt{\frac94-t^2}}{(t-\frac12)^2}\ dt$$
Put $\frac32\sin\theta=t;\frac32\cos\theta d\theta=dt$
$$\int \frac{\frac32\cos\theta.\frac32\cos\theta d\theta}{(\frac32\sin\theta-\frac12)^2}$$
$$9\int \frac{\cos^2\theta d\theta}{(9\sin^2\theta+1-6\sin \theta)}$$
Now do $u=\tan\frac{\theta}2;du=\frac12\sec^2{\frac{\theta}2}d\theta$
$$\boxed{\sin\theta=\frac{2u}{1+u^2};\cos\theta=\frac{1-u^2}{1+u^2};d\theta=\frac{2du}{u^2+1}}$$
I guess you can take it from here?
A: Let $$\displaystyle I = \int \frac{\sqrt{2-x-x^2}}{x^2}dx = \int \sqrt{2-x-x^2}\cdot \frac{1}{x^2}dx\;, $$ Now Using Integration by parts
$$\displaystyle I = -\frac{\sqrt{2-x-x^2}}{x}-\int\frac{1+2x}{2\sqrt{2-x-x^2}}\cdot \frac{1}{x}dx $$
So $$\displaystyle I = -\frac{\sqrt{2-x-x^2}}{x}-\underbrace{\int\frac{1}{\sqrt{2-x-x^2}}dx}_{J}-\underbrace{\int\frac{1}{x\sqrt{2-x-x^2}}dx}_{K}$$
So for Calculation of $$\displaystyle J = \int\frac{1}{\sqrt{2-x-x^2}}dx = \int\frac{1}{\sqrt{\left(\frac{3}{2}\right)^2-\left(\frac{2x+1}{2}\right)^2}}dx$$
Now Let $\displaystyle \left(\frac{2x+1}{2}\right)=\frac{3}{2}\sin \phi\;,$ Then $\displaystyle dx = \frac{3}{2}\cos \phi d\phi$
So we get $$\displaystyle J = \int 1d\phi = \phi+\mathcal{C_{1}} = \sin^{-1}\left(\frac{2x+1}{3}\right)+\mathcal{C}$$
Similarly for calculation of $$\displaystyle K = \int \frac{1}{x\sqrt{2-x-x^2}}dx$$
Put $\displaystyle x=\frac{1}{u}$ and $\displaystyle dx = -\frac{1}{u^2}dt$
So we get $$\displaystyle K = -\int\frac{1}{\sqrt{2u^2-u-1}}du = -\frac{1}{\sqrt{2}}\int\frac{1}{\sqrt{\left(u-\frac{1}{4}\right)^2-\left(\frac{3}{4}\right)^2}}dx$$
So we get $$\displaystyle J = -\frac{\sqrt{2}}{3}\ln\left|\left(u-\frac{1}{4}\right)+\sqrt{\left(u-\frac{1}{4}\right)^2-\left(\frac{3}{4}\right)^2}\right|+\mathcal{C_{2}}$$
So we get $$\displaystyle J = -\frac{\sqrt{2}}{3}\ln\left|\left(\frac{1}{x}-\frac{1}{4}\right)+\sqrt{\left(\frac{1}{x}-\frac{1}{4}\right)^2-\left(\frac{3}{4}\right)^2}\right|+\mathcal{C_{2}}$$
So $$\displaystyle I = -\frac{\sqrt{2-x-x^2}}{x}-\sin^{-1}\left(\frac{2x+1}{3}\right)+\frac{\sqrt{2}}{3}\ln\left|\left(\frac{1}{x}-\frac{1}{4}\right)+\sqrt{\left(\frac{1}{x}-\frac{1}{4}\right)^2-\left(\frac{3}{4}\right)^2}\right|+\mathcal{C}$$
A: use so so-called Euler substitution and set $$\sqrt{2-x-x^2}=xt+\sqrt{2}$$
