integrate bessel_k(2,%i*y) surprise



On 1/1/02 12:00 AM, Edwin Woollett wrote:
> I am just playing around with bessel_k and don't
> understand the large imaginary part of the integral
> of bessel_k(2, %i*y) over the interval
> 1 <=  y <= 100, based on the table of discrete values displayed below:
> (f(x) is just fchop(expand(float(x))) )
> --------------------------------
> (%i1) load(nint);
> (%o1) "c:/work2/nint.mac"
>
> (%i25) for y:1 step 10 thru 100 do          print("  ",y," 
> ",f(bessel_k(2,%i*y)))$
>
>   1    0.18048997206696*%i-2.592886175491198   11   
> 0.21841533174753*%i+0.3119789483129   21   
> -0.031858737423089*%i-0.27222015896945   31   
> 0.20481495858656-0.093918476739506*%i   41   
> 0.16377581778393*%i-0.10738879820159   51   
> 0.0024786070162412-0.17554486214757*%i   61   
> 0.13641169853138*%i+0.084590710242742   71   
> -0.064015208750726*%i-0.13429138505077   81   
> 0.13815292462619-0.017659551649835*%i   91   
> 0.084630268914206*%i-0.10051430087896
> (%i26) f(integrate(bessel_k(2,%i*y),y,1,100));
>
> (%o26) 1.736293756153568-2.1367387806763253E+42*%i
> ----------------------------------------------------------------
> Where does the 10^42 come from??

It comes from the bessel_y(1,100*%i) term that integrate produces.   I
checked the value of this and I think it's correct.  I assume that
integrate produces the incorrect result.  I didn't check that.

Ray