Integral with residues $\int_0^\infty \tfrac{\sin^2(x)}{1+x^4}dx$ I am trying to calculate
$\displaystyle\int_0^\infty \dfrac{\sin^2(x)}{1+x^4}dx$
using method of residues. I have already seen this post, "Integrating $\int_{-\infty}^\infty \frac{1}{1 + x^4}dx$ with the residue theorem" And am integrating a quarter circle in the complex plane with a simple pole at $\exp(\frac{i\pi}{4})$. So if I put $z=e^{i\theta}, \sin^2(x)=-\frac{1}{4}(z-\frac{1}{z})$. Even so the residues are giving me difficulty. Any help would be great. 

First note that the integrand is even, so
$$
\int_{0}^\infty \frac{\sin^2 x}{1+x^4}\,dx = 
\frac12 \int_{-\infty}^\infty \frac{\sin^2 x}{1+x^4}\,dx.
$$
Furthermore $\sin^2 x = \dfrac{1-\cos 2x}{2}$ so
$$
\int_{0}^\infty \frac{\sin^2 x}{1+x^4}\,dx = 
\frac12 \int_{-\infty}^\infty \frac{\sin^2 x}{1+x^4}\,dx =
\frac14 \int_{-\infty}^\infty \frac{1-\cos 2x}{1+x^4}\,dx.
$$
Define a function
$$
f(z) = \frac{1-e^{2iz}}{1+z^4}.
$$
Then $\operatorname{Re}(f(x)) = \dfrac{1-\cos 2x}{1+x^4}$ for $x$ real. Let's compute $\int_C f(z)\,dz$ over the boundary of a large semi-disc: $C = \partial\{ z = x+iy : |z| < R, y = 0 \}$.
On the semi-circle (by the triangle inequality), we get
$$
|f(z)| \le \frac{1 + |e^{2iz}|}{|z|^4-1} \le \frac{2}{R^4-1}
$$
since $|e^{2i(x+iy)}| = |e^{-2y}| \le 1$ for $y \ge 0$. 
The standard estimation lemma (ML-inequality) shows that
$$
\left| \int_{C_R^+} f(z)\,dz \right| \le \pi R \cdot \frac{2}{R^4-1} \to 0
$$
as $R \to \infty$. (Here $C_R^+$ is the semi-circle.)
Finally, the residue theorem shows that
\begin{align}
\int_C f(z)\,dz &= 2\pi i \big( \operatorname{Res}\limits_{\exp(i\pi/4)}(f(z)) + 
\operatorname{Res}\limits_{\exp(3i\pi/4)}(f(z)) \big) \\
&= \frac{\pi\sqrt 2}{2}\,\big( 1- \exp(-\sqrt 2)(\sin \sqrt 2 + \cos \sqrt 2) \big).
\end{align}
(Tedious algebra omitted.)
Putting everything together, and taking the real part we get $1/4$ of the above, i.e.
$$
\int_{0}^\infty \frac{\sin^2 x}{1+x^4}\,dx = \frac{\pi\sqrt 2}{8}\,\big( 1- \exp(-\sqrt 2)(\sin \sqrt 2 + \cos \sqrt 2) \big).
$$
