# Verifying $x(t)\delta(t)=x(0)\delta(t)$ in Mathematica

How can I verify the property $x(t)\delta(t)=x(0)\delta(t)$ in Mathematica? I tried with:

In[5]:= x[t_] := t

In[6]:= x[t] DiracDelta[t] == x[0] DiracDelta[t]

Out[6]= t DiracDelta[t] == 0


I expect the output True.

• Ar you sure you weren't thinking about $$\int_{-\infty}^\infty f(x)\delta(x)\mathrm dx=f(0)$$? – J. M.'s ennui Aug 23 '17 at 13:22
• Hi @J.M. see (3) physicspages.com/2011/02/16/dirac-delta-function please. – Gennaro Arguzzi Aug 23 '17 at 13:23
• The above property is also at page 81 on book Bracewell - The Fourier Transform And Its Applications. – Gennaro Arguzzi Aug 23 '17 at 13:58
• As a generalized function, DiracDelta is defined in the context of an integral. Integrate both sides: Integrate[x[t] DiracDelta[t], {t, -Infinity, Infinity}] == Integrate[x[0] DiracDelta[t], {t, -Infinity, Infinity}] – Bob Hanlon Aug 23 '17 at 14:08
• Closely related: Why doesn't FullSimplify simplify expressions with DiracDelta? – Jens Aug 24 '18 at 23:12

As noted by Bob Hanlon in the comments, $\delta(t)$ is not defined outside of integrals, so it doesn't make any sense to ask the question whether $x(t)\delta(t)=x(0)\delta(t)$.

However, what you can do is verify that both expressions behave the same under the integral, i.e. that $\int f(t) g(t)\mathrm{d}t$ is the same for $f(t)=x(t)\delta(t)$ and $f(t)=x(0)\delta(t)$:

In[1]:=  Integrate[x[t] DiracDelta[t] f[t], t] == Integrate[x[0] DiracDelta[t] f[t], t]
Out[1]:= True


Here, you don't need to define anything for x[t], as this is true for all x[t].

### Update 2

As noted in the comments, we should only consider definite integrals. This leads to the following definition of GeneralizedEqual:

GeneralizedEqual[f_, g_, t_, opts : OptionsPattern[]] :=
Integrate[h[t] f, {t, -Infinity, Infinity}, opts]
== Integrate[h[t] g, {t, -Infinity, Infinity}, opts]


With this definition, we can also prove the generalized version of the original equation (again, see comments), $\delta(t-T)x(t)"="\delta(t-T)x(T)$:

In[1]:= GeneralizedEqual[DiracDelta[t - T] f[t], DiracDelta[t - T] f[T], t]
Out[1]= ConditionalExpression[True, T \[Element] Reals]


### Update

To make it a bit nicer to look at, you can introduce a generalized version of ==:

In[1]:=  GeneralizedEqual[f_, g_, t_] := Integrate[h[t] f, t] == Integrate[h[t] g, t]
In[2]:=  GeneralizedEqual[x[t] DiracDelta[t], x[0] DiracDelta[t], t]
Out[2]:= True

• Hi @Mathe172. I tried to prove Integrate[DiracDelta[t - T] f[t], t] == Integrate[DiracDelta[t - T] f[T], t], but the output is not True. Can you tell me I get True please? – Gennaro Arguzzi Aug 24 '17 at 9:34
• Your definition of GeneralizedEqual is not quite right, since the generalized functions are only defined via definite integrals. So this would be a better one: GeneralizedEqual[f_, g_, t_,opts:OptionsPattern[]] := Integrate[h[t] f, {t,-Infinity,Infinity},opts] == Integrate[h[t] g, {t,-Infinity,Infinity},opts] – Itai Seggev Aug 29 '17 at 22:50
• @GennaroArguzzi See my comment my previous comment. If you used the GeneralizedEqual from there, you will find that GeneralizedEqual[DiracDelta[t - T] f[t], DiracDelta[t - T] f[T], t] returns ConditionalExpression[True, T \[Element] Reals], and indeed the result is only valid if T is a real number. – Itai Seggev Aug 29 '17 at 23:00
• @ItaiSeggev Thanks for pointing that out - I updated the answer to incorporate your improvements – Lukas Lang Aug 30 '17 at 9:13

You get it directly with FunctionExpand:

 In[1]:= FunctionExpand[DiracDelta[t]*f[t]]

Out[1]= DiracDelta[t] f[0]

In[2]:= FunctionExpand[DiracDelta[t-5]*f[t]]

Out[2]= DiracDelta[-5+t] f[5]

In[3]:= FunctionExpand[DiracDelta[t+2]*f[t]]

Out[3]= DiracDelta[2+t] f[-2]

• Welcome to Mathematica.SE! You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is useful for learning how to format your questions and answers. You may also find this meta Q&A helpful. Executing SetOptions[\$FrontEnd, ExportMultipleCellsOptions -> {"IncludeCellLabels" -> False}] will keep the In[]/Out[] labels from being pasted. That makes it easier for others to copy and test code. – Michael E2 Aug 24 '18 at 18:15