# Numerical Integration

1. Aug 8, 2008

### hpriye

Hello

I have the following question in numerical integration in higher dimension. Any help/suggestion would be welcome.

The integral is ( I am using maple notation ):

int( int( int( int( int( int( f(x,y,z), z=-infinity..w), w=-infinity..infinity),
y=-infinity..v), v=-infinity..infinity),
x=-infinity..u), u=-infinity..infinity);

The integral is convergent. Indeed f(x,y,z) = K*exp(-( x^2+(y-x)^2+(z-y)^2) )/2), where K is a given constant.

Thanks in advance

Kind regards
hpriye

2. Aug 8, 2008

### Staff: Mentor

And you are asking about... ?

Could be I am missing something obvious, it happens, but I see only statements, no questions.

3. Aug 8, 2008

### HallsofIvy

Staff Emeritus
What is your question? Surely it is not just "how do you do a numerical integration"! That is much too broad.

4. Aug 8, 2008

### hpriye

I am sorry, I thought it obvious that I was asking for a numerical method for evaluating the 6 dimension integral.

Many thanks in advance
hpriye

5. Aug 8, 2008

### arildno

Hmm..I would first restrict the infinity to a radial variable, i.e, switch to spherical coordinates and see what simplifications, if any, that would give me.

6. Aug 8, 2008

### hpriye

Ok. I tried the following transformation:

x = r*cos(theta)*cos(phi)
y = r*cos(theta)*(cos(phi) + sin(phi))
z = r*cos(theta)*(cos(phi) + sin(phi)) + r*sin(theta)

and the Jacobian is -r^2*cos(theta). This means I am retaining the variables u,v,w as they are.

Now the question: what are the limits for the six variables: r, theta, phi, u, v, w?

Another question: Is there a transformation for removing u, v, w from being present in the limits?

Kind regards and many thanks
hpriye

7. Aug 8, 2008

### tiny-tim

Hi hpriye!

The integral is over all x and u with -∞ < x < u < ∞, so:

$$\int_{-\infty}^{\infty} \int_{-\infty}^u f(x,y,x) dx du\ =\ \int_{-\infty}^{\infty} f(x,y,x)\left(\int_x^{\infty} du\right) dx\ =\ \infty$$

or have I misunderstood the question?

8. Aug 8, 2008

### hpriye

