Re: UnitStep in Mathematica 4.1
- To: mathgroup at smc.vnet.net
- Subject: [mg38210] Re: [mg38180] UnitStep in Mathematica 4.1
- From: Jack Goldberg <jackgold at umich.edu>
- Date: Thu, 5 Dec 2002 03:31:04 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi Matt, Every so often a user like yourself asks a question involving, directly or indirectly, about UnitStep. Becasue I too found Mathematica's implementation of UnitStep "spotty" I wrote for myself a package that handles all (?) reasonable cases and a few "unreasonable" ones. I keep meaning to submit it for others to use but one thing or another keeps me from it. Oh well... Now to answer your question. All functions with jump continuities can be written as a sum of the form f0[x] + f1[x]*UnitStep[x-b1] + f2[x]*UnitStep[x-b2] +...+ fn[x]UnitStep[x-bn] +g[x] where each fi[x] has no jumps and g[x] is a similar sum of DiscreteDelta functions. But when one integrates, the integrals of DiscreteDelta is zero so the g[x] term can be ignored. Now the critical point: Mathematica knows how to integrate sums of the type given above! So all you have to do is write UnitStep[-x]*UnitStep[x] as a sum of this type. Since 0 is the only jump of this function (and neglecting g[x]) we have UnitStep[-x]*UnitStep[x] = 1 + f1[x] UnitStep[x] But at x=0, the lhs = 1 so f1[x] = 0 and you have your answer. My program does all this simplification automatically. Jack (Dr. UnitStep) Goldberg On Wed, 4 Dec 2002, Matt Pillsbury wrote: > Hi, > > I have been relying on the UnitStep function in a project, and in > general it seems to work pretty nicely. However, there is one simple > problem that I'm having with it. Mathematica doesn't know that > > Integrate[UnitStep[-x] UnitStep[x], {x,-1,1}] > > should be zero. Is this because the integrand is 0 everywhere but at > the origin, where it is 1, and Mathematica doesn't know what to do > with the contribution from a set of measure zero? Or am I doing > something else wrong? > > And is there a simple fix for my problem? > > Thanks, > Matt Pillsbury >