Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to simplify with Sage?

Does Sage have a function to simplify symbolic expressions in a similar way to how the other major CAS do it? I.e. use heuristics to try to come up with a form which is likely to seem simpler to humans, which is certainly subjective and cannot be done perfectly, but it's also certainly very useful.

simplify doesn't do this, and the documentation is a bit confusing: it says that f = I + x - x; simplify(f) gives I, but so does just printing f. So what's the point of simplify?

I'm sure there must be a function that does this, as I beieve Sage includes several good CAS, I just can't find it.

Some examples to try:

(sqrt(2) - 1)*(sqrt(2)+1)

1/(3*(1 + x)) - (2*x - 1)/(6*(x^2 - x + 1)) + 2/(3*(1 + ((2*x - 1)^2)/3))

(Second one taken from Mathematica documentation.)

I know I can play with expand and factor but is there a less manual way?

How to simplify with Sage?

Does Sage have a function to simplify symbolic expressions in a similar way to how the other major CAS do it? I.e. use heuristics to try to come up with a form which is likely to seem simpler to humans, which is certainly subjective and cannot be done perfectly, but it's also certainly very useful.

simplify doesn't do this, and the documentation is a bit confusing: it says that f = I + x - x; simplify(f) gives I, but so does just printing f. So what's the point of simplify?

I'm sure there must be a function that does this, as I beieve Sage includes several good CAS, I just can't find it.

Some examples to try:

(sqrt(2) - 1)*(sqrt(2)+1)

1/(3*(1 + x)) - (2*x - 1)/(6*(x^2 - x + 1)) + 2/(3*(1 + ((2*x - 1)^2)/3))

(Second one taken from Mathematica documentation.)

I know I can play with expand and factor but is there a less manual way?