Re: A buglet in FunctionExpand (Correction)
- To: mathgroup at smc.vnet.net
- Subject: [mg27694] Re: [mg27665] A buglet in FunctionExpand (Correction)
- From: BobHanlon at aol.com
- Date: Sun, 11 Mar 2001 04:04:37 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I forgot to check whether FunctionExpand accepts Assumptions. It does. FunctionExpand[UnitStep[x^2], Element[x, Reals]] 1 FunctionExpand[UnitStep[x^(2*n)], Element[x, Reals] && Element[n, Integers]] 1 Bob Hanlon In a message dated 2001/3/10 9:20:36 AM, writes: >While I agree that Mathematica should handle these when using FunctionExpand, >it should be pointed out that these cases are handled by FullSimplify with >Assumptions > >$Version > >"4.1 for Power Macintosh (November 2, 2000)" > >FullSimplify[UnitStep[x^2], Element[x, Reals]] > >1 > >Off[General::ivar] > >FullSimplify[UnitStep[x^(2*n)], Element[x, Reals] && Element[n, Integers]] > >1 > >Bob Hanlon > >In a message dated 2001/3/10 1:10:15 AM, jackgold at math.lsa.umich.edu writes: > >>FunctionExpand is a very powerful tool and like all powerful tools it >>should be used with some care. One use I have made of FunctionExpand >is >>simplifing UnitStep[***]. In doing so I have discovered one bug reported >>here a few months ago and now report a buglet, a result that is more or >>less correct but not in reasonable form. >> >>Try, >> >> FunctionExpand[ UnitStep[x^2] ] >> >>and you will get >> >> UnitStep[-x]+UnitStep[x] >> >>on a Mac or Unix system running ver 4.0. The output fails to agree with >>the input at x = 0. The correct answer is, of course >> >> FunctionExpand[ UnitStep[x^2] ] -> 1 since x^2 >= 0 for all x. >> >>Similar incorrect answers occur when the argument of UnitStep is any >>even power of x+a. >> >>Now some additional comments directed at those with a serious interest >>in >>Piecewise Continuous functions: >> >>My experience with identities involving UnitStep suggests that one must >>either give up some simplifications in order that the input and output >>agree for all real x. Example, if you want UnitStep[-x] to simplify >>to >>1-UnitStep[x] then as above these two functions disagree only for x=0. >>Redefining UnitStep[0] = 1/2 leads to the failure of UnitStep[x]^n = >>UnitStep[x] at x = 0 for every positive n. >> >>Mathematica provides an interesting partial solution which I came across >>quite accidentally: >> >> FunctionExpand[ UnitStep[-x]UnitStep[x] ] -> DiscreteDelta[x] >> >>So, >> >> UnitStep[-x] -> 1-UnitStep[x]+DiscreteDelta[x] >> >>saves this desired identity. >> >>My suggestions to the gurus at Mathematica: Clean up these peculiarities. >> Either >>except the fact that FunctionExpand[ ... something involving UnitStep...] >>may lead to an expression differing from the argument of FunctionExpand >>at >>a finite number of points, or use DiscreteDelta systematically. In any >>case, UnitStep[x^(2r)] is identically 1! >>