I'm trying to compute some oscillatory integral using the quadosc function. But I didn't manage to use it correctly
I've tried to compute, as an example, Dirichlet integral $\int_0 ^{+ \infty} \dfrac{\sin(t)}{t} dt = \dfrac{\pi}{2}$ using the following code:
from mpmath import *
display(pi / 2)
display(quadosc(lambda u: sin(u) / u, [0, inf], omega=1))
display(quadosc(lambda u: sin(u) / u, [0, inf], period=2*pi))
display(quadosc(lambda u: sin(u) / u, [0, inf], zeros=lambda n: n * pi))
The answer is:
mpf('1.5707963267948966')
mpf('1.641666298892096')
But, when I change the number of decimal, e.g. mp.dps = 50, then I have the "right" answer:
mpf('1.5707963267948966192313216916397514420985846996875534')
mpf('1.5707963267948965954112058173691061340591300876825049')
mpf('1.5707963267948965954112058173691061340591300876825049')
mpf('1.5707963267948965954112058173691061340591300876825049')
Is someone able to explain how to improve the behaviour of quadosc?
Olivier