Integrate $ \int\frac{1+x^2}{(1-x^2)(\sqrt{1+x^4})}dx $ $$ \int\frac{1+x^2}{(1-x^2)(\sqrt{1+x^4})}dx $$
I thought of substituting $ x-\frac{1}{x}  $ as $t$ but it gets stuck midway. I am close but I think I need to sustitute something else here.
 A: Let $$I = \int\frac{(1+x^2)}{(1-x^2)\sqrt{1+x^4}}dx = -\int\frac{(1+x^2)}{x^2(x-\frac{1}{x})\sqrt{x^2+\frac{1}{x^2}}}dx$$
So $$I = -\int\frac{1+\frac{1}{x^2}}{(x-\frac{1}{x})\sqrt{(x-\frac{1}{x})^2+2}}dx$$
Now Put $\displaystyle x-\frac{1}{x} = t\;,$ Then $\displaystyle \left(1+\frac{1}{x^2}\right)dx = dt$
So $$I = -\int\frac{1}{t\sqrt{t^2+2}}dt$$
Now Put $t = \sqrt{2}\tan \theta\;,$ Then $dt=\sqrt{2}\sec^2 \theta d\theta$
So $$I = -\int\frac{\sqrt{2}\sec^2 \theta}{2\tan \theta \sec \theta}d\theta = -\frac{1}{\sqrt{2}}\int\csc \theta d \theta$$
So $$I = \ln \left|\csc \theta +\cot \theta\right|+\mathcal{C}=\frac{1}{\sqrt{2}}\ln \left|\frac{\sqrt{2}+\sqrt{2+t^2}}{t+\sqrt{2+t^2}}\right|+\mathcal{C}$$
So $$I = \frac{1}{\sqrt{2}}\ln \left|\frac{\sqrt{2}x^2+x\sqrt{1+x^4}}{x^2-1+\sqrt{1+x^4}}\right|+\mathcal{C}$$
A: Given expression is also equal to:
$$\int\frac{1+\frac{1}{x^2}}{(x-\frac{1}{x})(\sqrt{\frac{1}{x^2}+x^2})}dx$$Which further reduces to
$$\int\frac{1+\frac{1}{x^2}}{(x-\frac{1}{x})\sqrt{(x-\frac{1}{x})^2-2}}dx$$Now let $x-\frac{1}{x}=t$ The rest is evident.
