I found the calculation of the improper integral (in my case from number to infinity). I check a piece of code:

import sympy alfaend = 34 const_f = 1/ math.exp(math.pi*math.pi*alfaend*0.006) x = sympy.symbols('x') f = const_f ** ( x * x) i = sympy.integrate(f, (x, 1, oo)) print(i) 

It gives an error message that " oo " is not defined, although in the help to the library, infinity is also absolutely specified.

If replaced with a number (for example, 100000), it prints a character string instead of the result:

  Integral(0.133533980517061**(x**2), (x, 1, 100000)) 

What could be the problem? Thank you in advance!

    1 answer 1

    Try sympy.oo instead of oo .

    • I tried. Displays the following: Integral (0.133533980517061 ** (x ** 2), (x, 1, oo)) - illaniel
    • And what do you expect to see? Number? Specify a link to Help. Maybe i.evalf() will help you, but you need to clarify it in the help! - moden
    • one
      about! found! if you take i = float (integral), then the whole is considered =) - illaniel
    • >>> i.evalf () 0.0279699483698151 >>> float (i) 0.027969948369815076 I recommend that you still carefully read the dock - moden