Integrating $\int_{-\infty}^{\infty} \big(\frac{x^2}{x^2 + a}\big)^2 e^{-x^2/2} \, \mathrm{d}x$ I was wondering if it is possible to compute this integral in closed form:
$$
\int_{-\infty}^{\infty} \big(\frac{x^2}{x^2 + a}\big)^2 e^{-x^2/2} \, \mathrm{d}x
$$
I tried making a substitution with $s = x^2$ and also tried evaluating it in Wolfram Alpha, but was not successful.
 A: This is too long for a comment.
Since, in comments, you already received the answer and a good hint, let me address the more general case of
$$I_n= \int_{-\infty}^{+\infty} \left(\frac{x^2}{x^2+a}\right)^n\, e^{-\frac{x^2}{2}}\,dx=2\int_{0}^{+\infty} \left(\frac{x^2}{x^2+a}\right)^k\, e^{-\frac{x^2}{2}}\,dx$$
The idea is to write
$$\frac{x^2}{x^2+a}=\frac{x^2+a-a}{x^2+a}=1-\frac {a}{x^2+a}$$ and to use the binomial expansion to face known integrals since using Tricomi's confluent hypergeometric function
$$\int_0^\infty  \left(a+x^2\right)^{-n}\, e^{-\frac{x^2}{2}}\,dx=\frac 1 {2 ^n}\sqrt{\frac \pi 2 } \, U\left(n,n+\frac{1}{2},\frac{a}{2}\right)$$
They write
$$I_n=\frac{\sqrt{2\pi }}  {2^n\,n!}\Bigg[ P_{n}- {  \sqrt{\frac{a\pi}2}\,e^{a/2} } \, \text{erfc}\left(\sqrt{\frac{a}{2}}\right)\,Q_{n}\Bigg]$$
where the first polynomials in $a$ are
$$\left(
\begin{array}{ccc}
 n & P_n & Q_n \\
 0 & 1 & 0 \\
 1 & 2 & 2 \\
 2 & 4 a+8 & 4 a+12 \\
 3 & 6 a^2+54 a+48 & 6 a^2+60 a+90 \\
 4 & 8 a^3+160 a^2+696 a+384 & 8 a^3+168 a^2+840 a+840
\end{array}
\right)$$
A: Under substitution $\frac{x}{\sqrt{2}} \to x$ we get that your integral is equal to $I =2 \sqrt{2} \int_0^{\infty} \frac{x^4}{(x^2 + \xi)^2}e^{-x^2}\mathrm{d}x$ where $\xi = \frac{a}{2}$. Additionally, since $ \frac{x^4}{(x^2 + \xi)^2} = 1 - \frac{2\xi}{x^2 + \xi} + \frac{\xi^2}{\left(x^2 + \xi \right)^2}$, the problem reduces to solving
$$
I_n = \int_0^{\infty} \frac{e^{-x^2}}{(x^2 + \xi)^n}\, \mathrm{d}x,\ \ \quad \text{for}\quad   n=1,2
$$

For the first integral we get
\begin{align*}
I_1 & =\int_0^{\infty} \frac{e^{-x^2}}{x^2 + \xi}\, \mathrm{d}x\\ & = \int_0^{\infty}\int_0^{\infty} e^{-x^2}e^{-y\left(x^2+ \xi\right) }  \, \mathrm{d}y \, \mathrm{d}x \\
& = \int_0^{\infty}\int_0^{\infty} e^{-x^2(y+1)}e^{-y \xi }  \, \mathrm{d}x \, \mathrm{d}y 
\end{align*}
Introducing the change of coordinate system $x = \sqrt{\xi}\frac{u}{v}$ and $ y = \frac{v^2}{\xi} -1$ gives $v^2 -\xi= \xi y$ and $u^2 = x^2 (y+1)$ and thus
\begin{align*}
I_1 &= \int_{\sqrt{\xi}}^{\infty} \int_{0}^{\infty} e^{-u^2}e^{-v^2 +\xi} \begin{vmatrix} \sqrt{\xi}\frac{1}{v} & -\sqrt{\xi}\frac{u}{v^2} \\ 0 & \frac{2v}{\xi}\end{vmatrix}\, \mathrm{d}u \, \mathrm{d}v\\
& = \frac{2}{\sqrt{\xi}} e^{\xi} \int_{0}^{\infty}e^{-u^2}\mathrm{d}u \int_{\sqrt{\xi}}^{\infty}e^{-v^2}\mathrm{d}v\\
& = \frac{\pi}{2\sqrt{\xi}} e^{\xi} \mathrm{erfc}\left(\sqrt{\xi}\right)
\end{align*}
recalling that $\int_0^{\infty} e^{-t^2}\mathrm{d}t = \frac{\sqrt{\pi}}{2}$ and that $\int_z^{\infty} e^{-t^2}\mathrm{d}t = \frac{\sqrt{\pi}}{2}\mathrm{erfc}(z)$ by the definition of the complementary error function. Thus

