Section2.3Symbolic Manipulation
Sage not only solves equations numerically but also allows for symbolic manipulation. The page will give several illustrative examples.
The expand method
Notice how the show() method displays the output in a nicer manner. Without it you will see the less pretty output:
x^3 + 3*x^2 + 3*x + 1
Now the reverse! Perform a factor() on the expanded equation.