Gaussian function integral

In summary, it is possible to obtain a sigma function or Taylor series function for the indefinite integral of a general Gaussian function. This can be found in Abramowitz and Stegun, page 932 and following, where the power series of e-x2 is presented. By substituting x with (x-b)/(√2 c) in the series, it becomes the series representation of e(x-b)2/(2c2). Multiplying this by a and adding a +dx term (d being the symbol in the original problem) would modify it for the general Gaussian function.
  • #1
Big-Daddy
343
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]
 
Mathematics news on Phys.org
  • #2
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
 
  • #3
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.
 
  • #4
SteamKing said:
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

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
^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:
  • #6
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.
 
  • #7
lurflurf said:
^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.

D H said:
Just develop the power series of e-x2 and then substitute.

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.
 
  • #8
Oh. You do want the integral. I misread. Nonetheless, using the expansion of e-x2 is a good place to start.

Is this homework?
 
  • #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?
 
  • #10
Big-Daddy said:
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.
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.
So then

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

What next?
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).
 
  • #11
'Street math' like 'Street physics' is not to be trusted.
 
  • #12
D H said:
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).

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
SteamKing said:
'Street math' like 'Street physics' is not to be trusted.

What do you mean by that?
 
  • #14
Big-Daddy said:
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?
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).
 
  • #15
D H said:
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(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?
 
  • #16
Big-Daddy said:
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?

SteamKing said:
'Street math' like 'Street physics' is not to be trusted.

Big-Daddy said:
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
Big-Daddy said:
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?
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##.

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?
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.
 
  • #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?
 
  • #19
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)$$
 
  • #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:
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
Thanks for the help. I take it the two solutions above are ultimately equivalent though they do not obviously seem so to me.

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
Big-Daddy said:
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
jackmell said:
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.

jackmell said:
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
I do not know how to prove or disprove the sum converges to the value of the improper integral.
 
Last edited:

What is a Gaussian function integral?

A Gaussian function integral is a type of mathematical integral that involves the use of a Gaussian function, also known as a normal distribution. It is used to calculate the area under the curve of a Gaussian function, which can be represented by a bell-shaped curve.

What is the formula for a Gaussian function integral?

The formula for a Gaussian function integral is ∫e^(-x^2/2)dx, where e is the base of the natural logarithm and x is the variable of integration.

What is the significance of the Gaussian function in science?

The Gaussian function is commonly used in science because it accurately describes the distribution of many natural phenomena, such as the distribution of particle velocities in a gas or the distribution of errors in measurements. It is also used in signal processing and image processing applications.

How is a Gaussian function integral calculated?

A Gaussian function integral can be calculated using various methods, such as numerical integration or using special functions such as the error function. It can also be approximated using the trapezoidal rule or Simpson's rule.

What are some real-life applications of Gaussian function integrals?

Gaussian function integrals have numerous real-life applications, including in fields such as physics, chemistry, biology, economics, and engineering. They are used to model and analyze data in a variety of contexts, such as predicting stock market trends, studying population growth, and analyzing the spread of diseases.

Similar threads

Replies
2
Views
2K
Replies
18
Views
2K
Replies
3
Views
222
Replies
4
Views
414
  • General Math
Replies
2
Views
742
Replies
2
Views
1K
  • General Math
Replies
23
Views
2K
  • Calculus
Replies
2
Views
1K
Replies
17
Views
2K
Replies
3
Views
708
Back
Top