Because type is (usually) syntactic rather than semantic, i.e. it looks at what the Maple structure of an object is, rather than the mathematical nature of what it represents. In this case, your expression is not literally an integer or a quotient of two integers, so it is not of type rational. You can, however, use simplify to transform this expression into 2.
Comments
rational
Because type is (usually) syntactic rather than semantic, i.e. it looks at what the Maple structure of an object is, rather than the mathematical nature of what it represents. In this case, your expression is not literally an integer or a quotient of two integers, so it is not of type rational. You can, however, use simplify to transform this expression into 2.
simplify
Not sure what you want it to do, but the type function only checks the surface type. Use simplify:
Simplify
Thank you both. That makes it very clear.
I'll try harder next time. Some day, I hope to be able to think more like you. Thanks again.