Assumptions system

36 views
Skip to first unread message

Paul Royik

unread,
Jan 17, 2020, 2:26:21 PM1/17/20
to sympy
I know that variables can be made positive or negative.

But how do I make assumption that x>2?

If I have and expression like (x-2)^(1/3)+(x-5)^(1/3) (actually arbitrary expressions), how to make assumptions that all expressions under roots are positive, i.e. x-2>0, x-5>0?

Aaron Meurer

unread,
Jan 17, 2020, 3:34:39 PM1/17/20
to sympy
There is still limited support for this, but you can use refine(expr,
Q.positive(x - 2)). Actually, if all you want to do is simplify all
roots in an expression you can use powdenest() and powsimp() with the
force=True flag.

Aaron Meurer
> --
> 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 sympy+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/9edf1f7c-224d-4bf2-ba17-eea773465bb2%40googlegroups.com.

Paul Royik

unread,
Jan 18, 2020, 2:58:49 PM1/18/20
to sympy
Thank you.


On Friday, January 17, 2020 at 10:34:39 PM UTC+2, Aaron Meurer wrote:
There is still limited support for this, but you can use refine(expr,
Q.positive(x - 2)). Actually, if all you want to do is simplify all
roots in an expression you can use powdenest() and powsimp() with the
force=True flag.

Aaron Meurer

On Fri, Jan 17, 2020 at 12:26 PM Paul Royik <distan...@gmail.com> wrote:
>
> I know that variables can be made positive or negative.
>
> But how do I make assumption that x>2?
>
> If I have and expression like (x-2)^(1/3)+(x-5)^(1/3) (actually arbitrary expressions), how to make assumptions that all expressions under roots are positive, i.e. x-2>0, x-5>0?
>
> --
> 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 sy...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages