Borwein integrals

41 views
Skip to first unread message

jma...@gmail.com

unread,
May 8, 2018, 1:01:59 PM5/8/18
to sympy
Hello

I wanted to calculate the Borwein integrals using sympy.
For some integrals, sympy provides the correct result
but for an other one it seems crashed.

Here my code:

>>> from sympy import *
>>> from operator import mul
>>> from functools import reduce

>>> x = symbols("x")
>>> f = lambda n: reduce(mul, (sin(x/k)/(x/k) for k in range(1, n+2, 2)))

>>> f(1)
sin(x)/x

>>> f(3)
3*sin(x/3)*sin(x)/x**2

>>> f(5)
15*sin(x/5)*sin(x/3)*sin(x)/x**3

>>> integrate(f(1), (x, 0, oo))
pi/2     CORRECT

>>> integrate(f(3), (x, 0, oo))
pi/2    CORRECT

>>> integrate(f(5), (x, 0, oo))

NO RESULT
python shell seems stuck, I have to stop it
after few minutes with a ctrl C


Regards


Aaron Meurer

unread,
May 8, 2018, 2:35:38 PM5/8/18
to sy...@googlegroups.com
SymPy doesn't know how to compute the integral. It is getting stuck in
a heuristic integrator that runs after all the other algorithms, which
often does this (we would like to remove it eventually). If you left
it long enough, it would return, but it would just give an unevaluated
integral.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/eb0097ca-7add-47c5-95b0-0495563f70c1%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages