[Python] sympy unable to take simple integral

Discussão em 'Python' iniciado por Stack, Agosto 9, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to take the following integral using sympy and it won't take it:

    >>> from sympy import *
    >>> integrate(x*exp(-(x-x0)**2), (x, 0, k))

    [​IMG]
    If I 'help' it by adding and subtracting the same expression, it works fine:

    >>> sp.integrate((x-x0)*sp.exp(-(x-x0)**2)+x0*sp.exp(-(x-x0)**2), (x, 0, k))

    [​IMG]
    Is there any way to automate this process?

    Wolfram Alpha takes it easily without any hints from user's side: [​IMG]

    Continue reading...

Compartilhe esta Página