bug affecting piecewise in maple v.5 (22.2.99)

Robert Michael Sinclair (PHj)

Can anyone explain the following? The first result is fine, but the second is blatantly wrong (the only difference is that the second function has "sin(x)/x" instead of "sin(x)" for x¿0):

It is corrected with Maple 6. (U. Klein)

Preben Alsholm (24.2.99)

The bug appears to be in `convert/piecewise`. The procedure `diff/piecewise` converts the expression to Heaviside before it (correctly) differentiates the expression.

The result is then converted to piecewise, the result of which is wrong (in your last example).

Here is an imitation of what is going on: