Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Is there a formula for this gaussian integral

  1. Apr 28, 2014 #1
    Is there a formula for this gaussian integral:

    $$int_{-\infty}^{\infty}{x^4}{e^{-a(x-b)^2}}dx$$

    I've tried wikipedia and they only have formulas for the integrand with only x*e^... not x^4e^...
    Wolframalpha won't do it either, because I actually have an integral that looks just like that, unknown constants and all.
     
  2. jcsd
  3. Apr 28, 2014 #2

    Matterwave

    User Avatar
    Science Advisor
    Gold Member

    Well, we know that:

    $$\int_{-\infty}^\infty e^{-bx^2}dx=\sqrt{\frac{\pi}{b}}$$

    Taking some derivatives:

    $$\frac{d^2}{db^2}\int_{-\infty}^\infty e^{-bx^2}dx=\int_{-\infty}^{\infty}x^4e^{-bx^2}dx=\frac{3}{4}\frac{\sqrt{\pi}}{b^{5/2}}$$

    I'm not sure if you can use this for your integral, but it looks possible.
     
  4. Apr 28, 2014 #3
    Sorry, but you can't :/
     
  5. Apr 28, 2014 #4

    vanhees71

    User Avatar
    Science Advisor
    2016 Award

    Matterwave's answer is correct!
     
  6. Apr 28, 2014 #5

    pwsnafu

    User Avatar
    Science Advisor

    You are basically just asking for the moments of the normal distribution. These are well known:
    [tex]\int_{-\infty}^{\infty} \frac{x^p}{\sigma \sqrt{2\pi}} e^{-(x-\mu)^2 / (2 \sigma^2)} dx= \sigma^p (p-1)! [/tex]
    when p is even, and zero when p is odd.

    So ##p=4##, ##\sigma = \frac{1}{\sqrt{2a}}## and ##\mu = b##, which gives ##\frac{3\sqrt{\pi}}{4 a^{5/2}}## as Matterwave gave.
     
  7. Apr 28, 2014 #6
    I'm sorry i just dont think that's correct. Try wolframalpha. I know the formulas for the x, x^2, x^3 cases, but not the x^4. But everything up to x^3 agrees with wolframalpha's output, and this formula you guys are giving doesnt look very similar and does not agree.
    $$\int_{-\infty}^{\infty}{x}e^{-a(x-b)^2}dx=b\sqrt{\frac{\pi}{a}}$$
    $$\int_{-\infty}^{\infty}{x^2}e^{-a(x-b)^2}dx=(\frac{1}{2a}+b^2)\sqrt{\frac{\pi}{a}}$$
    $$\int_{-\infty}^{\infty}{x^3}e^{-a(x-b)^2}dx=(\frac{3b}{2a}+b^3)\sqrt{\frac{\pi}{a}}$$
    There's a pattern here but I can't figure it out.
     
  8. Apr 28, 2014 #7

    pwsnafu

    User Avatar
    Science Advisor

    I'm an idiot, I looked up the central moments (and even that's wrong because it should be ##(p-1)!!##). The non-central moments are

    ##\mu##
    ##\mu^2+\sigma^2##
    ##\mu^3+3\mu\sigma^2##
    ##\mu^4+6\mu^2\sigma^2+3\sigma^4##,
    for p = 1, 2, 3, and 4. Those should agree with what you have.
     
  9. Apr 28, 2014 #8
    Ahhh thank you thank you thank you! That works 100%! Man I've been trying to get this formula for a week...I really appreciate it.
     
  10. Apr 28, 2014 #9
    The "freshman calculus" way to do this is to integrate by parts:
    [tex]u = x^3 \qquad dv = xe^{-x^2}\,dx[/tex]so that
    [tex]du = 3x^2 \qquad v = -{1 \over 2}e^{-x^2}[/tex]and now the degree of the polynomial has been reduced by 2.

    Now, that is for the case where a and b are 0, but the other cases are really the same. You just have to change variables; then you will have a more complicated polynomial in place of [itex]x^4[/itex], but once you know how to do [itex]\int x^{2k}e^{-x^2}[/itex] you can integrate any polynomial times [itex]e^{-x^2}[/itex].
     
  11. Apr 28, 2014 #10

    Matterwave

    User Avatar
    Science Advisor
    Gold Member

    Another clever way to do this integral is to look at the characteristic function for a Gaussian distribution:

    $$C(t)\equiv\left<e^{itx}\right>=\frac{1}{\sigma\sqrt{2\pi}} \int_{-\infty}^{\infty}e^{itx}e^{-(x-\mu)^2/2\sigma^2}$$

    You can do this integral by completing the square in the exponential, or by just looking it up. You will find:

    $$C(t)=e^{it\mu-\frac{1}{2}t^2\sigma^2}$$

    You can expand this function in powers of t, and match it to the expansion of:

    $$\left<e^{itx}\right>\approx 1+\left<itx\right>+\frac{\left<(itx)^2\right>}{2}+...$$

    If you match the powers of t on both sides, you can get all the general moments of the Gaussian distribution. You can get all the odd ones too, for which the formula I gave earlier would no longer work. This Characteristic function is closely related to the moment generating function, but I'm more familiar with working with these.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Is there a formula for this gaussian integral
  1. Gaussian integral . (Replies: 8)

  2. Gaussian Integral (Replies: 1)

Loading...