# Poly should use free_symbols to check for variable dependence #5602

Open
opened this Issue Jun 21, 2011 · 1 comment

Projects
None yet
2 participants
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 "", line 1, in 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/
Member

### asmeurer commented Mar 20, 2012

 ``````**Status:** Valid `````` Original comment: http://code.google.com/p/sympy/issues/detail?id=2503#c1 Original author: https://code.google.com/u/asmeurer@gmail.com/

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

``` Add regression test ```
`Closes sympy/sympy#5602`
``` b112afe ```

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

``` Add regression test ```
`Closes sympy/sympy#5602`
``` 2d5f55d ```