TITLE: How do we evaluate the closed form for $\int_{-\infty}^{+\infty}{(-1)^{n+1}x^{2n}+2n+1\over (1+x^2)^2}\cdot e^{-x^2}\mathrm dx?$
QUESTION [6 upvotes]: Proposed:

$$\int_{-\infty}^{+\infty}{(-1)^{n+1}x^{2n}+2n+1\over (1+x^2)^2}\cdot e^{-x^2}\mathrm dx={\sqrt{\pi}\over 2^{n-2}}\cdot F(n)\tag1$$
  Where is n integer, $n\ge1$

I am struggled to find the closed form for $(1)$
Where $F(1)=1, F(2)=3, F(3)=9, F(4)=21, F(5)=63, ...$
How can we find the closed form for $(1)?$

REPLY [2 votes]: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

$\ds{\mc{J}_{n} \equiv \int_{-\infty}^{\infty}{\pars{-1}^{n + 1}x^{2n} + 2n + 1
\over \pars{1 + x^{2}}^{2}}\expo{-x^{2}}\,\dd x =
{\root{\pi} \over 2^{n - 2}}\,\mrm{F}\pars{n}\,,\qquad
n \in \mathbb{N}_{\ \geq\ 1}.\quad\mrm{F}\pars{n}:\ {\large ?}}$.

\begin{align}
\mc{J}_{n} & =
2\int_{0}^{\infty}{\pars{-1}^{n + 1}x^{2n} + 2n + 1
\over \pars{1 + x^{2}}^{2}}\expo{-x^{2}}\,\dd x
\,\,\,\stackrel{x^{2}\ \mapsto\ x}{=}\,\,\,
\int_{0}^{\infty}{\pars{-1}^{n + 1}x^{n -1/2} + \pars{2n + 1}x^{-1/2}
\over \pars{1 + x}^{2}}\expo{-x}\,\dd x
\\[5mm] & =
\int_{0}^{\infty}\bracks{%
\pars{-1}^{n + 1}x^{n -1/2} + \pars{2n + 1}x^{-1/2}}\expo{-x}
\bracks{\int_{0}^{\infty}t\expo{-\pars{1 + x}t}\,\dd t}\dd x
\\[5mm] & =
\int_{0}^{\infty}t\expo{-t}\int_{0}^{\infty}
\bracks{\pars{-1}^{n + 1}x^{n -1/2}\expo{-\pars{1 +t}x} + \pars{2n + 1}x^{-1/2}\expo{-\pars{1 + t}x}}
\dd x\,\dd t
\\[5mm] & =
\int_{0}^{\infty}t\expo{-t}\bracks{%
{\pars{-1}^{n + 1}\,\Gamma\pars{n + 1/2} \over \pars{1 + t}^{n + 1/2}} +
{\pars{2n + 1}\Gamma\pars{1/2} \over \pars{1 + t}^{1/2}}}\,\dd t
\\[5mm] & =
\pars{-1}^{n + 1}\,\Gamma\pars{n + {1 \over 2}}a_{n} +
\pars{2n + 1}\root{\pi}a_{0} 
\end{align}

where

\begin{align}
a_{n} & \equiv \int_{0}^{\infty}{t\expo{-t} \over \pars{t + 1}^{n + 1/2}}\,\dd t \,\,\,\stackrel{t + 1\ \mapsto\ t}{=}\,\,\,
\int_{1}^{\infty}{\pars{t - 1}\expo{-\pars{t - 1}} \over t^{n + 1/2}}\,\dd t
\\[5mm] & =
\expo{}\pars{\int_{1}^{\infty}{\expo{-t} \over t^{n - 1/2}}\,\dd t -
\int_{1}^{\infty}{\expo{-t} \over t^{n + 1/2}}}\,\dd t =
\expo{}\bracks{\mrm{E}_{n - 1/2}\pars{1} - \,\mrm{E}_{n + 1/2}\pars{1}}
\end{align}

$\ds{\,\mrm{E}_{p}}$ is the Generalized Exponential Integral.

\begin{align}
\mc{J}_{n} & \equiv
\int_{-\infty}^{\infty}{\pars{-1}^{n + 1}x^{2n} + 2n + 1
\over \pars{1 + x^{2}}^{2}}\expo{-x^{2}}\,\dd x
\\[5mm] & =
\expo{}\left\{\vphantom{\LARGE A}\pars{-1}^{n + 1}\,\Gamma\pars{n + {1 \over 2}}
\bracks{\mrm{E}_{n - 1/2}\pars{1} - \,\mrm{E}_{n + 1/2}\pars{1}}\right.
\\[5mm] & \left.\phantom{\expo{}\braces{}}+
\pars{2n + 1}\root{\pi}\bracks{\mrm{E}_{-1/2}\pars{1} - \,\mrm{E}_{1/2}\pars{1}}\vphantom{\LARGE A}\right\} =
{\root{\pi} \over 2^{n - 2}}\,\mrm{F}\pars{n}
\end{align}