Integral of Hermite polynomial multiplied by $\exp(-x^2/2)$

For probabilists' Hermite polynomials: The Hermite polynomials are the orthogonal polynomials corresponding to the weight function $w(x) = e^{-x^2/2}$. This means that $\int_{-\infty}^{\infty} H_n(x)H_m(x)e^{-x^2/2} \, dx = 0$ whenever $n \not= m$ (or equivalently, $\int_{-\infty}^{\infty} H_n(x) P(x) e^{-x^2/2} \, dx = 0$ for any polynomial $P$ of degree less than $n$). Since $H_0(x) = 1$, it follows that $$\int_{-\infty}^{\infty} H_n(x)e^{-x^2/2} \, dx = \int_{-\infty}^{\infty} H_n(x)H_0(x)e^{-x^2/2} \, dx = 0$$ for all $n > 0$. The only time this integral is non-zero is when $n = 0$, in which case $$\int_{-\infty}^{\infty} H_0(x)e^{-x^2/2} \, dx = \int_{-\infty}^{\infty} e^{-x^2/2} \, dx = \sqrt{2\pi}.$$


Notice that, if $n$ is odd , then the integrand is an odd function which implies that the integral equals to $0$. If $n$ is even, then the integral equals to

$$ {2}^{2\,n+\frac{5}{2}}\Gamma \left( n+ \frac{3}{2} \right),\quad n=0,1,2,\dots. $$

Note this, in the above formula, $n=0$ corresponds to the case $H_{2}(x)$, $n=1$ correspons to the case $H_{4}(x)$ and so on.

One can have instead, the formula which include the case $n=0$

$$ {4}^{n}\sqrt {2}\,\Gamma \left( n+\frac{1}{2} \right), \quad n=0,1,2,\dots. $$

Again, in the above formula, $n=0$ corresponds to the case $H_{0}(x)$, $n=1$ corresponds to the case $H_{2}(x)$ and so on.


Using the generating funtion $e^{2xt-t^2}=\sum_{n=0}^\infty H_n(x)\frac{t^n}{n!}$ we can obtain two recurrence relations.

Differentiating with respect to $t$ we obtain $H_{n+1}(x)=2xH_n(x)-2nH_{n-1}(x)$ for $n\geq 1$ with $H_0(x)=1$ and $H_1(x)=2x$. Similarly, differentiating with respect to $x$ we obtain $\frac{d}{dx}H_n(x)=2nH_{n-1}(x)$ for $n\geq 1$.

Now, define $I_n=\int_{-\infty}^{\infty}e^{-x^2/2}H_n(x)dx$ then $$\begin{align}I_{n+1}&=\color{blue}{\int_{-\infty}^{\infty}2xe^{-x^2/2}H_{n}(x)dx}-2nI_{n-1}\\ &=\color{blue}{-2e^{-x^2/2}H_n(x)\Big|_{-\infty}^{\infty}+4nI_{n-1}}-2nI_{n-1}=2nI_{n-1}. \end{align}$$ where the integral in blue was solved by parts and since that $H_n$ is a polynomial of degree $n$ we have that $\lim_{x\to\pm\infty}e^{-x^2/2}H_n(x)=0$, therefore $-2e^{-x^2/2}H_n(x)\Big|_{-\infty}^{\infty}=0$.

To finish, since $$I_0=\int_{-\infty}^{\infty}e^{-x^2/2}H_0(x)dx=\int_{-\infty}^{\infty}e^{-x^2/2}dx=\sqrt{2\pi}$$ and $$I_1=\int_{-\infty}^{\infty}e^{-x^2/2}H_1(x)dx=\int_{-\infty}^{\infty}2xe^{-x^2/2}dx=0$$ we conclude that $I_{2n+1}=0$ for all $n\in\mathbb{N}$ and $$\begin{align}I_{2n}&=2(2n-1)I_{2n-2}\\ &=2^2(2n-1)(2n-3)I_{2n-4}\\ &~~\vdots\\ &=2^n(2n-1)(2n-3)\cdots1\cdot I_0\\ &=2^n\frac{2n(2n-1)(2n-2)(2n-3)\cdots1}{2n(2n-2)\cdots2}I_0\\ &=2^n\frac{(2n)!}{2^nn!}I_0\\ &=\frac{(2n)!}{n!}I_0\\ &=\frac{(2n)!}{n!}\sqrt{2\pi}.\end{align}$$