Comment #5 on issue 1576 by asmeurer: Integral of strictly positive function is zero
http://code.google.com/p/sympy/issues/detail?id=1576

The problem is

In [36]: Poly(-4*_t, _t, domain='QQ').invert( Poly(16*y**2*_t**2 + 49, _t, domain='ZZ[y]'))
---------------------------------------------------------------------------
NotInvertible                             Traceback (most recent call last)
…
NotInvertible: zero divisor

vs.

In [37]: Poly(-4*_t, _t, domain='QQ').invert( Poly(16*y**2*_t**2 + 49, _t, domain=EX))
Out[37]: Poly(4*y**2/49*t, t, domain='EX')

So this "fixes" it, but I know it isn't the proper way to do it. Is there a way to force Poly to view expressions not in the generator set as coming from EX, even if they could be viewed as polynomials?

diff --git a/sympy/integrals/rationaltools.py b/sympy/integrals/rationaltools.py
index 1969010..f8c9fb5 100644
--- a/sympy/integrals/rationaltools.py
+++ b/sympy/integrals/rationaltools.py
@@ -172,6 +172,7 @@ def _include_sign(c, sqf):

     for q, i in res_sqf:
         _, q = q.primitive()
+        q = q.set_domain('EX')

         if g.degree() == i:
             H.append((g, q))


--
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