On Sat, Jan 19, 2008 at 09:01:05PM +0100, Friedrich Hagedorn wrote: > > On Thu, Jan 17, 2008 at 03:15:49PM +0100, Ondrej Certik wrote: > > > > On Jan 17, 2008 2:50 PM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote: > > > > > > Hello, > > > > > > how can do like this: > > > > > > x + x**2 == x*(1 + x) > > > > > > ? > > > > In [1]: factor(x+x**2) > > Out[1]: x*(1 + x) > > Fine. Now I want do > > x - y == -1*(y - x)
If you want to check for equality - use expand: In [1]: lhs, rhs = x+x**2, x*(1+x) In [2]: lhs == rhs Out[2]: 2 x + x = x*(1 + x) In [3]: _.expand() Out[3]: 2 2 x + x = x + x In [4]: lhs,rhs = x-y, -1*(y-x) In [5]: lhs == rhs Out[5]: x - y = x - y In [6]: _.expand() Out[6]: x - y = x - y Or are you asking how to transform x-y to -1*(y-x) ? -- Всего хорошего, Кирилл. http://landau.phys.spbu.ru/~kirr/aiv/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---