On 13 February 2016 at 07:48, Nasir Haniffa <nasirhani...@gmail.com> wrote: > Hi, > > How to get the correct answer for the problems > > 1. Integral( (1+x**2)**(-3/2) ,(x,-1,1) ) > > > 2. Integral( (1+x**2+y**2)**(-3/2) ,(x,-1,1), (y,-1,1) ) > > Both gives 0 in sympy which is wrong.
This is a bug in current master: >>> from sympy import Symbol, Integral >>> x = Symbol('x') >>> Integral( (1+x**2)**(-3/2) ,(x,-1,1) ) Integral((x**2 + 1)**(-2), (x, -1, 1)) >>> Integral( (1+x**2)**(-3/2) ,(x,-1,1) ).doit() 1/2 + pi/4 Note that -3/2 under Python 2.7 gives -2 which is not what you want so use -S(3)/2 >>> from sympy import S >>> Integral( (1+x**2)**(-S(3)/2) ,(x,-1,1) ).doit() 0 >>> expr = (1+x**2)**(-S(3)/2) >>> expr.integrate((x, -1, 1)) 0 Under sympy 0.7.1 I get: >>> Integral( (1+x**2)**(-S(3)/2) ,(x,-1,1) ).doit() Integral((x**2 + 1)**(-3/2), (x, -1, 1)) >>> Integral( (1+x**2)**(-S(3)/2) ,(x,-1,1) ).evalf() 1.41421356237310 -- Oscar -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAHVvXxTXY-w1_VfHBqPZmTZkPGrM1T4T8md5pMh5wraXmt-KeQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.