MHB General formula for this weird Gaussian integral?

skate_nerd
Messages
174
Reaction score
0
Is there a formula for Gaussian integrals of the form
$$\int_{-\infty}^{\infty}{x^n}{e^{-a(x-b)^2}}dx$$
I've looked all over, and all I could find were formulas saying
$$\int_{-\infty}^{\infty}{e^{-a(x-b)^2}}dx=\sqrt{\frac{\pi}{a}}$$
and
$$\int_{-\infty}^{\infty}{x}{e^{-a(x-b)^2}}dx=b{\sqrt{\frac{\pi}{a}}}$$
via Wikipedia. Wolframalpha can do the integrals I want only if I plug in actual numbers for \(a\) and \(b\), but I am unable to tell from those answers what role the \(a\) and \(b\) play. Some guidance would be appreciated! Just a formula is what I'm looking for, no derivations.
 
Physics news on Phys.org
skatenerd said:
Is there a formula for Gaussian integrals of the form
$$\int_{-\infty}^{\infty}{x^n}{e^{-a(x-b)^2}}dx$$
I've looked all over, and all I could find were formulas saying
$$\int_{-\infty}^{\infty}{e^{-a(x-b)^2}}dx=\sqrt{\frac{\pi}{a}}$$
and
$$\int_{-\infty}^{\infty}{x}{e^{-a(x-b)^2}}dx=b{\sqrt{\frac{\pi}{a}}}$$
via Wikipedia. Wolframalpha can do the integrals I want only if I plug in actual numbers for \(a\) and \(b\), but I am unable to tell from those answers what role the \(a\) and \(b\) play. Some guidance would be appreciated! Just a formula is what I'm looking for, no derivations.

The method is partial integration:
$$\int u dv = uv - \int v du$$

Let's call:
$$I_n = \int_{-\infty}^\infty x^n e^{-x^2}dx$$

Then:
\begin{aligned}I_n &= \int x^n e^{-x^2}dx \\
&= \int x^n \cdot \frac{-1}{2x} d\left(e^{-x^2}\right) \\
&= -x^n \cdot \frac{-1}{2x} \cdot e^{-x^2}\Bigg|_{-\infty}^{\infty} - \int e^{-x^2} d\left(-\frac 1 2 x^{n-1}\right) \\
&= 0 + \frac {n-1} 2 \int x^{n-2} e^{-x^2} dx \\
&= \frac {n-1} 2 I_{n-2}
\end{aligned}

As you can see, the power of $x$ goes down by $2$.
That means that when solving the recurrence relation, it comes out as one of the 2 standard formulas.
 
skatenerd said:
Is there a formula for Gaussian integrals of the form
$$\int_{-\infty}^{\infty}{x^n}{e^{-a(x-b)^2}}dx$$
I've looked all over, and all I could find were formulas saying
$$\int_{-\infty}^{\infty}{e^{-a(x-b)^2}}dx=\sqrt{\frac{\pi}{a}}$$
and
$$\int_{-\infty}^{\infty}{x}{e^{-a(x-b)^2}}dx=b{\sqrt{\frac{\pi}{a}}}$$
via Wikipedia. Wolframalpha can do the integrals I want only if I plug in actual numbers for \(a\) and \(b\), but I am unable to tell from those answers what role the \(a\) and \(b\) play. Some guidance would be appreciated! Just a formula is what I'm looking for, no derivations.

With a simple substitution of variables the integral becomes...

$\displaystyle I = \int_{- \infty}^{+ \infty} \xi^{n}\ \ e^{- a\ (\xi- b)^{2}}\ d\xi = \int_{- \infty}^{+ \infty} \frac {1}{\sqrt{a}}\ (\frac{x}{\sqrt{a}} + b)^{n}\ e^{- x^{2}}\ dx = \int_{- \infty}^{+ \infty} f(x)\ e^{- x^{2}}\ dx\ (1)$

If f(x) is a polynomial of degree not greater that 2n - 1 then is...

$\displaystyle I = \sum_{k=1}^{n} A_{k}\ f(x_{k})\ (2)$