$$\int_0^{\infty} \frac{e^{-x^2}}{x^2 + \xi}\, \mathrm{d}x =\frac{\pi}{2\sqrt{\xi}} e^{\xi} \mathrm{erfc}\left(\sqrt{\xi}\right) \qquad \text{for} \quad \xi >0  $$

For the second integral we'll use Feynman's trick. Since $\frac{\partial}{\partial \xi} \frac{e^{-x^2}}{x^2 + \xi} = - \frac{e^{-x^2}}{\left(x^2 + \xi\right)^2}$ we see that differentiating the previous result we can obtain $I_2$:
$$
-I_2 = \int_0^{\infty}\frac{\partial}{\partial \xi}  \frac{e^{-x^2}}{x^2 + \xi}\, \mathrm{d}x = \frac{\mathrm{d}}{\mathrm{d}\xi}\int_0^{\infty} \frac{e^{-x^2}}{x^2 + \xi}\, \mathrm{d}x =  \frac{\mathrm{d}}{\mathrm{d}\xi}\frac{\pi}{2\sqrt{\xi}} e^{\xi} \mathrm{erfc}\left(\sqrt{\xi}\right)
$$
By the F.T.C. we know that $\frac{\mathrm{d}}{\mathrm{d}z}\mathrm{erfc}(z) = - \frac{2}{\sqrt{\pi}}e^{-z^2}$ using the definition of the complementary error function. Taking the derivative we get that $\frac{\mathrm{d}}{\mathrm{d}\xi} \frac{e^\xi}{\sqrt{\xi}}\mathrm{erfc}\left(\sqrt{\xi}\right) = \frac{e^\xi (2\xi-1)}{2\xi^{\frac32}}\mathrm{erfc}\left(\sqrt{\xi}\right) - \frac{1}{\sqrt{\pi}\xi}  $ which allows us to conclude

$$\int_0^{\infty} \frac{e^{-x^2}}{\left(x^2 + \xi\right)^2}\, \mathrm{d}x =\frac{\sqrt{\pi}}{2\xi}  - \frac{\pi e^\xi (2\xi-1)}{4\xi^{\frac32}}\mathrm{erfc}\left(\sqrt{\xi}\right) \qquad \text{for} \quad \xi >0  $$


Finally, combining all of the above we can evaluate the original integral to be
\begin{align*}
I & = 2 \sqrt{2} \int_0^{\infty} \frac{x^4}{(x^2 + \xi)^2}e^{-x^2}\mathrm{d}x \\
& = 2 \sqrt{2} \left[\int_0^{\infty} e^{-x^2}\mathrm{d}x  - 2\xi \int_0^{\infty} \frac{e^{-x^2}}{x^2 + \xi} \mathrm{d}x + \xi^2\int_0^{\infty} \frac{e^{-x^2}}{\left(x^2 + \xi \right)^2}\mathrm{d}x  \right]\\
& = 2 \sqrt{2} \left[\frac{\sqrt{\pi}}{2} - 2\xi \frac{\pi}{2\sqrt{\xi}} e^{\xi} \mathrm{erfc}\left(\sqrt{\xi}\right)  + \xi^2\left( \frac{\sqrt{\pi}}{2\xi}  - \frac{\pi e^\xi (2\xi-1)}{4\xi^{\frac32}}\mathrm{erfc}\left(\sqrt{\xi}\right)\right) \right]\\
& =  (\xi+1)\sqrt{2\pi} - (2\xi+3) \pi e^\xi \sqrt{\frac{\xi}{2}}\mathrm{erfc}\left(\sqrt{\xi}\right)
\end{align*}
and recalling that $ \xi = \frac{a}{2}$ we get the final result
$$
\boxed{\int_{-\infty}^{\infty} \left(\frac{x^2}{x^2+a} \right)^2 e^{-\frac{x^2}{2}} \, \mathrm{d}x =\frac{1}{2}\left[(a+2)\sqrt{2\pi} - \sqrt{a}(a+3) \pi e^\frac{a}{2} \mathrm{erfc}\left(\sqrt{\frac{a}{2}}\right) \right] \qquad \text{for} \quad a>0}
$$
verifying WA's result posted in the comments.
