# Computing series where the free variable is not just a symbol is broken #10290

Open
opened this Issue Dec 20, 2015 · 0 comments

Projects
None yet
1 participant
Contributor

### MooVI commented Dec 20, 2015

 ```In [1]: sin(x).series(x) Out[1]: x - x**3/6 + x**5/120 + O(x**6) In [2]: sin(sin(x)).series(sin(x)) Out[2]: sin(x) - sin(x)**3/6 + sin(x)**5/120 + O(x**6) #Correct, but odd notation In [3]: sin(exp(x)).series(exp(x)) Out[3]: exp(5*x)/120 - exp(3*x)/6 + exp(x) #Wrong, and also missing big O In [4]: sin(cos(x)).series(cos(x)) TypeError: zip argument #2 must support iteration``` Arguably series should just complain and quit if it's not given an symbol for the free variable. This odd behaviour is related to what `Order` does under `subs`: ```In [5]: Order(x).subs(x, exp(x)) Out[5]: 0 In [6]: Order(x).subs(x, cos(x)) TypeError: zip argument #2 must support iteration``` The error is occurring because `solveset` cannot solve an equation Order gives it in `.eval_subs`, and there is no code handling no solution.

### skirpichev added a commit to diofant/diofant that referenced this issue Dec 20, 2015

``` Add a quick exit for Expr.series if x is not a Symbol ```
`Fixes sympy/sympy#10290`
``` f53c9b3 ```

### skirpichev added a commit to diofant/diofant that referenced this issue Dec 20, 2015

``` Add a quick exit for Expr.series if x is not a Symbol ```
`Fixes sympy/sympy#10290`
``` 840f7f7 ```

### skirpichev added a commit to diofant/diofant that referenced this issue Dec 20, 2015

``` Add a quick exit for Expr.series if x is not a Symbol ```
`Fixes sympy/sympy#10290`
``` 9e835bd ```