TITLE: Help solving this integral $\int_{-\infty}^{\infty} \frac{x^2 e^{-x^2/2}}{a+bx^2}dx$
QUESTION [6 upvotes]: So, I've got an integral in the following form:
$$\int_{-\infty}^{\infty} \frac{x^2 e^{-x^2/2}}{a+bx^2}dx$$
where $b<0$ and $a\in\mathbb{R}$.
I've tried substituting $y=x^2$ (after changing changing lower limit to 0 and multiplying by 2 of course) and $z=y+a$ but there is that pesky square root in the denominator...
Anyone with better ideas?  Is this thing even soluble?

REPLY [15 votes]: Consider the function
$$\mathcal{I}(a)=\int_{-\infty}^{+\infty} \frac{a}{a^2+x^2}e^{-(a^2+x^2)}dx.$$
Integration by parts gives
$$\mathcal{I}(a)=\left[\tan^{-1}\left(\frac{x}{a}\right) e^{-(a^2+x^2)}\right]_{-\infty}^{+\infty}-\int_{-\infty}^{+\infty}\tan^{-1}\left(\frac{x}{a}\right)(-2x)e^{-(a^2+x^2)}dx$$
$$=\int_{-\infty}^{+\infty}\tan^{-1}\left(\frac{x}{a}\right)2xe^{-(a^2+x^2)}dx.$$
Now differentiate $\mathcal{I}$ with respect to $a$ and obtain
$$\frac{d\,\mathcal{I}}{da}=\int_{-\infty}^{+\infty}\left[-\frac{x}{a^2+x^2}\right]2xe^{-(a^2+x^2)}+\tan^{-1}\left(\frac{x}{a}\right)\left[(-2a)2xe^{-(a^2+x^2)}\right]dx$$
$$=-\int_{-\infty}^{+\infty}\frac{2x^2}{a^2+x^2}e^{-(a^2+x^2)}dx-2a\mathcal{I}(a) $$
$$=-\int_{-\infty}^{+\infty}\left(\frac{2x^2}{a^2+x^2}+2a\frac{a}{a^2+x^2}\right)e^{-(a^2+x^2)}dx $$
$$=-2\int_{-\infty}^{+\infty}e^{-(x^2+a^2)}dx=-2\sqrt{\pi}e^{-a^2}.$$
Equipped with the fact $\lim\limits_{a\to\infty}\mathcal{I}(a)=0$, we arrive at
$$\mathcal{I}(a)=\int_{+\infty}^a -2\sqrt{\pi}e^{-u^2}du= \pi \,\mathrm{erfc}(a),$$
where $\mathrm{erfc}$ is the complementary error function. Note this agrees as $a\to0$ because of the distributional fact that $a/(a^2+x^2)\to\delta(x)$. This implies
$$\int_{-\infty}^{+\infty}\frac{1}{x^2+a}e^{-x^2}dx=\pi e^a\frac{\mathrm{erfc}\left(\sqrt{a}\right)}{\sqrt{a}}.$$
Finally, observe that
$$\int_{-\infty}^{+\infty}\frac{x^2}{a+bx^2}e^{-x^2/2}dx=\frac{1}{b}\int_{-\infty}^{+\infty}\left(1-\frac{a}{a+bx^2}\right)e^{-x^2/2}dx$$
$$=\frac{1}{b}\left(\sqrt{2\pi}-\frac{a}{\sqrt{2}b}\int_{-\infty}^{+\infty}\frac{1}{\frac{a}{2b}+x^2}e^{-x^2}dx\right)$$
$$=\frac{1}{b}\left(\sqrt{2\pi}-\sqrt{\frac{a}{b}}\pi\exp\left(\frac{a}{2b}\right)\mathrm{erfc}\left(\sqrt{\frac{a}{2b}}\right)\right).$$