I'm trying to remove terms whose exponents are positive in a polynomial. I tried this one;
Assuming[t > 0, x^t /. {x^a_ /; Positive@a -> 0}]
but the result becomes;
x^t
I want to get 0 instead of this result.
How to do so?
Thank you.
For some reason Mathematica doesn't apply the assumption automatically, but you can enforce it like this:
Assuming[t > 0, x^t /. {x^a_ /; Simplify[Positive@a] -> 0}]
a minimal example:
Assuming[t > 0, t > 0]
(*t>0*)
Assuming[t > 0, Simplify[t > 0]]
(*True*)
Assuming
: It only affects functions with the Assumptions
option, so you need Simplify
or similar (Positive
doesn't have the option).
$\endgroup$
Commented
Jan 11, 2020 at 10:04