Hello everyone,

I am new to sage (thanks for it ! it looks excellent !) and have been
trying to re-factor some long expressions.
As an example :

sage: var('x,y,a,b,c,d')
(x, y, a, b, c, d)
sage: T=expand((x^2+y^2)*(a*b+a^2-2*d*c+c^2-3*b^2));T
a^2*x^2 + a^2*y^2 + a*b*x^2 + a*b*y^2 - 3*b^2*x^2 - 3*b^2*y^2 +
c^2*x^2 + c^2*y^2 - 2*c*d*x^2 - 2*c*d*y^2
sage: T.collect(x^2+y^2)
a^2*x^2 + a^2*y^2 + a*b*x^2 + a*b*y^2 - 3*b^2*x^2 - 3*b^2*y^2 +
c^2*x^2 + c^2*y^2 - 2*c*d*x^2 - 2*c*d*y^2

I've played a bit and got lost in the doc... but could not find a way
to have sage re-factor a given sub-expression out.
(also it seems that T.coeffs(x^2+y^2) makes sage hanging...)

Thanks for any help !

Cheers,

P.A.

--~--~---------~--~----~------------~-------~--~----~
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
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to