[Python] Why can't SymPy calculate the Sum(1 / ((k + 1) ** 4 + 1), (k,-oo,oo)) when it appears...

Discussão em 'Python' iniciado por Stack, Março 20, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using Sympy for some numeric calculations, specifically for infinite summations. The following code returns 0:

    import sympy as sp
    from sympy.abc import k

    sp.summation(1 / ((k + 1) ** 4 + 1), (k, -sp.oo, sp.oo))


    However, all elements of this sum are positive. The docs say that if the sum is incalculable, it will be returned as-is, however that's not the case here. Makes me wonder if there are other cases when SymPy is wrong.

    In which cases does SymPy not guarantee correctness of calculations?

    Edit: This sum is calculable (can be calculated without special functions e.g. via the residual theorem, any modern LLM can guide you through the process); it converges to a positive number. Most likely, SymPy would not be able to handle it, but I expect it to at least admit that it cannot instead of returning a false answer.

    Continue reading...

Compartilhe esta Página