<s>[INST] Evaluating an improper integral $\int_{0}^{\infty}\frac{x^2}{(x^4+1)^2}dx$ I tried to solve the integral: $$\int_{0}^{\infty}\frac{x^2}{(x^4+1)^2}dx$$
using $ x = \sqrt{\tan(u)}$ and $dx = \frac{ \sec^2(u)}{2\sqrt{\tan(u)}} du,$
but I ended up with an even worse looking integral $$ \int_{0}^{\frac{\pi}{2}}\frac{\sqrt{\tan(u)}}{\sec^2(u)}du.$$
Wolfram gave an answer of $ \dfrac{\pi}{8\sqrt{2}},$ but how would one get to that answer?
 [/INST] Let us start with a step of integration by parts:
$$ \int_{0}^{+\infty}\frac{1}{4x}\cdot\frac{4x^3}{(x^4+1)^2}\,dx =\int_{0}^{+\infty}\frac{1}{4x^2}\left(1-\frac{1}{1+x^4}\right)\,dx=\frac{1}{4}\int_{0}^{+\infty}\frac{dx}{x^2+\frac{1}{x^2}}$$
and finish with Glasser's master theorem:
$$ \frac{1}{8}\int_{-\infty}^{+\infty}\frac{dx}{\left(x-\frac{1}{x}\right)^2+2}\stackrel{\text{GMT}}{=}\frac{1}{8}\int_{-\infty}^{+\infty}\frac{dx}{x^2+2} = \frac{\pi}{8\sqrt{2}}.$$
</s>