> > sage: foo = (x-1)^2/(x+2)^2 + 2*(x-1)/(x+2)
> > sage: bar = foo*(x+2)
> > sage: bar
> > (x + 2)*((x - 1)^2/(x + 2)^2 + 2*(x - 1)/(x + 2))
>
> > How come (x+2) isn't canceling in each of the parts?
>
> Probably because x might be -2. Also, you have to explicitly simplify  
> to do any non-trivial transformations (because it may be expensive to  
> do so).
>
> sage: bar.simplify_full()
> 3*(x^2 - 1)/(x + 2)

Ah, this is great; thank you!  After perusing the documentation, it
seems that simplify_full applies simplify_trig, simplify_rational, and
simplify_radical.  And simplify_rational is exactly what takes care of
this.

-Doug
--~--~---------~--~----~------------~-------~--~----~
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/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to