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 On Tue, May 8, 2018 at 4:44 AM, <[email protected]> wrote: > 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 > > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > 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. -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CAKgW%3D6LL2477WB7WSsGtdE13HwGj%3DgvasYEJt7_f5u9F0e-gdA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
