Strange behavior of DiracDelta
For rational numbers r
, DiracDelta[x-r]
evaluates:
DiracDelta[x - 1/5]
5 DiracDelta[-1 + 5 x]
Recall that DiracDelta
is a distribution, and is only well defined when it occurs inside of an integral. The two versions are equivalent when used inside of an integral:
Integrate[x^2 DiracDelta[x - a], {x, -Infinity, Infinity}] /. a->1/5
Integrate[x^2 DiracDelta[x - 1/5], {x, -Infinity, Infinity}]
Integrate[x^2 (5 DiracDelta[-1 + 5 x]), {x, -Infinity, Infinity}]
1/25
1/25
1/25
Addendum
You might be curious about why DiracDelta
evaluates in this way. Note that distributions (of which DiracDelta
is one) form a real vector space. This means that Mathematica needs to be able to add DiracDelta
objects that represent the same distribution, even if their arguments are different. Since Mathematica canonicalizes DiracDelta
objects with exact numeric coefficients, the following examples produce a single DiracDelta
object:
DiracDelta[x-1/2] + 2 DiracDelta[2x-1]
DiracDelta[x-1/π] + π DiracDelta[Pi x - 1]
4 DiracDelta[-1 + 2 x]
2 π DiracDelta[-1 + π x]
Converting expressions to a canonical (or normal) form is an essential part of all symbolic algebra programs.
You also might ask why the canonical form of DiracDelta[x-1/5]
is 5 DiracDelta[5x-1]
instead of just the original DiracDelta[x - 1/5]
, but that is a question whose answer I do not know.