You are heading into erroneous waters. It doesn't matter that 3>0. sqrt(9) has two values, +3 and -3. Just because some other systems make this mistake does not mean sympy should do this.
If you want to say something about the choice of branch for sqrt(x^2), you have to say something about sqrt(x^2), not x. It may be sensible if you mean to restrict the square root function. But not that way. Good luck On Friday, December 5, 2014 1:49:35 PM UTC-8, Aaron Meurer wrote: > > They need to be positive. Even for integer x, sqrt(x**2) != x if x is > negative. > > Aaron Meurer > > On Fri, Dec 5, 2014 at 3:34 PM, Francesco Bonazzi > <[email protected] <javascript:>> wrote: > > newvars =symbols('x a b', integer=True) > > e.xreplace(dict(zip([x,a,b], newvars))) > > > > I did not test this. > > > > -- > > You received this message because you are subscribed to the Google > Groups "sympy" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > Visit this group at http://groups.google.com/group/sympy. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/75aa630a-4b0e-46b0-ac20-0f4ffff34f28%40googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sympy" 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/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/7b616f2c-4d35-4a29-8943-9b308b2b819f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
