First substitute
to rewrite the integral as

Now use an Euler substitution,
to rewrite it again as

where we take

Partial fractions:

so that

The second integral is trivial,

For the other, I'm compelled to use the residue theorem, though real methods are doable too (e.g. trig substitution). Consider the contour integral

where
is a semicircle in the upper half of the complex plane, and its diameter lies on the real axis connecting
to
. The value of this integral is 2πi times the sum of the residues in the upper half-plane. It's fairly straightforward to convince ourselves that the integral along the circular arc vanishes as
, so the contour integral converges to the integral over the entire real line. Note that

since the integrand is even.
Find the poles of
.
![z^4 + 2z^2 + 2 = 0 \\\\ ~~~~ \implies (z^2+1)^2 = -1 \\\\ ~~~~ \implies z^2 = -1 \pm i \\\\ ~~~~ \implies z = \pm √(-1 \pm i) = \sqrt[4]{2}\, e^(\pm i(3\pi/8 + \pi k))](https://img.qammunity.org/2023/formulas/mathematics/college/rpon6h2rqwfaaucxrhsu3lhqp80x7fhnwv.png)
where
.
The two poles we care about are at
and
. Compute the residues at each one.


By the residue theorem,

We also have

Then the remaining integral is

It follows that
