# Gaussian integral in Mathematica

1. Jun 23, 2007

How can I evaluate something like

$$\int^{\infty}_{-\infty} d^3 \mathbf{x} f(\mathbf{x}) e^{t g(\mathbf{x})}$$

in Mathematica, where x is a vector in 3D?

2. Jun 23, 2007

### cipher_42

When you say:

$$\int^{\infty}_{-\infty}d^3x$$

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

$$d^3x = dxdydz$$

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

Peace,
Jason

Last edited: Jun 23, 2007
3. Jun 23, 2007