# Which version of Mathematica did DiracDelta become to the derivative of HeavisideTheta from that of UnitStep?

The mathematica's version of my coworkers is 5.0, they use UnitStep to derive formula, However, I also want to use the parallel features so used the latest version 11.3. then I found UnitStep in the two versions is different, the UnitStep's derivative in 5.0 is DiracDelta, but not in 11.3. In version 11.3, DiracDelta becomes HeavisideTheta's derivative. I want to know:

1. Which is the first version where the difference appeared?
2. If HeavisideTheta=1, is HeavisideTheta in v11.3 equal to UnitStep in v5.0?
3. Can I replace UnitStep to HeavisdeTheta?

Thanks!

In version 5.0 In version 11.3 • Can I summarize the question as, you need a UnitStep that differentiates to DiracDelta? Is there any other feature required? – xzczd Nov 8 '19 at 5:04
• @xzczd , Thanks for your attention, we always got different results using UnitStep in MMA 5.X and MMA 11.3 to derive symbolic formulas, we also have used HeavisideTheata in 11.3 to derive, but the results are different from correct results, so our work group use 5.0 when deriving symbolic formulas ,then use 11.3 when calculating and plotting because the graphics are better in 11.3 than in 5.0. – likehust Nov 8 '19 at 7:01
• @xzczd ,I want to know if I can copy the function UnitStep in 5.0 as a package to 11.3 like in Matlab copying a function definition file to a work folder, or can I use a command in 11.3 to call UnitStep locating in 5.0 directory? Thank you. – likehust Nov 8 '19 at 7:02
• I think it's hard (if not impossible) because UnitStep is a built-in function. Perhaps some clever use of mathlink (Now it's called WSTP link) will help? I've no idea. "We also have used HeavisideTheta in 11.3 to derive, but the results are different from correct results" This sounds strange, can you show a specific example? – xzczd Nov 8 '19 at 7:05
• Well, I still think it's better to figure out why 11.3 doesn't deduce the correct result. Creating a minimal example should not be too hard. Anyway, it's your choice. – xzczd Nov 8 '19 at 7:28

This script is from a Mathematica version 6.0 session using 'math.exe'

Mathematica 6.0 for Microsoft Windows (32-bit)

In:= D[#@x, x] & /@ {UnitStep, HeavisideTheta}

Out= {Piecewise[{{Indeterminate, x == 0}}], DiracDelta[x]}

In:=

• Thank you for providing these information, you verified my guess at the same time. MMA 6.0 substitutes ArrayFlatten, ConstantArray, Take... for BlockMatrix, ZeroMatrix, TakeMatrix..., so I guess from where UnitStep and HeavisideTheta came to an change. would you proceed to answer question 2 and 3 mentioned above? – likehust Apr 19 '19 at 0:35
• @likehust I would if I had access to version 5.0 but I don't. – Somos Apr 19 '19 at 1:04

If HeavisideTheta = 1, is HeavisideTheta in v11.3 equal to UnitStep in v5.0?

For calculus purposes, sure. Can I replace UnitStep with HeavisideTheta?

HeavisideTheta[] is what you should be using in version 6 and later versions, because it's the one now supported extensively by the calculus functions. In earlier functions, you have to settle for UnitStep[].

You can always use $VersionNumber along with conditionals (e.g. If[], Which[]) to write code that does different things depending on the version the code is evaluated in. If[$VersionNumber >= 6., HeavisideTheta'[x], UnitStep'[x]]

• Yesterday, My coworker got different results in MM10 and MM5.0 while running same program codes. Now, I am transferring my own codes from MM10 to MM5.0 in hoping to find a good luck by changing HeavisideTheta[] to UnitStep[], certainly, it's a hard work because involving the replacement of other functions such as ParallelMap, ArrayFlatten, ParallelNeeds, ConstantArray, and so on. – likehust Sep 26 '19 at 1:34