Integrating exp(-x^2)/x using Simpson's Rule: A Numerical Approach

  • Thread starter Thread starter reach28
  • Start date Start date
  • Tags Tags
    Integration
reach28
Messages
3
Reaction score
0
I'm supposed to integrate the following numerically:
\int e^{-x^{2}}/x
,with limits from \sqrt{\pi} to \inftyI'm supposed to use Simpson's Rule, so I'm trying to redefine the integral to have a finite range. I've tried all kinds of substitutions, and integration by parts. I've also tried squaring the integral and converting to polar coordinates, because it looks so similar to the Gaussian integral. No dice.
Any suggestions?
 
Physics news on Phys.org
deleted my first post as i missed the point & was way off...

do you need an analytic result as well?

if you want to just want to transform to get finite limits to use simpsons rule, probably means turning the infinite limit into a limit towards zero, eg. how about sometrhing u ~1/x^2
 
Using something like u=1/x^2 would give a finite range of integration, but it would leave the function undefined at 0:

u=1/x^2 --> x=u^-.5 --> dx=-0.5*u^1.5 du

that would give us the integral of 0.5*e^(-1/u) / u ,from 0 to 1/pi.
I thought that i couldn't use this because the function is undefined at 0. a quick check shows that as u-->0, 0.5*e^(-1/u) / u also goes to zero. This leaves no problems for it to be evaluated by Simpson's Rule, as long as f(u=0) is defined to be zero in my script. Now that I have a fresh look at it, I don't know why I didn't see it before. Thank You.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top