How to Solve a Higher Dimensional Numerical Integration Using Maple Notation?

In summary: you are very welcome! :wink: :)\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 duf(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}{
  • #1
hpriye
7
0
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
 
Mathematics news on Phys.org
  • #2
And you are asking about... ?

Could be I am missing something obvious, it happens, but I see only statements, no questions.
 
  • #3
What is your question? Surely it is not just "how do you do a numerical integration"! That is much too broad.
 
  • #4
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
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
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


arildno said:
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.
 
  • #7
hpriye said:
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);

Hi hpriye! :smile:

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

[tex]\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[/tex]

or have I misunderstood the question? :confused:
 
  • #8
More than misunderstanding I would say misreading :(

hpriye


tiny-tim said:
Hi hpriye! :smile:

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

[tex]\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[/tex]

or have I misunderstood the question? :confused:
 
  • #9
i would use monte carlo integration. how about you write out your integral in tex so we can all understand it
 
  • #10
hpriye said:
More than misunderstanding I would say misreading :(

Nope … can't be misreading …

'cos I don't read maple! :biggrin:

… is it Canadian? :confused:

… i know tex is texan … :rolleyes:
 
  • #11
ice109 said:
i would use monte carlo integration. how about you write out your integral in tex so we can all understand it

∫_(-∞)^∞▒∫_(-∞)^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
in texas we say …

hpriye said:
∫_(-∞)^∞▒∫_(-∞)^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

Hi hpriye! :smile:

If you mean [tex]\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[/tex]

[tex]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)}[/tex]

it's:

[noparse][tex]\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[/tex]

[tex]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)}[/tex][/noparse]
 
  • #13


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

tiny-tim said:
Hi hpriye! :smile:

If you mean [tex]\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[/tex]

[tex]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)}[/tex]

it's:

[noparse][tex]\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[/tex]

[tex]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)}[/tex][/noparse]
 
  • #14


hmm … so it's:

[tex]\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[/tex]

[tex]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)}[/tex]

with an extra:

[noparse][tex]\frac{3}{2}[/tex][/noparse] :wink:
 
  • #15
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: :smile:

[tex] \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)
[/tex]

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

Trick how to see whether this exist to plot it. Put [tex] x=y=1 [/tex] as you already know [tex] x \in (-\infty,\infty)[/tex] and [tex]y \in (-\infty,\infty)[/tex]. 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 :smile:
MrSnoopy
 

Attachments

  • exist1.png
    exist1.png
    13.8 KB · Views: 357
  • #16
Sorry I forgot to mention numerical solution [tex]= 0.586571 + ...[/tex] comes form [tex]x=y=1[/tex]. It is only to see that first has numerical solution other diverge.
 
  • #17
MrSnoopy said:
Sorry I forgot to mention numerical solution [tex]= 0.586571 + ...[/tex] comes form [tex]x=y=1[/tex]. It is only to see that first has numerical solution other diverge.

Thankyou very much for your efforts!

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

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

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:

[tex] \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) [/tex]

Kind regards and thanks to one and all.
hpriye
 
Last edited:
  • #18
No problem.

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

Related to How to Solve a Higher Dimensional Numerical Integration Using Maple Notation?

1. What is numerical integration?

Numerical integration is a method used to approximate the value of a definite integral, which is the area under a curve on a graph. It involves dividing the area into smaller, simpler shapes and adding their individual areas together.

2. Why is numerical integration important?

Numerical integration is important because it allows us to solve complicated mathematical problems that cannot be solved analytically. It is commonly used in physics, engineering, and other scientific fields to estimate values of integrals.

3. What are the different types of numerical integration?

The two main types of numerical integration are the Newton-Cotes formulas, which use fixed points to approximate the integral, and the Gaussian quadrature method, which uses a weighted sum of values at specific points to approximate the integral. Other types include the Trapezoidal rule and Simpson's rule.

4. What factors affect the accuracy of numerical integration?

The accuracy of numerical integration depends on the number of intervals used to divide the area, the type of integration method used, and the smoothness of the function being integrated. Generally, using a larger number of intervals and a more precise integration method will result in a more accurate approximation.

5. What are the applications of numerical integration?

Numerical integration has various applications in mathematics, physics, engineering, and other fields. It is commonly used to calculate areas, volumes, and other physical quantities, as well as in data analysis and computer modeling. It is also essential in solving differential equations and other complex mathematical problems.

Similar threads

Replies
9
Views
2K
  • General Math
Replies
1
Views
720
Replies
3
Views
1K
Replies
1
Views
759
Replies
3
Views
598
Replies
2
Views
193
Replies
11
Views
293
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
Back
Top