On Thu, Feb 26, 2015 at 4:05 PM, Paul Royik <
distan...@gmail.com> wrote:
> It doesn't work if x is positive.
Indeed, looks like a bug. As a workaround, you can always substitute
general "x" for the positive "x", then it will work:
In [4]: x = Symbol("x", positive=True)
In [5]: powsimp(sqrt(x)*sqrt(x-4), force=True)
Out[5]:
___ _______
╲╱ x ⋅╲╱ x - 4
In [6]: powsimp((sqrt(x)*sqrt(x-4)).subs(x, Symbol("x"), force=True)
...:
KeyboardInterrupt
In [6]: powsimp((sqrt(x)*sqrt(x-4)).subs(x, Symbol("x")), force=True)
Out[6]:
___________
╲╱ x⋅(x - 4)
> In fact, when x is positive, 1/sqrt(x*(x-4)) automatically converted to
> 1/sqrt(x)/sqrt(x-4)
The same trick:
In [7]: powsimp(1/(sqrt(x)*sqrt(x-4)).subs(x, Symbol("x")), force=True)
Out[7]:
1
─────────────
___________
╲╱ x⋅(x - 4)
Ondrej
>
https://groups.google.com/d/msgid/sympy/dc099057-8529-4f12-ae42-ed7f9e89b98e%40googlegroups.com.