# Thread: integration of a 2D gaussian function

1. ## integration of a 2D gaussian function

Hello

I need to integrate a 2D gaussian function with the gaussian offset by a length b (this creates an annular ring gaussian function with a zero magnitude central region) the function is:

$\displaystyle I=I_0\exp{\frac{-2(r-b)^2}{w^2}}$

and I want to integrate wrt. r and wrt. theta (since this is a rotationally symetric function around r=0), from 0 to infinity and from 0 to 2 Pi

I also need to know how the total area under the following function equates to the answer underneath. Whenever i've tried to integrate this its always come up with some error function which doesn't help me since I need to know a real value for P(infty) given the other variables.

$\displaystyle I=I_0*\exp{\frac{-2r^2}{w^2}}$

$\displaystyle P(\infty)=\frac{I_0w^2\pi}{2}$

Dan

PS please let me know if I've been unclear. Basically i need to know the area under each function (in closed form so that I can get a value) given that the functions are to be rotated 360 around r=0 to sweep out a 2d shape.

2. Originally Posted by brandnewdan
Hello

I need to integrate a 2D gaussian function with the gaussian offset by a length b (this creates an annular ring gaussian function with a zero magnitude central region) the function is:

$\displaystyle I=I_0\exp{\frac{-2(r-b)^2}{w^2}}$

and I want to integrate wrt. r and wrt. theta (since this is a rotationally symetric function around r=0), from 0 to infinity and from 0 to 2 Pi

I also need to know how the total area under the following function equates to the answer underneath. Whenever i've tried to integrate this its always come up with some error function which doesn't help me since I need to know a real value for P(infty) given the other variables.

$\displaystyle I=I_0*\exp{\frac{-2r^2}{w^2}}$

$\displaystyle P(\infty)=\frac{I_0w^2\pi}{2}$

Dan

PS please let me know if I've been unclear. Basically i need to know the area under each function (in closed form so that I can get a value) given that the functions are to be rotated 360 around r=0 to sweep out a 2d shape.
If you were integrating from r = b to infinity the answer is simple, but not from r = 0 to infinity. What you want to do cannot be done without using the Error function Erf(r). Read: Error function - Wikipedia, the free encyclopedia

Why not just integrate using a numerical procedure .....?

You don't define the function P anywhere so I can't make informed comment on the rest of your question.

3. The function P is just the integral of I=.... at infinity (or so i'm told).

4. Originally Posted by brandnewdan
The function P is just the integral of I=.... at infinity (or so i'm told).
Definite integrals have an upper and lower terminal. You imply that the upper terminal is infinity. What's the lower terminal? If it's 0 (or negative infinity) then the reading I've recommended will give you the answer. If it's anything else then it can't be done without either using the error function Erf(r) or using a numerical preocedure.

5. Thanks for the reply. It is the integral from 0 to infinity (and from 0 to 2Pi), but I was after the solution and the steps used to get there - sorry but I couldn't find the answer in the wikipedia erf reference you posted.

Thanks again for taking the time to reply

Dan

6. Originally Posted by brandnewdan
Thanks for the reply. It is the integral from 0 to infinity (and from 0 to 2Pi), but I was after the solution and the steps used to get there - sorry but I couldn't find the answer in the wikipedia erf reference you posted.

Thanks again for taking the time to reply

Dan
Are you trying to find $\displaystyle \int_{0}^{\infty} e^{\frac{-2r^2}{w^2}} \, dr$ ?

7. After returning from holidays I think I have a better idea about what I want to do now.

Its:

$\displaystyle \int_{0}^{2\pi} \int_{0}^\infty e^\frac{-2(r-b)^2}{w^2} r d\theta dr$

Its much simpler to put it this way - I think I may have confused with what I've written before.

Many Thanks again

Dan

8. So just to be clear - its that integral I can't quite get my head around. If anyone could crack it and post the answer then I would be over the moon.

Dan

9. Originally Posted by brandnewdan
After returning from holidays I think I have a better idea about what I want to do now.

Its:

$\displaystyle \int_{0}^{2\pi} \int_{0}^\infty e^\frac{-2(r-b)^2}{w^2} r d\theta dr$

Its much simpler to put it this way - I think I may have confused with what I've written before.

Many Thanks again

Dan
The answer is $\displaystyle 2 \pi \int_{0}^\infty e^\frac{-2(r-b)^2}{w^2} \, r \, dr$ so the real question is what's $\displaystyle I = \int_{0}^\infty e^\frac{-2(r-b)^2}{w^2} \, r \, dr$ ......

Consider the substitution $\displaystyle u = \frac{\sqrt{2}(r - b)}{w} \Rightarrow dr = \frac{w}{\sqrt{2}}u$. Then:

$\displaystyle I = \frac{w^2}{2} \int_{b}^{+\infty} e^{-u^2} u \, du + \frac{wb}{\sqrt{2}} \int_{b}^{+\infty} e^{-u^2} \, du$.

The first integral is easy to get a value for. But the second requires using the Error Function.