"duc " <duc_tran8@yahoo.com> wrote in message <iml97s$792$1@fred.mathworks.com>...
> i need to integrate the following indefinite function
> exp(((xy)^2)/2*y^2)/sqrt(2*pi*y^2) ws.r.t y
>
> As it has an essential singularity i understand i need to integrate it numerically but i'm not sure which method will work, and if so which one is most effective in dealing with such functions
>
> your help would be much appreciated
>
> duc
       
When you write (xy)^2)/2*y^2, that puts the y^2 in the numerator. Is that what you mean or do you mean (xy)^2)/(2*y^2) with the y^2 in the denominator? I am guessing you actually mean to have y^2 in the denominator.
With that supposition, let us assume that x > 0 and define a change of variable:
t = (xy)/y
which is to say
y = x/(t+1).
Then we can base the integral at y = 0 and obtain
int('exp((xy)^2/(2*y^2))/sqrt(2*pi*y^2)','y',0,y) =
int('1/sqrt(2*pi)*exp(t^2/2)/(t+1)','t',(xy)/y,+inf)
There is a pole singularity in this latter integral as the lower limit, (xy)/y, approaches 1 but for any (xy)/y > 1, it is convergent. This shows that the original integral in y based at y = 0 is welldefined for finite y >= 0 but diverges as y approaches plus infinity.
The above transformation to t not only indicates the nature of the singularity involved but also enables one to express the integral as a function of the single variable (xy)/y as a lower limit without an explicit x being present in the integrand. Any of the standard quadrature routines can accomplish an evaluation of the above integral in t numerically with the proviso that the upper limit must stop short of infinity but be large enough to provide the necessary accuracy. You cannot of course start at t = 1 as a lower limit.
With x or y in the negative range, the situation is similar to the above.
If my guess above in the first paragraph was wrong, your integral will be divergent as y approaches zero and you will need to base it somewhere else.
Roger Stafford
