| 1 | initial version |
You can use the canonicalize_radical method for that:
sage: e = sqrt(x^2 - 2*x + 1)
sage: e.canonicalize_radical()
x - 1
However, the assumptions are not taken into account, please read the warning in the doc:
sage: e.canonicalize_radical?
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.