1
$\begingroup$

Define:

In:= Dirac /: Dirac[x_, y_] f_[x_] := f[y]

This works like Dirac's Delta. For example,

In:= h[x] Dirac[x,y]

Out:= h[y]

perfect! However if I ask:

In:= h[x] k[x] Dirac[x,y]

Out:= h[y] k[x]

It does not change both arguments.
I will apply this with products of functions f1[x] f2[x] ... fn[x] Dirac[x,y] and need all arguments to change. How can I do this? Thanks!

$\endgroup$
  • 1
    $\begingroup$ Instead of writing Dirac[x,y] after an expression you can write /. x -> y after the expression. Does that do what you want ? $\endgroup$ – LouisB Jun 11 at 23:52
  • $\begingroup$ The product of the distribution DiracDelta and a usual function f[x] is defined under some conditions on f[x] only. See Wiki en.wikipedia.org/wiki/Dirac_delta_function as a first reading. $\endgroup$ – user64494 Jun 12 at 3:24
2
$\begingroup$

You could try the following definition:

Dirac /: Verbatim[Times][a___, Dirac[x_,y_], b___] := Times[a,b] /. x->y

Your examples:

h[x] Dirac[x,y]
h[x] k[x] Dirac[x, y]

h[y]

h[y] k[y]

$\endgroup$
1
$\begingroup$

The definitions you try to impose on the dirac delta distribution aren't correct ( theory of distributions )!

Integrate[h[x] DiracDelta[x, y], {y, -Infinity, Infinity}, {x, -Infinity, Infinity}]
(* h[0]  *)    

Integrate[h[x] k[x] DiracDelta[x, y], {y, -Infinity, Infinity}, {x, -Infinity, Infinity}]
(* h[0] k[0]  *)    
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.