TITLE: Find an integral with fractions
QUESTION [6 upvotes]: How to find the integral $$\int_0^\infty \frac{e^{-x^2}}{(x^2+1/2)^2}dx?$$
I find it is difficult to do if I integrate by parts...What's the trick?

REPLY [7 votes]: $$\int\dfrac{e^{-x^2}}{\left(x^2+\dfrac{1}{2}\right)^2}dx=-\int\dfrac{e^{-x^2}}{2x}d\left(\dfrac{1}{x^2+\dfrac{1}{2}}\right)=-\dfrac{e^{-x^2}}{2x\left(x^2+\dfrac{1}{2}\right)}-\int\dfrac{e^{-x^2}}{x^2}$$
and
$$-\int\dfrac{e^{-x^2}}{x^2}=\int e^{x^2}d\dfrac{1}{x}=\dfrac{e^{-x^2}}{x}+2\int e^{-x^2}dx$$
so
$$I=\int_{0}^{+\infty}\dfrac{e^{-x^2}}{\left(x^2+\dfrac{1}{2}\right)^2}dx
=\dfrac{xe^{-x^2}}{x^2+\dfrac{1}{2}}|_{0}^{+\infty}+2\int_{0}^{+\infty}e^{-x^2}dx=\sqrt{\pi}$$
solution2:
since
$$e^{-x^2}=\int_{x}^{+\infty}2te^{-t^2}dt$$
so
$$I=\int_{0}^{+\infty}\left[\int_{x}^{+\infty}\dfrac{2te^{-t^2}}{
\left(x^2+\dfrac{1}{2}\right)^2}dt\right]dx=\int_{0}^{+\infty}2te^{-t^2}\left(\sqrt{2}\arctan{\sqrt{2}t}+\dfrac{t}{t^2+1/2}\right)dt$$
so
$$I=\int_{0}^{+\infty}\dfrac{2t^2}{t^2+1/2}e^{-t^2}-\int_{0}^{+\infty}\sqrt{2}\arctan{\sqrt{2}t}de^{-t^2}=2\int_{0}^{+\infty}e^{-t^2}dt=\sqrt{\pi}$$