Status: Accepted
Owner: ----
Labels: Type-Defect Priority-Medium module-integration

New issue 1277 by fabian.seoane: Exception in trivial integral
http://code.google.com/p/sympy/issues/detail?id=1277

In [1]: integrate(n*x**(1/n), (x, 0, S.Half))
Out[1]:
         1          1
    -1 - -      1 + -
         n          n
n*2         n*0
--------- - --------
       1          1
   1 + -      1 + -
       n          n

but

In [2]: integrate(n*(x**(1/n)-1), (x, 0, S.Half))
---------------------------------------------------------------------------
PolynomialError                           Traceback (most recent call last)

/Users/fabian/dev/sympy/<ipython console> in <module>()

/Users/fabian/dev/sympy/sympy/utilities/decorator.pyc in
threaded_decorator(expr, *args, **kwargs)
      53                     return Add(*[ func(f, *args, **kwargs) for f in
expr.args ])
      54                 else:
---> 55                     return func(expr, *args, **kwargs)
      56
      57         threaded_decorator.__doc__  = func.__doc__

/Users/fabian/dev/sympy/sympy/integrals/integrals.pyc in integrate(*args,
**kwargs)
     380
     381     if isinstance(integral, Integral):
--> 382         return integral.doit()
     383     else:
     384         return integral

/Users/fabian/dev/sympy/sympy/integrals/integrals.pyc in doit(self, **hints)
     130
     131         for x,ab in self.limits:
--> 132             antideriv = self._eval_integral(function, x)
     133
     134             if antideriv is None:

/Users/fabian/dev/sympy/sympy/integrals/integrals.pyc in
_eval_integral(self, f, x)
     304
     305             # fall back to the more general algorithm
--> 306             h = heurisch(g, x, hints=[])
     307
     308             if h is not None:

/Users/fabian/dev/sympy/sympy/integrals/risch.pyc in heurisch(f, x,  
**kwargs)
     214
     215     denoms = [ g.as_numer_denom()[1] for g in diffs ]
--> 216     denom = reduce(lambda p, q: lcm(p, q, V), denoms)
     217
     218     numers = [ Poly.cancel(denom * g, *V) for g in diffs ]

/Users/fabian/dev/sympy/sympy/integrals/risch.pyc in <lambda>(p, q)
     214
     215     denoms = [ g.as_numer_denom()[1] for g in diffs ]
--> 216     denom = reduce(lambda p, q: lcm(p, q, V), denoms)
     217
     218     numers = [ Poly.cancel(denom * g, *V) for g in diffs ]

/Users/fabian/dev/sympy/sympy/polys/wrappers.pyc in lcm(*args, **kwargs)

/Users/fabian/dev/sympy/sympy/polys/wrappers.pyc in _map_basic(f, n, *args,
**kwargs)
      37
      38 def _map_basic(f, n, *args, **kwargs):
---> 39     result = f(*_conv_args(n, args), **kwargs)
      40
      41     if isinstance(result, (list, tuple, set)):

/Users/fabian/dev/sympy/sympy/polys/algorithms.pyc in poly_lcm(f, g,  
*symbols)
     352         raise SymbolsError("Redundant symbols were given")
     353
--> 354     f, g = f.unify_with(g)
     355
     356     symbols, flags = f.symbols, f.flags

/Users/fabian/dev/sympy/sympy/polys/polynomial.pyc in unify_with(self,  
other)
    1510                 self = cls(self, *symbols, **flags)
    1511
-> 1512             other = cls(other, *symbols, **flags)
    1513
    1514         return self, other

/Users/fabian/dev/sympy/sympy/polys/polynomial.pyc in __new__(cls, poly,
*symbols, **flags)
     398                         terms = Poly._permute(poly, *symbols)
     399         else:
--> 400             terms = Poly._decompose(poly, *symbols)
     401
     402         if terms:

/Users/fabian/dev/sympy/sympy/polys/polynomial.pyc in _decompose(poly,
*symbols)
     541                             continue
     542
--> 543                         raise PolynomialError("Can't decompose %s"
% factor)
     544                     else:
     545                         coeff *= factor

PolynomialError: Can't decompose _x0**(2 - 1/n)


--
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-issues@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to