You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.