1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Gaussian function integral

  1. Oct 12, 2013 #1
    Is it possible to obtain a sigma function or Taylor series function for the indefinite integral of a general Gaussian function? If not, why not, and if so, where can I find this infinite series solution?

    By general Gaussian function I mean

    [tex]f(x) = a \cdot e^{-\frac{(x-b)^2}{2c^2}} + d[/tex]
     
  2. jcsd
  3. Oct 12, 2013 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    If you want to expand out f(x) into an infinite series and integrate term by term, you can certainly do that.

    Happily, others have done that for you. Check out Abramowitz and Stegun, p. 931 and following:

    http://people.math.sfu.ca/~cbm/aands/page_931.htm
     
  4. Oct 12, 2013 #3

    lurflurf

    User Avatar
    Homework Helper

    What sigma function do you mean The sum-of-divisors function σ(n), Weierstrass sigma function, Kronecker's sigma function, Rado's sigma function? Not sure any of those help. Indefinite integrals of Gaussians are often expressed in terms of special functions like the error function, the Faddeeva function, the Q-function, the normal cumulative distribution function, the Dawson function, and others. Such functions can be computed with tables, calculators, or computers. There are infinite series as well.
     
  5. Oct 13, 2013 #4
    I am afraid that I can't see where in the link the infinite series form of the general Gaussian I wrote is presented? Which of the equations is it, and if it's not given there, could you possibly suggest what the infinite series itself would be? I can work on integrating it separately if the integral is unavailable.
     
  6. Oct 13, 2013 #5

    lurflurf

    User Avatar
    Homework Helper

    ^Did you keep reading? The power series is on page 932. There are some other good things past that. That you might be interested in. Your form is not common, can you write your integral in terms of P?

    $$\mathrm{P}(x)=\frac{1}{\sqrt{2 \pi}}\int_{-\infty}^x \! e^{-t^2/2} \, \mathrm{dt} = \frac{1}{2} + \frac{1}{\sqrt{2 \pi}} \sum_{n=0 } ^\infty \frac{ (-1)^n x^{2n+1} }{n! 2^n (2n+1)}$$
     
    Last edited: Oct 13, 2013
  7. Oct 13, 2013 #6

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    He apparently wants the power series of e-x2 rather than of the CDF.

    This is trivial, Big Daddy. You are making it much more complex than needed by adding those terms a, b, c, and d. Just develop the power series of e-x2 and then substitute.
     
  8. Oct 13, 2013 #7
    So this is the integral of the normalized distribution function? Ok but there are two remaining issues with it: 1) it is a definite integral whereas as in the OP I am looking for an indefinite integral; 2) it applies to a function where a, b, c, d are all treated as 1.

    So first I have to develop this infinite series expansion of e-x2; then substitute in for a, b, c and d, to find the infinite series expansion of my OP function; then integrate each term with respect to x? Let me start about the task and I will post here when I hit a barrier.
     
  9. Oct 13, 2013 #8

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Oh. You do want the integral. I misread. Nonetheless, using the expansion of e-x2 is a good place to start.

    Is this homework?
     
  10. Oct 14, 2013 #9
    No. In fact I've heard from various sources it is not even possible (note please as I said I am looking for the indefinite, not infinite, integral). But since you guys are saying it is, I thought I would follow up with you.

    So then

    [tex]e^{-x^2} = \sum\limits_{j = 0}^\infty {\frac{(-x^2)^j}{j!}}[/tex]

    What next?
     
  11. Oct 14, 2013 #10

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Of course it's possible. Your various sources are probably assuming that since ∫e-x2dx cannot be expressed in "closed form" (a finite set of operations involving elementary functions) that it can't be expressed as an infinite series, either. That's just wrong. It's easy to express that integral as an infinite series.


    That series is absolutely convergent, so you can integrate it term by term. Voila! ∫e-x2dx as an infinite series. You do need to check whether the series is convergent (which it is).
     
  12. Oct 14, 2013 #11

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    'Street math' like 'Street physics' is not to be trusted.
     
  13. Oct 16, 2013 #12
    Ok so I found that the integral as an infinite series is

    [tex]\sum\limits_{j = 0}^\infty {\frac{x(-x^2)^j}{2jj!+j!}}[/tex]

    What is the generalization of this to the case in the OP?
     
  14. Oct 16, 2013 #13
    What do you mean by that?
     
  15. Oct 17, 2013 #14

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    The final additive constant d is just noise, as is the multiplicative factor of a. Substitute x with (x-b)/(√2 c) in the series you wrote and you have the series representation of e(x-b)2/(2c2).
     
  16. Nov 4, 2013 #15
    Wouldn't this be the series representation of the integral of e(x-b)2/(2c2) dx rather than of e(x-b)2/(2c2) itself?

    And to modify for a and d we just need to multiply the above integral by a and add a +dx term (d being the symbol in the OP not the differential operator) to the end?
     
  17. Nov 4, 2013 #16

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    People hear this or that from various unnamed sources and believe what they hear without verification. It's the equivalent of circulating a rumor: the rumor could sound entirely plausible but be totally untrue, and this situation will not become apparent unless some attempt is made to verify the rumor. That's why scientific writing is chock full of proofs and references, to avoid having misconceptions or outright falsehoods breed and propagate, preventing people from utilizing science correctly and sometimes not at all. The latter is what happened to you, albeit temporarily, until you got the straight dope here at PF.
     
  18. Nov 4, 2013 #17

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Sorry about that. I omitted the integral sign (and dx). I also omitted a factor of ##2c## because the u substitution ##u = \frac {x-b} {2c}## means that ##dx = 2c\,du##.

    Correct.

    Or you could just use the error function erf(x):
    [tex]
    \int \left( a e^{-\left( \frac {x-b}{2c} \right)^2} + d \right)\, dx =
    \sqrt{\pi} \, a c \operatorname{erf} \left( \frac {x-b}{2c} \right) + dx
    [/tex]

    erf(x) is a non-elementary "special function" -- something that comes up so very often that it deserves a special name. You'll be able to find erf(x) as a library function in C/C++, Fortran, python, matlab, Mathematica, maple, and even Excel.
     
  19. Nov 4, 2013 #18
    Thanks. So the final solution would be

    [tex]a \cdot \sum\limits_{j = 0}^\infty {\frac{\frac{x-b}{\sqrt{2}c} \cdot (-\frac{(x-b)^2}{2c^2})^j}{2jj!+j!}} + dx[/tex]

    For the integral in the OP?
     
  20. Nov 4, 2013 #19

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    You dropped some multiplicative factors. That should be
    $$dx + a c \surd 2
    \sum_{k=0}^{\infty}
    \frac
    {(-1)^k \bigl( \frac {x-b}{\surd 2 c} \bigr)^{2k+1}}
    {(2k+1)k!}
    $$

    Or, much more simply,

    $$dx + \sqrt{\frac {\pi} 2} \, a c \, \operatorname{erf}\bigl( \frac {x-b}{\surd 2 c} \bigr)$$
     
  21. Nov 4, 2013 #20
    Why don't we just expand [itex]e^{u}[/itex] as it's Taylor series, and then just integrate. When I do that, I get:

    [tex]\int a e^{-\frac{(x-b)^2}{2 c^2}}+d=a\left(x+\sum_{n=1}^{\infty} \frac{(-1)^n (x-b)^{2n+1}}{(2n+1) 2^n c^{2n} n!}\right)+dx+k[/tex]

    Now, let's check that with:

    [tex]\int_1^5 \left(a e^{-\frac{(x-b)^2}{2 c^2}}+d\right) dx[/tex]

    with: a=1/2, b=2/3, c=4/5, and d=-6:

    Code (Text):

    In[1347]:=
    a = 1/2;
    b = 2/3;
    c = 4/5;
    d = -6;
    f[x_] := a*Exp[-((x - b)^2/(2*c^2))] + d;
    NIntegrate[f[x], {x, 1, 5}]
    mysum[x_] :=
      a*(x + Sum[((-1)^n*(x - b)^(2*n + 1))/
           ((2*n + 1)*2^n*c^(2*n)*n!), {n, 1, 50}]) +
       d*x
    N[mysum[5] - mysum[1]]

    Out[1352]=
    -23.660641545629247

    Out[1354]=
    -23.660641542363546
     
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Gaussian function integral
  1. Gaussian Integration (Replies: 1)

  2. Gaussian Function (Replies: 5)

  3. Gaussian functions? (Replies: 7)

  4. Gaussian Integration (Replies: 1)

Loading...