Another smart solution. Thanks a ton. Maybe you can tell me why the following code doesn't work: https://github.com/sympy/sympy/issues/9233
On Thursday, April 2, 2015 at 12:15:02 PM UTC+3, Francesco Bonazzi wrote: > > In [1]: ex = sqrt(x+1)+x+3 > > In [2]: ex.subs(x, solve(y-sqrt(x+1), x)[0]) > Out[2]: > ____ > 2 ╱ 2 > y + ╲╱ y + 2 > > > If *y* is declared to be positive, you get the right expression. > > On Wednesday, April 1, 2015 at 7:01:29 PM UTC+2, Paul Royik wrote: >> >> Is there a function that will convert sqrt(x+1)+x+3 into y^2+y+2 with >> y=sqrt(x+1)? >> Subs is smart enough to make (x**4+x**2+2).subs(x**2, y) into y**2+y+2. >> >> But it doesn't work with initial example. Even sqrt(x+1)+x+1 is not >> converted into y^2+y >> > -- 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/3508ab22-11e2-4404-b5cc-37e163f8f78d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
