The command piecewise has come up in diﬀerent ways recently and I would like to ask about my experience with this command.
I am attemping to teach a class on Maple and am perplexed about using the command convert with piecewise.
I have run into several problems when converting max to piecewise. In particular,
Several examples of this type were discovered. Even more interesting is that sometimes a convert could be done with the correct answer being returned but after a restart an incorrect answer would be returned. One can even oscillate between the correct and an incorrect answer.
This happens on the student version release 4 in our lab and also on my release 5.0 Professional version.
At ﬁrst I thought this bug had been corrected in Release 5.1, but some experimentation revealed that it still happens (sometimes). The factor that it only happens sometimes would tend to indicate that it depends on the arbitrarily-chosen ordering of some set or expression. I’ve traced the bug into `unitstep/simpout`, which consistently does the following:
Here it seems "unitstep(x)" is supposed to be 1 if x > 0 and 0 if x <= 0. So unitstep(x^2 - x^5) should be 1 if x < 0 or 0 < x < 1, 0 otherwise, which could be
But Maple’s answer is incorrect for x > 1.
On the other hand,
which is correct.
I believe that this bug was ﬁxed in version 5.1. Here is what I get: