My guess is that expression 1.5 considered a floating point, which is inaccurate. Instead, you will need a symbolic (exact) representation. (I would suggest that if you were after the computational integral, then a floating point would probably be good, as a rule, as the mathematical library supporting the computational integral, as a rule, use the integral approximation method to calculate the integral.) If you need to do arbitrary rational exponents, consider using sympy.Rational . Here is a relevant answer to StackOverflow that seems to support this. I think the documentation for sympy.Rational here . You can try this modified code here :
#Calculate Calculus import sympy frac = sympy.Rational x = sympy.Symbol('x') f = (6-x*x)**(frac('1.5')) f.integrate()
source share