- #1

- 343

- 1

By general Gaussian function I mean

[tex]f(x) = a \cdot e^{-\frac{(x-b)^2}{2c^2}} + d[/tex]

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- Thread starter Big-Daddy
- Start date

- #1

- 343

- 1

By general Gaussian function I mean

[tex]f(x) = a \cdot e^{-\frac{(x-b)^2}{2c^2}} + d[/tex]

- #2

SteamKing

Staff Emeritus

Science Advisor

Homework Helper

- 12,796

- 1,670

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

- #3

lurflurf

Homework Helper

- 2,440

- 138

- #4

- 343

- 1

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

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.

- #5

lurflurf

Homework Helper

- 2,440

- 138

^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)}$$

$$\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:

- #6

- 15,393

- 686

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

- #7

- 343

- 1

^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)}$$

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.

Just develop the power series of e^{-x2}and then substitute.

So first I have to develop this infinite series expansion of e

- #8

- 15,393

- 686

Is this homework?

- #9

- 343

- 1

So then

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

What next?

- #10

- 15,393

- 686

Of course it's possible. Your various sources are probably assuming that since ∫eNo. 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.

That series is absolutely convergent, so you can integrate it term by term. Voila! ∫eSo then

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

What next?

- #11

SteamKing

Staff Emeritus

Science Advisor

Homework Helper

- 12,796

- 1,670

'Street math' like 'Street physics' is not to be trusted.

- #12

- 343

- 1

That series is absolutely convergent, so you can integrate it term by term. Voila! ∫e^{-x2}dx as an infinite series. You do need to check whether the series is convergent (which it is).

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?

- #13

- 343

- 1

'Street math' like 'Street physics' is not to be trusted.

What do you mean by that?

- #14

- 15,393

- 686

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 eOk 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?

- #15

- 343

- 1

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)}.

Wouldn't this be the series representation of the integral of e

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?

- #16

SteamKing

Staff Emeritus

Science Advisor

Homework Helper

- 12,796

- 1,670

So then

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

What next?

'Street math' like 'Street physics' is not to be trusted.

What do you mean by that?

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.

- #17

- 15,393

- 686

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##.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?

Correct.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?

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.

- #18

- 343

- 1

[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?

- #19

- 15,393

- 686

$$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)$$

- #20

- 1,796

- 53

[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:

```
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
```

- #21

- 343

- 1

This series would not be convergent for the well-known infinite integral (from -infinity to +infinity) of the simple Gaussian (a=1, b=0, c=1, d=0) which gives the famous sqrt(pi) result, would it?

- #22

- 1,796

- 53

This series would not be convergent for the well-known infinite integral (from -infinity to +infinity) of the simple Gaussian (a=1, b=0, c=1, d=0) which gives the famous sqrt(pi) result, would it?

Please provide empirical data to substantiate your claim and shouldn't that be [itex]c=1/\sqrt{2}[/itex]? Do this: code the series in Mathematica and study it's behavior for a larger and larger symmetric interval about the origin as a function of number of terms. That is, say compute the series with 100 terms for an integral in the interval (-5,5), then 500 terms for (-10,10), 5000 terms for (-25,25) and so on. Does the numerical data suggest the series data is converging to [itex]\sqrt{\pi}[/itex] or diverging? By next Monday morning would be fine. :)

Last edited:

- #23

- 343

- 1

Please provide empirical data to substantiate your claim and shouldn't that be [itex]c=1/\sqrt{2}[/itex]?

Yes of course, that's right. Silly mistake.

Do this: code the series in Mathematica and study it's behavior for a larger and larger symmetric interval about the origin as a function of number of terms. That is, say compute the series with 100 terms for an integral in the interval (-5,5), then 500 terms for (-10,10), 5000 terms for (-25,25) and so on. Does the numerical data suggest the series data is converging to [itex]\sqrt{\pi}[/itex] or diverging? By next Monday morning would be fine. :)

I'm afraid that I don't have Mathematica nor any mathematical computing program with this power (unless Excel can somehow integrate, in which case I'm not sure how). I was hoping you could confirm whether or not the integral from -infinity to +infinity will converge to sqrt(pi) but, from a glance looking at the integral, it does not seem to obviously simplify to this answer. We could and should be able to find the sqrt(pi) solution using limits that are approximations of -infinity and +infinity, of course, and watching the result tend to sqrt(pi).

- #24

- 1,796

- 53

I do not know how to prove or disprove the sum converges to the value of the improper integral.

Last edited:

Share: