Solving the integral: $\int_{-\infty}^{+\infty} x^n e^{-ax^2+bx} \, dx$... Moments of anormal distribuition?

219 Views Asked by At

I'm trying to find a closed formula for the integral in $(eq. 1)$, but i wasn't able to do anything. On the other hand, while searching on the web i found a closed formula for the cases $(n=1, \, n=2)$ (https://en.wikipedia.org/wiki/List_of_integrals_of_exponential_functions).. but there isn't any demonstration. Moreover, i found that these integrals could correspond to '$n$-th moment' of a normal distribuition, but then again i hadn't found anything else.


$$\int_{-\infty}^{+\infty} x^n e^{-ax^2+bx} \, dx \longrightarrow a \in \mathbb{R^+}, \, b\in \mathbb{C} \qquad (1)$$

4

There are 4 best solutions below

1
On BEST ANSWER

After completing the square $$ I_n=\int_{-\infty}^\infty x^ne^{-a x^2+bx}\,\mathrm dx=\sqrt{\frac{\pi}{a}}e^{b^2/4a}\int_{-\infty}^\infty x^n \phi(x;b/2a,1/2a)\,\mathrm dx, $$ where $\phi(x;\mu,\sigma^2)$ is the normal probability density. Thus $$ I_n=\sqrt{\frac{\pi}{a}}e^{b^2/4a}\mathsf EX^n $$ with $X\sim\mathcal N(b/2a,1/2a)$. Using equation 18 here (you can probably find this elsewhere) the integer moments of the normal variable can be expressed in terms of Hermite polynomials giving $$ I_n=\sqrt{\frac{\pi}{a}}e^{b^2/4a}\left(\frac{i}{2\sqrt a}\right)^nH_n\left(-i\frac{b}{2\sqrt a}\right), $$ where $i$ is the imaginary unit (this will yield a real solution for all nonnegative integers $n$). Here is a table of the first few values $$ \left( \begin{array}{cc} n & I_n\\ 0 & \sqrt{\pi } \sqrt{\frac{1}{a}} e^{\frac{b^2}{4 a}} \\ 1 & \frac{1}{2} \sqrt{\pi } \left(\frac{1}{a}\right)^{3/2} b e^{\frac{b^2}{4 a}} \\ 2 & \frac{1}{4} \sqrt{\pi } \left(\frac{1}{a}\right)^{5/2} \left(2 a+b^2\right) e^{\frac{b^2}{4 a}} \\ 3 & \frac{1}{8} \sqrt{\pi } \left(\frac{1}{a}\right)^{7/2} b \left(6 a+b^2\right) e^{\frac{b^2}{4 a}} \\ 4 & \frac{1}{16} \sqrt{\pi } \left(\frac{1}{a}\right)^{9/2} \left(12 a^2+12 a b^2+b^4\right) e^{\frac{b^2}{4 a}} \\ \end{array} \right) $$

In fact, you can extend this integral to negative integer $n$ using a regularization technique found here.

If you're interested in the case for $b=0$ we may use the well-known explicit expression for $H_n(0)$ giving $$ I_n\big|_{b=0}=\sqrt{\frac{\pi}{a}}\left(\frac{i}{2\sqrt a}\right)^nH_n(0)% = \begin{cases} 0, &n\ \text{ odd}\\ \sqrt{\frac{\pi}{a}}\frac{(n-1)!!}{(2 a)^{n/2}}, &n\ \text{ even}. \end{cases} $$

Edit:

OP has asked for clarification. Once we have $I_n$ in terms of moments of the normal distribution, all we need is an explicit expression for those moments. One quick way to do this is to compare the moment generating function $$ M_X(t)=e^{bt/2a+t^2/4a}=\sum_{n=0}^\infty(\mathsf EX^n)\frac{t^n}{n!} $$ to the generating function for the Hermite polynomials $$ e^{2xt-t^{2}}=\sum _{n=0}^{\infty }H_{n}(x){\frac {t^{n}}{n!}}. $$

3
On

Suggestion:

First, evaluate

$$I_0(a,b)= \int_{-\infty}^{\infty} e^{-ax^2+bx} \, dx = \sqrt{\frac{\pi}{a}} \ e^{\frac{b^2}{4a}} $$ Then $$I_n(a,b) =\int_{-\infty}^{\infty}x^n e^{-ax^2+bx} \, dx = \frac{d^n}{db^n}I_0(a,b)=\sqrt{\frac{\pi}{a}} \frac{d^n (e^{\frac{b^2}{4a}})}{db^n} $$ and, in particular \begin{align} &J_1= \frac{d}{db} I_0(a,b) = I_0\frac b{2a}\\ &J_2= \frac{d}{db}I_1(a,b)=I_0 \left(\frac1{2a}+\frac{b^2}{4a^2} \right)\\ &J_3= \frac{d}{db}I_2(a,b)=I_0\bigg(\cdots\bigg) \end{align}

2
On

If you enjoy Kummer confluent hypergeometric function $$2\, a^{\frac{n+2}{2}}\,I_n=\sqrt{a} \,\left(1+(-1)^n\right) \Gamma \left(\frac{n+1}{2}\right) \, _1F_1\left(\frac{n+1}{2};\frac{1}{2};\frac{b^2}{4 a}\right)+$$ $$b\, \left(1-(-1)^n\right) \Gamma \left(\frac{n+2}{2}\right) \, _1F_1\left(\frac{n+2}{2};\frac{3}{2};\frac{b^2}{4 a}\right)$$

0
On

Remember that $$M_n=\int_{-\infty}^{\infty}x^ne^{-(x-m)^2/2\sigma^2}\frac{dx}{\sigma \sqrt{2\pi}}=\mathbb{E}(X^n)$$ where $X\sim N(m,\sigma^2)$ has the same distribution as $m+\sigma Z$ where $Z\sim N(0,1).$ Remember also that $$\mathbb{E}(Z^{2k})=\int_{-\infty}^{\infty}z^{2k}e^{-z^2/2}\frac{dz}{\sqrt{2\pi}}=\frac{2^k}{\sqrt{\pi}}\int_0^{\infty}e^{-u}u^{k-\frac{1}{2}}=\frac{2^k}{\sqrt{\pi}}\Gamma(k+\frac{1}{2}).$$ Of course $\mathbb{E}(Z^{2k+1})=0.$ This gives a way to compute $$M_n=\mathbb{E}((m+\sigma Z)^n)=\sum_{i=0}^{n}C^i_n\sigma^i\mathbb{E}(Z^i)m^{n-i}.$$

Now, what is the link with $I_n=\int_{-\infty}^{\infty}x^ne^{-ax^2+bx}dx?$ Well, $I_n=CM_n$ with $a=1/(2\sigma^2)$ and suitable $b$ and $C$ that you can compute by yourself.