August 12th, 2003, 7:40 pm
My thoughts: with Maple i do not have problems to get numerical values, so itshould not be a problem with Matlab.To do it by 'manual coding' a change of variables x/sqrt(2)=xi gives youInt(exp(-xi^2)*((a*b+2*xi^2)/(a+2*xi^2))^c*2^(1/2),xi = -infinity .. infinity)For that you find a recipe in Abramowitz&Stegun (25.4.46) by a Gauss-Hermiteif you restrict to a finite range -bound ... +bound. The bounds here dependon your a and b. As a finite sum the method that is easy to code, the neccessary zeros of the Hermites you find in Abramowitz (up to degree 20)and you find an error estimation as well (somewhat ugly in this case).---Edited after reading it again:Gauss-Hermite is not the best idea, applying Simpson's rule is easy and works.Writing int(f(x), x=0..infinity) ~ int(f(x), x=A..B), A=0, B=A+n*h withstepsize h and n even(!) steps as approximating sum according to that rule reads as1/3*h*(f(A)+f(A+n*h)+4*Sum(f(A+(2*i-1)*h),i = 1 .. 1/2*n)+2*Sum(f(A+2*h*i),i = 1 .. 1/2*n-1))Checking on an example: for a=1,b=2,c=3/2 take the upper bound B=8 and n=64. Then2.695974507757100 resp 2.695974507845684 resp 2.695974507845685 are the values forSimpson resp int(..., x=0..8) resp int(..., x=0..infinity) using 16 digits exactness.
Last edited by
AVt on August 12th, 2003, 10:00 pm, edited 1 time in total.