Wrong result of sympy integration -
this expression returns zero, shouldn`t.
p = x^6-14x^4+49x^2-36
integrate(1/p, (x, 1/3, 1/2))
used expand on expression, without result. doing wrong or bug?
this works:
from sympy import * x = symbols('x') p = x**6-14*x**4+49*x**2-36 = integrate(1/expand(p), (x, s.one/3, s.one/2))
i result:
in [5]: out[5]: -3*log(3)/80 - log(7)/48 - log(2)/48 - log(8)/240 + log(10)/240 + log(4)/48 + 3*log(5)/80 in [6]: i.n() out[6]: -0.00601350282195297
in alternative, run command isympy -i, run sympy prompt converts python integers sympy integers before input gets evaluated sympy parser.
python integer division different between python 2 , python 3, first returns , integer, second returns floating point number. both versions different sympy integer division, returns fractions. use sympy division, need make sure @ least 1 among dividend , divisor sympy objects.
Comments
Post a Comment