<s>[INST] Solve integral $\int^1_0 \frac{1-x^2}{{(1+x^2)}\sqrt{1+x^4}}dx$ using subsituition $\sqrt{1+x^4} = {(1+x^2)}\cos{\theta}$ Hi this question has been posed in my integration book where it has been asked to solve it using the given substitution or any other substitution, I've found identical question posted here {1} with different substitutions
The problem is when using the given substitution I end up with integral
$$\int^{\pi/4}_0 \frac{\sin{\theta}}{2x}d\theta $$
Solving for $x$ : $\sqrt{1+x^4} = {(1+x^2)}\cos{\theta}$
According to WolframAlpha: $$x = \frac{|\csc{\theta}||1 \pm \sqrt{\cos{2\theta}}|}{\sqrt{2}} $$
I do know the sign for x is $+ve$ so I'll take $+ve$ solutions after opening the modulus, I do not know which sign to prefer in  $ \pm \sqrt{\cos{2\theta}} $  term
Eitherway, I solved for both cases :
$$  \frac{1}{\sqrt{2}}\int^{\pi/4}_0\frac{\sin^2{\theta}}{1 + \sqrt{\cos{2\theta}}} d\theta -(I) $$
$$  \frac{1}{\sqrt{2}}\int^{\pi/4}_0\frac{\sin^2{\theta}}{1 - \sqrt{\cos{2\theta}}} d\theta -(II) $$
Which leads to :
$$  \frac{1}{\sqrt{2}}\int^{\pi/4}_0 1 \pm \sqrt{\cos{2\theta}} d\theta = \frac{\pi}{4\sqrt{2}}
\pm\frac{\Gamma(\frac{3}{4})^2}{2\sqrt{2}} $$
Here I cheated and used WolframAlpha as I was exhausted.
Both the cases lead to a similar answer with difference of a function unknown to me: $\pm\frac{\Gamma(\frac{3}{4})^2}{2\sqrt{2}}$
The correct answer is :
$$\frac{\pi}{4\sqrt{2}}$$
My main questions are:

*

*What am I doing wrong?

*How did author arrive at this ingenious  substitution $\sqrt{1+x^4} = {(1+x^2)}\cos{\theta}$ , this doesn't appear to me trial n' error kind of substitution, I have spent hours doing algebraic transformation on this and no matter how you procced and plug the variable your integrand will only have one of these terms only $2x$, $1-x^2$, $1+x^2$ and $ \sqrt{1+x^4}$ and $2x$ being the simplest.

Related question: How do I integrate the following? $\int{\frac{(1+x^{2})\mathrm dx}{(1-x^{2})\sqrt{1+x^{4}}}}$
 [/INST] Divide top and bottom by $x^2$:
$$\int_0^1\frac{\frac{1}{x^2}-1}{\left(\frac{1}{x}+x\right)\sqrt{\frac{1}{x^2}+x^2}}dx$$
which suggests using the substitution $t = \frac{1}{x}+x$:
$$\int_2^\infty \frac{dt}{t\sqrt{t^2-2}} = \frac{1}{\sqrt{2}}\sec^{-1}\left(\frac{t}{\sqrt{2}}\right)\Biggr|_2^\infty = \frac{\pi}{4\sqrt{2}}$$
</s>