If $x$ is a positive rational number, then of course so is $2 x$.

How can we make Mathematica yield this result?

The obvious approach doesn't work:

Assuming[x \[Element] PositiveRationals,
 MemberQ[2 x, PositiveRationals]]

I've tried Reduce and so on, without success.


1 Answer 1

Assuming[Element[x, PositiveRationals], Simplify@Element[2*x, PositiveRationals]]

Mathematica graphics

Assuming[Element[x, PositiveRationals], Simplify@Element[Pi*x, PositiveRationals]]

Mathematica graphics

Help on Element says

enter image description here

  • $\begingroup$ Oh gosh... that simple. Thanks. ($+1, \checkmark$) $\endgroup$ May 30 at 4:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.