More than misunderstanding I would say misreading :(

hpriye

9. Aug 8, 2008

### ice109

i would use monte carlo integration. how about you write out your integral in tex so we can all understand it

10. Aug 8, 2008

### tiny-tim

Nope … can't be misreading …

'cos I don't read maple!

… is it canadian?

… i know tex is texan …

11. Aug 9, 2008

### hpriye

∫_(-∞)^∞▒∫_(-∞)^u▒∫_(-∞)^∞▒∫_(-∞)^v▒∫_(-∞)^∞▒∫_(-∞)^w▒〖f(x,y,z) dz dw dy dv dx du〗

f(x,y,z)=1/〖√2π〗^3 e^(-1/2(x^2+(y-x)^2+(z-y)^2))-1/√6 e^(-x^2/2-y^2/4-z^2/6)

I have tried to give the MsWord 2007 format. Hope it is readable! Underscore stands for subscript and ^ stands for superscript

Kind regards
hpriye

12. Aug 9, 2008

### tiny-tim

in texas we say …

Hi hpriye!

If you mean $$\int_{-\infty}^{\infty}\int_{-\infty}^u\int_{-\infty}^{\infty}\int_{-\infty}^v\int_{-\infty}^{\infty}\int_{-\infty}^w f(x,y,z)\,dz dw dy dv dx du$$

$$f(x,y,z)\ =\ \frac{1}{(2\pi)^3} e^{-1/2(x^2+(y-x)^2+(z-y)^2)}\ -\ \frac{1}{\sqrt{6}}e^{-(\frac{1}{2}x^2\,-\,\frac{1}{4}y^2\,-\,\frac{1}{6}z^2)}$$

it's:

[noparse]$$\int_{-\infty}^{\infty}\int_{-\infty}^u\int_{-\infty}^{\infty}\int_{-\infty}^v\int_{-\infty}^{\infty}\int_{-\infty}^w f(x,y,z)\,dz dw dy dv dx du$$

$$f(x,y,z)\ =\ \frac{1}{(2\pi)^3} e^{-1/2(x^2+(y-x)^2+(z-y)^2)}\ -\ \frac{1}{\sqrt{6}}e^{-(\frac{1}{2}x^2\,-\,\frac{1}{4}y^2\,-\,\frac{1}{6}z^2)}$$[/noparse]

13. Aug 9, 2008

### hpriye

Re: in texas we say …

Yes, exactly. But I observed square root symbol is missing, even in the original typesetting. It should be (sqrt(2*pi))^3. Thank you very much!

Kind regards
hpriye

14. Aug 9, 2008

### tiny-tim

Re: in texas we say …

hmm … so it's:

$$\int_{-\infty}^{\infty}\int_{-\infty}^u\int_{-\infty}^{\infty}\int_{-\infty}^v\int_{-\infty}^{\infty}\int_{-\infty}^w f(x,y,z)\,dz dw dy dv dx du$$

$$f(x,y,z)\ =\ \frac{1}{(2\pi)^\frac{3}{2}} e^{-1/2(x^2+(y-x)^2+(z-y)^2)}\ -\ \frac{1}{\sqrt{6}}e^{-(\frac{1}{2}x^2\,-\,\frac{1}{4}y^2\,-\,\frac{1}{6}z^2)}$$

with an extra:

[noparse]$$\frac{3}{2}$$[/noparse]

15. Aug 9, 2008

### MrSnoopy

Hi hypre.

As you already know this task is not so simple to solve because of multi-integration. First it is very useful and not so painful see whether first integral exists:

$$\Theta(u,x,v,y,w)=\int_{-\infty}^{w} f(u,x,v,y,w,z) dz = \frac{1}{2}e^{-\frac{x^2}{2}-\frac{y^3}{4}}\;\sqrt{\pi} \left(1+Erf(\frac{w}{\sqrt{6}}) \right) + \frac{1}{4\pi}\; e^{-x^2+xy-\frac{y^2}{2}} \left(1+Erf(\frac{w-y}{\sqrt{2}}) \right)$$

Integrals would exist if $$u,v,w \in (-\infty,0)$$ otherwise integrals diverge !
You can see that if above integral split on two integrals
$$\int_{-\infty}^{0} \Theta(u,x,v,y,w)\; dw = 0.586571 + O(10^{-6})$$
$$\int_{0}^{\infty} \Theta(u,x,v,y,w)\; dw \rightarrow \bf{\infty}$$

Trick how to see whether this exist to plot it. Put $$x=y=1$$ as you already know $$x \in (-\infty,\infty)$$ and $$y \in (-\infty,\infty)$$. I made also graph so see what is the shape of function and is attached to this answer.

If you don't understand just send me email and I will try to explain.

Enjoy
MrSnoopy

#### Attached Files:

• ###### exist1.png
File size:
18.8 KB
Views:
58
16. Aug 9, 2008

### MrSnoopy

Sorry I forgot to mention numerical solution $$= 0.586571 + ...$$ comes form $$x=y=1$$. It is only to see that first has numerical solution other diverge.

17. Aug 12, 2008

### hpriye

Thankyou very much for your efforts!

One important aspect of this integral is this: It belongs to a class of integrals which apparantly diverge, but not in the real sense.

For example define two functions
$$f(x)\ =\ x^2 + e^{-x^2} \$$ and
$$g(x)\ =\ x^2 + e^{-2 x^2} \$$
then individually the two integrals:
$$\int_{-\infty}^\infty f(x)\ dx$$ and $$\int_{-\infty}^\infty g(x)\ dx$$ diverge but $$\int_{-\infty}^\infty (f(x)-g(x))\ dx = \sqrt{\pi} - \sqrt{\frac{\pi}{2}}$$

Similarly, the six-dimensional integral has another 3 dimension integral in the denominator (which I have not posted or mentioned earlier) such that the ratio is a finite number, in a limiting sense. I know this is a very very complicated integral, which naturally arises while solving problems in financial mathematics, so what I am interested in is, a numerical method to handle such integrals involving limiting case:

$$\lim_{a \rightarrow \infty} \left(\frac{\int_{-a}^a \int_{-a}^u \int_{-a}^a \int_{-a}^v \int_{-a}^a \int_{-a}^w \nu(x,y,z) \ dw\ dz\ dv\ dy\ dx\ du}{\int_{-a}^a \int_{-a}^a \int_{-a}^a \delta(x,y,z) \ dz\ dy\ dx} \right)$$

Kind regards and thanks to one and all.
hpriye

Last edited: Aug 12, 2008
18. Aug 12, 2008

### MrSnoopy

No problem.

I would solved it by Simpsons method, has good accuracy at low number of steps. Don't forget functions are very quick

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook