UnitStep bugs remain in ver. 5.01

*To*: mathgroup at smc.vnet.net*Subject*: [mg53026] UnitStep bugs remain in ver. 5.01*From*: jackgold at umich.edu*Date*: Mon, 20 Dec 2004 06:34:51 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

Hello everyone; I am using Mac OS 10.3 and have just upgraded to ver 5.1. Many versions ago I took an interest in how Mathematica handles the unit step function. Up until recently it was an add-on but now (and perhaps earlier) it is a built in function. One would have expected that some of the minor bugs would have been removed, but they have not. I record here for your study this particular bug: UnitStep[x^2]/.x->0 returns 1, as it should. However, UnitStep[x^2]//FunctionExpand returns UnitStep[-x]+UnitStep[x] This is inconsistent with the first (correct) result at x = 0, since UnitStep[-x]+UnitStep[x]/.x->0 returns 2. IMO this inconsistency is due to a failure of FunctionExpand. The correct expansion should contain a term - DiscreteDelta[x] which is zero everywhere except at x=0 at which point it is -1. The example of the use of Function Expand in the Help fails for the same reason but this time at x = 2. I have written Wolfram about this many years ago and did so again yesterday. The problem in general is this: FunctionExpand[UnitStep["any polynomial"]] fails at some of the zeros of "any polynomial". For most uses, I suppose this in a triviality, but one might be able to construct a use for which this error turns out to be important. Oh well, maybe next year ...