TITLE: How can I evaluate $\int_{-\infty}^{\infty}\frac{e^{-x^2}(2x^2-1)}{1+x^2}dx$?
QUESTION [9 upvotes]: How can I solve this integral: $$\int_{-\infty}^{\infty}\frac{e^{-x^2}(2x^2-1)}{1+x^2}dx.$$ Can I solve this problem using the Laplace transform? How can I do this?

REPLY [12 votes]: Here is yet another way to evaluate the integral
$$I=\int_{-\infty}^\infty \frac{e^{-x^2}}{1+x^2}dx.$$ Write 
$$\frac{1}{1+x^2}= \int_0^\infty e^{-s(1+x^2)}ds,$$
so that
$$I=\int_{-\infty}^\infty e^{-x^2} \int_{0}^\infty e^{-s(1+x^2)}ds\:  dx.$$
We switch the order of integration to get
$$\int_{0}^\infty e^{-s} \int_{-\infty}^\infty e^{-x^2(1+s)}dx\:  ds = \int_{0}^\infty e^{-s} \sqrt{\frac{\pi}{1+s}} ds = e\sqrt{\pi}\int_{0}^\infty  \frac{e^{-(s+1)}}{\sqrt{1+s}} ds = e\pi \text{ erfc}(1).$$
(To see that this last integral is indeed $\sqrt\pi \text{ erfc}(1)$, put $u=\sqrt{1+s}$, $du= \frac{ds}{2\sqrt{1+s}}$.)