# Difference between UnitStep and HeavisideTheta?

In Mathematica, UnitStep == 1 and HeavisideTheta remains unevaluated. In addition, D[UnitStep[x], x] is 0 if x != 0 and Indeterminate if x == 0, whereas D[HeavisideTheta[x],x] = DiracDelta[x].

It seems to me that UnitStep is the idealization of a leading edge of a perfect pulse, whereas HeavisideTheta[x] is like an ideal Fourier Transform of the ideal UnitStep[x] function. Is this a good way to distinguish between the two, and are there any other significant programming or mathematical distinctions between the two functions?

Thanks.

• As a rough rule of thumb: use HeavisideTheta[] for symbolic calculations, and UnitStep[] for numerical calculations. – J. M. will be back soon Sep 20 '17 at 0:20
• Thanks @J.M. I'll keep that in mind. Kudos. – user51904 Sep 20 '17 at 0:22
• Just to expand on @J.M.'s "UnitStep for numeric" comment. Doing list = RandomReal[1, 10^6]; AbsoluteTiming[UnitStep[list];] AbsoluteTiming[HeavisideTheta[list];]. UnitStep comes out as two orders of magnitude faster. – aardvark2012 Sep 20 '17 at 11:25
• That's an interesting consideration @aardvark2012, thanks for the addition. – user51904 Sep 28 '17 at 22:56