Gaussian integral in Mathematica

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 11K views
MadMax
Messages
98
Reaction score
0
How can I evaluate something like

[tex]\int^{\infty}_{-\infty} d^3 \mathbf{x} f(\mathbf{x}) e^{t g(\mathbf{x})}[/tex]

in Mathematica, where x is a vector in 3D?
 
Physics news on Phys.org
When you say:

[tex] \int^{\infty}_{-\infty}d^3x[/tex]

It means that you want to integrate over all space, so first you need to pick a set of coordinates (which will probably depend on the coordinates in which you have f(x) and g(x) expressed). If you use Cartesian (the simplest) then

[tex] d^3x = dxdydz[/tex]

and now how you have to do a triple integral (one integral for dx where you think of y and z as constants, one for dy where you think of x and z and constants, and similarly for dz). So the Mathematica code would look like:

Integrate[ Integrate[ Integrate[ f(x,y,z)*Exp[t*g(x)], {x,-Infinity, Infinity}], {y,-Infinity, Infinity}], {z,-Infinity, Infinity}]

Where you have to supply the forms for f(x,y,z) and g(x,y,z).

If, on the other hand, you need to do it in spherical or cylindrical coordinates, then you have to add in a few more factors, which I could explain if you need them. Perhaps you already know all the math and just needed the syntax, in which case I apologize for telling you all this that you already knew, but I figured too much would be better than too little :cool:

Peace,
Jason
 
Last edited:
humm, yeah thanks man. I was hoping there would be a way to do it without expanding x... ah well, cheers mate.