Opened 7 years ago

# advanced symbolic series of Order any expression

Reported by: Owned by: Daniel Krenn major sage-7.1 symbolics N/A

### Description

```sage: (x+1).sqrt().series(x,3)
1 + 1/2*x + (-1/8)*x^2 + Order(x^3)
sage: (x+1).sqrt().series(x,3).subs(x=1/x)
1/2/x - 1/8/x^2 + 1
```

### comment:1 follow-up:  2 Changed 7 years ago by Ralf Stephan

Summary: substitution in symbolic series: losing Order → advanced symbolic series of Order any expression defect → enhancement

The substitution is fine. To support other than power series would be a major enhancement.

### comment:2 in reply to:  1 Changed 7 years ago by Daniel Krenn

The substitution is fine. To support other than power series would be a major enhancement.

I'm not sure if I understand your comment. What I see (as someone having only little idea how power series are done in SR) is that in

```sage: a = 1 + x/2 - x^2/8 + (x^3).Order()
sage: a
-1/8*x^2 + 1/2*x + Order(x^3) + 1
sage: a.subs(x=1/x)
1/2/x - 1/8/x^2 + Order(x^(-3)) + 1
```

substitution works (somehow at least), but in the example stated in the ticket not, the O-Term disappears.

### comment:3 Changed 7 years ago by Ralf Stephan

So, until that enhancement is implemented, a second ticket is needed for consistency, which throws an error. But note that the user won't even encounter this inconsistency if she creates symbolic series the way the documentation suggests it:

```sage: (1/(1-x)).series(x,2)
1 + 1*x + Order(x^2)
sage: s=_
sage: s.subs(x==sin(x))
sin(x) + 1
sage: s.subs(x==exp(x))
e^x + 1
sage: s.subs(x==1/x)
1/x + 1
sage: s.subs(x=1/x)
1/x + 1
```
Note: See TracTickets for help on using tickets.