Suppose that I have a function of the form:

myfn[x_] = smoothfn[x] + A[x] DiracDelta[x-x0] + B[x] DiracDelta'[x-x0],

where smoothfn is some smooth function.

It is a well-known result that for any smooth function $F(x)$, we have the following properties:

$$ F(x) \delta(x-x_0) = F(x_0) \delta(x-x_0), \qquad \qquad \qquad \qquad F(x) \delta'(x-x_0) = -F'(x_0) \delta(x-x_0) + F(x_0) \delta'(x-x_0). $$

(This can be checked by integrating both sides against an arbitrary test function). I would like to implement a function in Mathematica, myop, that takes a function as its first argument (presumably one would need to reserve a second argument to tell it what the variable is) and returns the function so that all the coefficients in front of the Dirac functions (and their derivatives) are evaluated at $x_0$. In the above example, I would want something of the type:

(* Out: smoothfn[x] + (A[x0]-B'[x0]) DiracDelta[x-x0] + B[x0] DiracDelta'[x-x0] *)

Is there a simple way to achieve this?

  • 1
    $\begingroup$ That second case looks wrong. Should only be the F'[x_0] term, and that negated (derived by IBP). Example:In[87]:= Integrate[f[x]*DiracDelta'[x - 2], {x, -Infinity, Infinity}] Out[87]= -Derivative[1][f][2] $\endgroup$ May 12 at 15:47
  • $\begingroup$ @DanielLichtblau: The expression Integrate[f[x]*DiracDelta'[x - 2], {x, -Infinity, Infinity}] makes no sense in traditional math. $\endgroup$
    – user64494
    May 12 at 20:02
  • $\begingroup$ @DanielLichtblau Sorry, corrected the typo. $\endgroup$
    – Patrick.B
    May 12 at 22:37
  • $\begingroup$ @user64494 It makes as much sense as same but sans the prime. And I would be careful with a term like “traditional math”. It is simply unclear what assumptions are being made e.g. about f[x]. $\endgroup$ May 13 at 16:39


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.