Ask Your Question

Revision history [back]

Hi,

Apparently you are using an old version of Sage, because with Sage 6.7, one has

sage: r,M=var('r','M')
sage: assume(r>0,M>0,r>2*M)
sage: sqrt((2*M-r)^2)
sqrt((2*M - r)^2)

To simplify it, simply run

sage: s = sqrt((2*M-r)^2)
sage: s.simplify_real()
-2*M + r

which is correct, given the assumption.