Hello, I have constructed a function which is simply a three-dimensional gaussian:
As you can see, these are both gaussian terms, so they should be easy to integrate. I have tried many methods of NIntegrate, which do not converge or give a consistent answer. This function is very simple and well-behaved, it is a ball at r=0 and a shell at r=3, both of gaussian shape. How can I produce the definite integral of this function?
You have removed some information from the function in your steps. The integral is a sum of two functions. As I mentioned, if you set xp,yp,zp to zero, you get a ball at the origin, and a shell at 3.5. So if you transform to r, you will get a quick rise at 0, nothing in between, and another rise at 3-4.
This is a 3D integral, which has infinite bounds in both directions. The gaussians diverge so this is OK. I am trying to find the numerical value, symbolically if possible, of integrating over all space.
Hmmm,
Your original post’s formula wasn’t fully displayed, I thought I was able to copy it all.
I changed your 3.5 to 7/2. I didn’t see where you discussed {xp,yp,zp} or what you meant by r. You can let rBall->Infinity…
That does look like the correct integral. The simplification to zero I already did, which was the simplest way to evaluate the integral. I see the transformation to spherical coordinates. That works. I am surprised Mathematica cannot do these in cartesian fashion, though.
I did not know how to use the “Assumptions” option, thanks! Answer is…
I have waited a while without an answer. It would be very useful if I could do them in Cartesian so I could convolute them with other functions. I would like to integrate this with some cartesian exponentials that do not have any easy transformation to sphericals. I have a pretty fast computer, so I am not sure if Integrate will ever return an answer if I wait longer than I already have.
(with s some small real number, and 7/2 here being used for mu).
Transforming the density function to sphericals makes a huge mess. But this is just gaussian functions after the product, so I am surprised it doesn’t give definite integrals.
It will eventually return something, I’ve waited over a day in some cases. Definite integrals tend to take longer than indefinite ones. Using Assumptions often helps because it doesn’t need to find all the conditionals.
If I were doing your nonspherical convolutions, I’d probably go with a NIntegrate.