Hello Mathilde,
To answer quickly, just do
sage: my_formula = (x+2) * (x+3)
sage: my_formula
(x + 3)*(x + 2)
sage: my_formula.expand()
x^2 + 5*x + 6
Then if you want to go further, you should think what kind of structures
you want to manipulate. If these are only polynomials, then prefer
sage: x = polygen(ZZ) # a polynomial variable
sage: (x+3) * (x+2) # automatic expansion!
x^2 + 5*x + 6
The automatic expansion is not the only reason to use polynomials. They
are faster and have more method (only related to polynomials though).
Best
Vincent
On 13/04/15 15:56, Mathilde Kalôm wrote:
Hi everyone,
First I'm a non native english speaker, so I apologize for my mistakes :-)
Secondly, I have a problem with an operation in Sage (...no surprise) : I'm
writing a fonction, and several command lines ask Sage to compose an
operation (one line is "one part of the operation"). Finally when I run the
fonction I obtain something like this (example !) : x^20 - 1/2*(2*x^12 +
2*x - 1)*x^8 + 1
Fabulous, because it's that I want...but not totally. I'll like Sage
execute the intermediate calculations (parentheses, etc.) to finally obtain
"-x^9 + 1/2*x^8 + 1" : how can I do that ?
It's a basic problem but I'm also a debutant user :(
Thanks a lot :-)
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.