Answer :

Consider the integral

[tex]\displaystyle \int_{-\infty}^\infty \frac{5 + 2x^2}{1 + x^2} e^{-x^2} \, dx[/tex]

which is the negative of yours. Bit strange to integrate over [tex](\infty,-\infty)[/tex], but if that's what you actually intended, just multiply the final result by -1. Of course, I've already canceled the superfluous factors of [tex]x^2[/tex].

Expand the integrand into partial fractions.

[tex]\displaystyle \int_{-\infty}^\infty \frac{5 + 2x^2}{1 + x^2} e^{-x^2} \, dx = \int_{-\infty}^\infty \left(2 + \frac3{1+x^2}\right) e^{-x^2} \, dx[/tex]

Recall that for [tex]\alpha>0[/tex],

[tex]\displaystyle \int_{-\infty}^\infty e^{-\alpha x^2} \, dx = \sqrt{\frac\pi\alpha}[/tex]

Now let

[tex]\displaystyle I(a) = \int_{-\infty}^\infty \frac{e^{-ax^2}}{1+x^2} \, dx[/tex]

Together, these give

[tex]\displaystyle \int_{-\infty}^\infty \frac{5 + 2x^2}{1 + x^2} e^{-x^2} \, dx = 2\sqrt\pi + 3I(1)[/tex]

Differentiate [tex]I(a)[/tex] under the integral sign with respect to [tex]a[/tex] to obtain a simple linear differential equation.

[tex]\displaystyle \frac{dI}{da} = -\int_{-\infty}^\infty \frac{x^2 e^{-ax^2}}{1+x^2} \, dx \\\\ ~~~~~~~~ = - \int_{-\infty}^\infty \left(1 - \frac1{1+x^2}\right) e^{-ax^2} \, dx \\\\ ~~~~~~~~ = -\sqrt{\frac\pi a} + I(a)[/tex]

Solve for [tex]I(a)[/tex] with the initial value [tex]I(1) = \sqrt\pi[/tex]. Using an integrating factor,

[tex]\displaystyle \frac{dI}{da} - I(a) = -\sqrt{\frac\pi a} \\\\ e^{-a} \frac{dI}{da} - e^{-a} I(a) = -\sqrt{\frac\pi a}\,e^{-a} \\\\ \frac{d}{da}\left[e^{-a} I(a)\right] = -\sqrt{\frac\pi a}\,e^{-a}[/tex]

By the fundamental theorem of calculus,

[tex]\displaystyle e^{-a} I(a) = e^{-a}I(a)\bigg|_{a=0} - \sqrt\pi \int_0^a \frac{e^{-\xi}}{\sqrt\xi} \, d\xi \\\\ I(a) = \pi e^a - \sqrt\pi \, e^a \int_0^a \frac{e^{-\xi}}{\sqrt\xi} \, d\xi[/tex]

so that

[tex]\displaystyle I(1) = \pi e - \sqrt\pi\,e \int_0^1 \frac{e^{-\xi}}{\sqrt\xi} \, d\xi[/tex]

Substitute [tex]t=\sqrt\xi[/tex].

[tex]\displaystyle I(1) = \pi e - 2\sqrt\pi\,e \int_0^1 e^{-t^2} \, dt[/tex]

Recall the error function,

[tex]\mathrm{erf}(x) = \displaystyle \frac2{\sqrt\pi} \int_0^x e^{-t^2} \, dt[/tex]

which we can use to write

[tex]I(1) = \pi e - 2\sqrt\pi e \cdot \dfrac{\sqrt\pi}2\,\mathrm{erf}(1) = \pi e - \pi e \,\mathrm{erf}(1)[/tex]

Finally, we arrive at

[tex]\displaystyle \int_{-\infty}^\infty \frac{5 + 2x^2}{1 + x^2} e^{-x^2} \, dx = \boxed{2\sqrt\pi + 3\pi e - 3\pi e \, \mathrm{erf}(1)}[/tex]