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.
Thank you in advance.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityHow 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.
Thank you in advance.
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]
.
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]
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
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]
$\endgroup$
– Itai Seggev
Aug 29 '17 at 22:50
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.
$\endgroup$
– Itai Seggev
Aug 29 '17 at 23:00
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]
{}
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.
$\endgroup$
– Michael E2
Aug 24 '18 at 18:15
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}]
$\endgroup$ – Bob Hanlon Aug 23 '17 at 14:08