Hi. This is a bug. I thought we had an issue for it, but I couldn't find one, so I created http://code.google.com/p/sympy/issues/detail?id=2820. It shouldn't have anything to do with assumptions.
Note that if you just want to put the rational function in canonical form, cancel() may be a better bet: In [7]: x.cancel() Out[7]: -1 ────── 2 b - 1 Aaron Meurer On Wed, Nov 2, 2011 at 4:55 PM, Bastian Weber <[email protected]> wrote: > Hello, > > > I just got some results that I belive not beeing expected by the average > user: > > > In [6]: x = 1/(b*(1/b - b)) > In [7]: x.expand() > Out[7]: 1/(b*(-b + 1/b)) > > > I would have expexted > > 1/(1-b**2) or something like this. > > > However, if I enter the denominator separately I get the expected result: > > In [9]: y = b*(1/b - b) > In [10]: y.expand() > Out[10]: -b**2 + 1 > > > > In [13]: sp.__version__ > Out[13]: '0.7.1' > > > Is this the intended behavior? Does it have to do with assumptions? > (The symbol b comes from a plain sp.symbols('a b c d') which is part of a > personal ipython macro) > > Best regards, > Bastian. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" 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?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sympy" 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?hl=en.
