General formula for this weird Gaussian integral?

In summary: Kind regards$\chi$ $\sigma$In summary, there is a formula for Gaussian integrals of the form $$\int_{-\infty}^{\infty}{x^n}{e^{-a(x-b)^2}}dx$$ which can be found by using the method of partial integration. This formula involves the use of Hermite polynomials and their corresponding zeros and coefficients, as well as the standard formula for the normal distribution. It is also possible to express this formula in terms of the moments of the normal distribution using the confluent hypergeometric function.
  • #1
skate_nerd
176
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
  • #2
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.
 
  • #3
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:
  • #4
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:
  • #5
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...
 
  • #6
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 \(\displaystyle a>0\) you are essentially asking for the moments \(\displaystyle {\rm{E}}(X^n)\) of the normal distribution, which may be written in terms of the confluent hypergeometric function \(\displaystyle U(\alpha,\beta,z)\).

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

.
 
  • #7
@ 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.
 
  • #8
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$
 
  • #9
Ahhh thank you much for going through that. It makes a lot more sense to me now.
 

FAQ: General formula for this weird Gaussian integral?

What is the general formula for a Gaussian integral?

The general formula for a Gaussian integral is ∫-∞ e-x2dx. This formula can be used to calculate the area under the curve of a Gaussian distribution, also known as a bell curve.

How is the general formula for a Gaussian integral derived?

The general formula for a Gaussian integral is derived using techniques from calculus, specifically integration by parts and the substitution method. The derivation involves transforming the integral into a standard form and then using the substitution method to solve for the integral.

What is the significance of the Gaussian integral in science?

The Gaussian integral has many applications in science, including in statistics, physics, and engineering. It is commonly used to calculate probabilities and areas under normal distributions, and it also appears in many physical laws and equations, such as the Schrödinger equation in quantum mechanics.

Can the general formula for a Gaussian integral be solved analytically?

Yes, the general formula for a Gaussian integral can be solved analytically. However, the solution involves an infinite series, which can be difficult to calculate by hand. Therefore, numerical methods are often used to approximate the solution.

What are some real-life examples of the Gaussian integral?

The Gaussian integral can be seen in various real-life situations, such as in the measurement of errors and uncertainties in scientific experiments, in the calculation of probabilities in statistics, and in the analysis of data in finance and economics. It is also used in signal processing and image filtering to smooth out noise and enhance signals.

Similar threads

Back
Top