MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

UnitStep bugs remain in ver. 5.01

  • To: mathgroup at
  • Subject: [mg53026] UnitStep bugs remain in ver. 5.01
  • From: jackgold at
  • Date: Mon, 20 Dec 2004 06:34:51 -0500 (EST)
  • Sender: owner-wri-mathgroup at

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.


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 ...

  • Prev by Date: Re: Vector Piecewise in 5.1
  • Next by Date: Re: Re: File association in 5.01
  • Previous by thread: Re: All Factors of a number
  • Next by thread: Information about subscripted function