Comment #4 on issue 2068 by asmeurer: integrate(Integral(f(x), x), x) fails
http://code.google.com/p/sympy/issues/detail?id=2068

Because of the fix at https://github.com/sympy/sympy/pull/7, this is now failing with a different error:


In [1]:        integrate(Integral(f(x), x), x)
   ...:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/Users/aaronmeurer/Documents/Python/sympy/sympy/<ipython console> in <module>()

/Users/aaronmeurer/Documents/Python/sympy/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__

/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/integrals.py in integrate(*args, **kwargs)
    554
    555     if isinstance(integral, Integral):
--> 556         return integral.doit(deep = False)
    557     else:
    558         return integral

/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/integrals.py in doit(self, **hints)
    165         for lim in self.limits:
    166             x = lim[0]
--> 167             antideriv = self._eval_integral(function, x)
    168
    169             if antideriv is None:

/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/integrals.py in _eval_integral(self, f, x)
    363
    364             # fall back to the more general algorithm

--> 365             h = heurisch(g, x, hints=[])
    366
    367             # if we failed maybe it was because we had


/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/risch.pyc in heurisch(f, x, **kwargs)
    277
278 s = u_split[0] * Mul(*[ k for k, v in special.iteritems() if v ])
--> 279     a, b, c = [ p.as_poly(*V).total_degree() for p in [s, P, Q] ]
    280
    281     poly_denom = (s * v_split[0] * deflation(v_split[1])).as_basic()

AttributeError: 'NoneType' object has no attribute 'total_degree'

Which is because heurisch() doesn't know how to handle Integral objects. We need to put in a hook in Integral.__new__ and in integrate() to convert an Integral argument into a single multiple Integral in the first case, or else something that calls doit() and evaluates if it works or else creates an multiple Integral in the second case.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to