New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poly should use free_symbols to check for variable dependence #5602

Open
asmeurer opened this Issue Jun 21, 2011 · 1 comment

Comments

Projects
None yet
2 participants
@asmeurer
Member

asmeurer commented Jun 21, 2011

I just noticed this bug noted in the IRC logs, but it was never reported here.  Read more at http://kottnet.net/irclogs/freenode/chn-%23sympy/2011-06-18.log .

22:51 < vks> andy: yes, for indefinite integrals it's important
22:51 < vks> but this should actually work:
22:51 < vks> >>> Poly(Integral(x, (x, 0, 1))*x + x**2, x)
22:51 < vks> ------------------------------------------------------------
22:51 < vks> Traceback (most recent call last):
22:51 < vks>   File "<ipython console>", line 1, in <module>
22:51 < vks>   File "sympy/polys/polytools.py", line 101, in __new__
22:51 < vks>     return cls._from_expr(rep, opt)
22:51 < vks>   File "sympy/polys/polytools.py", line 208, in _from_expr
22:51 < vks>     rep, opt = _dict_from_expr(rep, opt)
22:51 < vks>   File "sympy/polys/polyutils.py", line 292, in _dict_from_expr
22:51 < vks>     rep, gens = _dict_from_expr_if_gens(expr, opt)
22:51 < vks>   File "sympy/polys/polyutils.py", line 250, in _dict_from_expr_if_gens
22:51 < vks>     (poly,), gens = _parallel_dict_from_expr_if_gens((expr,), opt)
22:51 < vks>   File "sympy/polys/polyutils.py", line 160, in _parallel_dict_from_expr_if_gens
22:51 < vks>     raise PolynomialError("%s contains an element of the generators set" % factor)
22:51 < vks> PolynomialError: Integral(x, (x, 0, 1)) contains an element of the generators set

Poly should use free_symbols.  Also, there's the question as to whether the following should return True

In [2]: x in Integral(x, (x, 0, 1))
Out[2]: True

In [3]: Integral(x, (x, 0, 1)).has(x)
Out[3]: True

Original issue for #5602: http://code.google.com/p/sympy/issues/detail?id=2503
Original author: https://code.google.com/u/asmeurer@gmail.com/
Original owner: https://code.google.com/u/asmeurer@gmail.com/

@asmeurer

This comment has been minimized.

Member

asmeurer commented Mar 20, 2012

@asmeurer asmeurer self-assigned this Mar 7, 2014

skirpichev added a commit to skirpichev/diofant that referenced this issue Oct 6, 2018

skirpichev added a commit to skirpichev/diofant that referenced this issue Oct 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment