# UnitStep vs HeavisideTheta; KroneckerDelta vs DiscreteDelta

What are the differences between these pairs of functions? In many cases, they seem to act the same. For example, both DiscreteDelta and KroneckerDelta are defined to be 1 when the argument is 0 and zero otherwise. Both exhibit the "sifting" property:

{Sum[KroneckerDelta[a, 3] f[a], {a, Infinity}],
Sum[DiscreteDelta[a - 3] f[a], {a, Infinity}]}
{f,f}


Similarly, both UnitStep and HeavisideTheta plot the same, and act the same in many situations -- you can simply replace one with the other in many of the examples in the Help files, for instance:

Integrate[HeavisideTheta[x Cos[x]], {x, -5, 5}]


and

Integrate[UnitStep[x Cos[x]], {x, -5, 5}]


return the same thing. Yet they are not identical. Consider:

D[HeavisideTheta[t], t]


which returns DiracDelta[t] vs.

D[UnitStep[t], t] The question is how to understand the differences in these functions, how to know what situations would call for HeavisideTheta vs DiracDelta and when to use KroneckerDelta instead of DiscreteDelta. Is there an underlying pattern?

• Nov 13, 2017 at 22:40
• The admonition I gave in the comments of the question @aardvark linked to still very much apply. Nov 14, 2017 at 0:12

The main difference is that UnitStep is defined at the discontinuity and HeavisideTheta is not.

y[x_] = UnitStep[x];

y
(* 1 *)

y1[x_] = HeavisideTheta[x];

y1
(* HeavisideTheta *)


According to the Help pages, DiscreteDelta[n1,n2...] is 1 if all the n's are 0, and KroneckerDelta[n1,n2...] is 1 of all the n's are equal.