On May 14, 2009, at 3:57 AM, Laurent wrote:

>
> Hello
>
> ++++++++++++++++++++++++++++++++
>
> x,y=var('x,y')
> s = x*y2 + x*(-y2 - x2 + 1) + x3 - x
> print simplify(s)
>
> Answer :
>
>                            2         2    2         3
>                         x y  + x (- y  - x  + 1) + x  - x
>
>
>
> +++++++++++++++++++++++++++++
>
> I'm quite disappointed that Sage do not notice that s=0. Do I miss
> something ?
> Btw, the function simplify_full does not exist ... so I suppose that I
> *do* miss something.


Simplification doesn't expand by default. This is by design (e.g. one  
might argue that (1+x)^100 is "more simplified" than its expanded  
form). However, Sage is able to tell that this is zero:

sage: var('x,y')
(x, y)
sage: s = x*y^2 + x*(-y^2 - x^2 + 1) + x^3 - x
sage: s.simplify()
x*y^2 + x*(-y^2 - x^2 + 1) + x^3 - x
sage: s.simplify_full()
0
sage: s.simplify_rational()
0
sage: s.expand()
0

Or over the (orders of magnitude faster) polynomial ring:

sage: R.<x,y> = QQ[]
sage: s = x*y^2 + x*(-y^2 - x^2 + 1) + x^3 - x; s
0

- Robert

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to