... where the $x_{k}$ are the zeroes of the n-th Hermite polynomial...$\displaystyle H_{n} (x) = (-1)^{n}\ e^{x^{2}}\ \frac{d^{n}}{d x^{n}} e^{- x^{2}}\ (3)$

... and the $A_{k}$ are...

$\displaystyle A_{k} = 2^{n+1}\ n!\ \frac{\sqrt{\pi}}{[H^{\ '}_{n} (x_{k})]^{2}}\ (4)$

Some Hermite Polynomials are...

$\displaystyle H_{1} (x) = 2\ x$

$\displaystyle H_{2} (x) = 4\ x^{2}- 2$

$\displaystyle H_{3} (x) = 8\ x^{3} - 12\ x$

... Kind regards $\chi$ $\sigma$
 
Last edited:
chisigma said:
With a simple substitution of variables the integral becomes...

$\displaystyle I = \int_{- \infty}^{+ \infty} \xi^{n}\ \ e^{- a\ (\xi- b)^{2}}\ d\xi = \int_{- \infty}^{+ \infty} \frac{1}{\sqrt{a}}\ (\frac{x}{\sqrt{a}} + b)^{n}\ e^{- x^{2}}\ dx = \int_{- \infty}^{+ \infty} f(x)\ e^{- x^{2}}\ dx\ (1)$

If f(x) is a polynomial of degree not greater that 2n - 1 then is...

$\displaystyle I = \sum_{k=1}^{n} A_{k}\ f(x_{k})\ (2)$

... where the $x_{k}$ are the zeroes of the n-th Hermite polynomial...$\displaystyle H_{n} (x) = (-1)^{n}\ e^{x^{2}}\ \frac{d^{n}}{d x^{n}} e^{- x^{2}}\ (3)$

... and the $A_{k}$ are...

$\displaystyle A_{k} = 2^{n+1}\ n!\ \frac{\sqrt{\pi}}{[H^{\ '}_{n} (x_{k})]^{2}}\ (4)$

Some Hermite Polynomials are...

$\displaystyle H_{1} (x) = 2\ x$

$\displaystyle H_{2} (x) = 4\ x^{2}- 2$

$\displaystyle H_{3} (x) = 8\ x^{3} - 12\ x$

... Kind regards $\chi$ $\sigma$

May be it is interesting to evaluate the case n=2. In this case is $\displaystyle H_{2} (x) = 4\ x^{2} - 2$, so that $\displaystyle x_{k} = \pm \frac{1}{\sqrt{2}}$ and $\displaystyle A_{k}= \frac{\sqrt{\pi}}{2}$, so that is...

$\displaystyle \int_{- \infty}^{\infty} \xi^{2}\ e^{- a\ (\xi-b)^{2}}\ d \xi = \sqrt{\frac{\pi}{a}}\ (\frac{1}{2\ a} + b^{2})\ (1)$

The polynomial $\displaystyle H_{2} (x)$ is useful also for the case n=3 and the task is left to You...

Kind regards

$\chi$ $\sigma$
 
Last edited:
Thanks everyone. I'm thinking that I Like Serena's post doesn't apply to my situation, correct? Though the derivation is interesting anyway since I haven't seen it before...

I think I am following this whole solution you have provided Chisigma. But just so I know if I am following correctly, are you sure that it isn't the case that for \(n=2\), \(A_k=\frac{\sqrt{\pi}}{2}\)? I went over it a few times in my head, and that's what I got...
 
skatenerd said:
Is there a formula for Gaussian integrals of the form
$$\int_{-\infty}^{\infty}{x^n}{e^{-a(x-b)^2}}dx$$
I've looked all over, and all I could find were formulas saying
$$\int_{-\infty}^{\infty}{e^{-a(x-b)^2}}dx=\sqrt{\frac{\pi}{a}}$$
and
$$\int_{-\infty}^{\infty}{x}{e^{-a(x-b)^2}}dx=b{\sqrt{\frac{\pi}{a}}}$$
via Wikipedia. Wolframalpha can do the integrals I want only if I plug in actual numbers for \(a\) and \(b\), but I am unable to tell from those answers what role the \(a\) and \(b\) play. Some guidance would be appreciated! Just a formula is what I'm looking for, no derivations.

For $$a>0$$ you are essentially asking for the moments $${\rm{E}}(X^n)$$ of the normal distribution, which may be written in terms of the confluent hypergeometric function $$U(\alpha,\beta,z)$$.

See the section on moments in the Wikipedia page for the normal distribution.

.
 
@ Chisigma:
Does your process not work for n=1? Or is there an error somewhere?
We would have
$$f(x)=(\frac{x}{\sqrt{a}}+b)^1$$
The only zero of the 1st Hermite polynomial is \(x_k=0\). We would also have
$$A_k={2^2}1!\frac{\sqrt{\pi}}{2^2}=\sqrt{\pi}$$

(also I am wondering, does \(A_k\) not even need to be included in the summation for \(I\) when the \(n^{th}\) Hermite polynomial only has one zero?)

So then we would have
$$I=\sqrt{\pi}(\frac{0}{\sqrt{a}}+b)=b\sqrt{\pi}$$
Which is not the same as the formula I had previously from Wikipedia:
$$\int_{-\infty}^{\infty}xe^{-a(x-b)^2}dx=b\sqrt{\frac{\pi}{a}}$$

And I tried checking the formula you got for n=2, and that didn't agree with any examples that I tried plugging into Wolframalpha.
 
skatenerd said:
@ Chisigma:
Does your process not work for n=1? Or is there an error somewhere?
We would have
$$f(x)=(\frac{x}{\sqrt{a}}+b)^1$$
The only zero of the 1st Hermite polynomial is \(x_k=0\). We would also have
$$A_k={2^2}1!\frac{\sqrt{\pi}}{2^2}=\sqrt{\pi}$$

(also I am wondering, does \(A_k\) not even need to be included in the summation for \(I\) when the \(n^{th}\) Hermite polynomial only has one zero?)

So then we would have
$$I=\sqrt{\pi}(\frac{0}{\sqrt{a}}+b)=b\sqrt{\pi}$$
Which is not the same as the formula I had previously from Wikipedia:
$$\int_{-\infty}^{\infty}xe^{-a(x-b)^2}dx=b\sqrt{\frac{\pi}{a}}$$

And I tried checking the formula you got for n=2, and that didn't agree with any examples that I tried plugging into Wolframalpha.

All right skatenerd!... I have been in a hurry and I made several mistakes!(Sadface)... First the right formula is...

$\displaystyle \int_{- \infty}^{+ \infty} \xi^{n}\ e^{- a\ (\xi-b)^{2}}\ d \xi = \int_{- \infty}^{+ \infty} \frac{1}{\sqrt{a}}\ (\frac{x}{\sqrt{a}} + b)^{n}\ e^{- x^{2}}\ d x = \int_{- \infty}^{+ \infty} f(x)\ e^{- x^{2}}\ d x\ (1) $

Second if You use $H_{2} (x) = 4\ x^{2} - 2$ is $x_{k} = \pm \frac{1}{\sqrt{2}}$ and $A_{k} = \frac{\sqrt{\pi}}{2}$, so that we have... $\displaystyle \int_{- \infty}^{+ \infty} e^{- a\ (\xi-b)^{2}}\ d \xi = \sqrt{\frac{\pi}{a}}\ (2)$

$\displaystyle \int_{- \infty}^{+ \infty} \xi\ e^{- a\ (\xi-b)^{2}}\ d \xi = b\ \sqrt{\frac{\pi}{a}}\ (3)$

$\displaystyle \int_{- \infty}^{+ \infty} \xi^{2}\ e^{- a\ (\xi-b)^{2}}\ d \xi = \sqrt{\frac{\pi}{a}}\ (\frac{1}{2\ a} + b^{2})\ (4)$

$\displaystyle \int_{- \infty}^{+ \infty} \xi^{3}\ e^{- a\ (\xi-b)^{2}}\ d \xi = \sqrt{\frac{\pi}{a}}\ (\frac{3\ b}{2\ a} + b^{3})\ (5)$

Now if You intend to compute the integral for n=4 or n=5 You must use $H_{3} (x) = 8\ x^{3} - 12\ x$...

Kind regards$\chi$ $\sigma$
 
Ahhh thank you much for going through that. It makes a lot more sense to me now.
 

Similar threads

Back
Top