Status: Accepted Owner: ondrej.certik Labels: Type-Defect Priority-Medium
New issue 1892 by ondrej.certik: integrate(1/(x*(a+b*x)**3), x) fails http://code.google.com/p/sympy/issues/detail?id=1892 In [6]: var("a b") Out[6]: (a, b) In [7]: integrate(1/(x*(a+b*x)**3), x) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (233, 0)) --------------------------------------------------------------------------- CoercionFailed Traceback (most recent call last) /home/ondrej/repos/sympy/<ipython console> in <module>() /home/ondrej/repos/sympy/sympy/utilities/decorator.pyc in threaded_decorator(expr, *args, **kwargs) 54 return Add(*[ func(f, *args, **kwargs) for f in expr.args ]) 55 else: ---> 56 return func(expr, *args, **kwargs) 57 58 threaded_decorator.__doc__ = func.__doc__ /home/ondrej/repos/sympy/sympy/integrals/integrals.pyc in integrate(*args, **kwargs) 537 538 if isinstance(integral, Integral): --> 539 return integral.doit(deep = False) 540 else: 541 return integral /home/ondrej/repos/sympy/sympy/integrals/integrals.pyc in doit(self, **hints) 150 151 for x,ab in self.limits: --> 152 antideriv = self._eval_integral(function, x) 153 154 if antideriv is None: /home/ondrej/repos/sympy/sympy/integrals/integrals.pyc in _eval_integral(self, f, x) 327 # poly(x) 328 if g.is_rational_function(x): --> 329 parts.append(coeff * ratint(g, x)) 330 continue 331 /home/ondrej/repos/sympy/sympy/integrals/rationaltools.pyc in ratint(f, x, **flags) 62 t = symbol 63 ---> 64 L = ratint_logpart(r, Q, x, t) 65 66 real = flags.get('real') /home/ondrej/repos/sympy/sympy/integrals/rationaltools.pyc in ratint_logpart(f, g, x, t) 190 191 for coeff in h.coeffs()[1:]: --> 192 T = (inv*coeff).rem(q) 193 coeffs.append(T.as_basic()) 194 /home/ondrej/repos/sympy/sympy/core/decorators.pyc in __sympifyit_wrapper(a, b) 104 # b successfully _sympified, lets call func again. 105 # if it raises here -- exception goes to caller --> 106 return func(a, b) 107 108 return __sympifyit_wrapper /home/ondrej/repos/sympy/sympy/polys/polytools.pyc in __mul__(f, g) 1567 return f.as_basic()*g 1568 -> 1569 return f.mul(g) 1570 1571 @_sympifyit('g', NotImplemented) /home/ondrej/repos/sympy/sympy/polys/polytools.pyc in mul(f, g) 882 def mul(f, g): 883 """Multiply two polynomials `f` and `g`. """ --> 884 _, per, F, G = f.unify(g) 885 886 try: /home/ondrej/repos/sympy/sympy/polys/polytools.pyc in unify(f, g) 534 G = DMP(dict(zip(g_monoms, g_coeffs)), dom, lev) 535 else: --> 536 G = g.rep.convert(dom) 537 elif isinstance(f.rep, GFP) and isinstance(g.rep, DMP) and f.gens == g.gens: 538 dom, G, F, gens = f.rep.dom, GFP(g.rep.convert(f.rep.dom).rep, f.rep.mod, f.rep.dom, f.rep.sym), f.rep, f.gens /home/ondrej/repos/sympy/sympy/polys/polyclasses.pyc in convert(f, dom) 1158 return f 1159 else: -> 1160 return DMP(dmp_convert(f.rep, f.lev, f.dom, dom), dom, f.lev) 1161 1162 def coeffs(f): /home/ondrej/repos/sympy/sympy/polys/densebasic.pyc in dmp_convert(f, u, K0, K1) 230 """Convert ground domain of `f` from `K0` to `K1`. """ 231 if not u: --> 232 return dup_convert(f, K0, K1) 233 if K0 is not None and K0 == K1: 234 return f /home/ondrej/repos/sympy/sympy/polys/densebasic.pyc in dup_convert(f, K0, K1) 224 return f 225 else: --> 226 return dup_strip([ K1.convert(c, K0) for c in f ]) 227 228 @cythonized("u,v") /home/ondrej/repos/sympy/sympy/polys/algebratools.pyc in convert(K1, a, K0) 93 return result 94 ---> 95 raise CoercionFailed("can't convert %s of type %s to %s" % (a, K0, K1)) 96 else: 97 try: CoercionFailed: can't convert DMP([-1, 0, 0, 0], ZZ) of type ZZ[a] to ZZ(a,b) -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups "sympy-issues" group. To post to this group, send email to sympy-iss...@googlegroups.com. To unsubscribe from this group, send email to sympy-issues+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy-issues?hl=en.