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:
myop[myfn[x],x]
(* Out: smoothfn[x] + (A[x0]-B'[x0]) DiracDelta[x-x0] + B[x0] DiracDelta'[x-x0] *)
Is there a simple way to achieve this?
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$Integrate[f[x]*DiracDelta'[x - 2], {x, -Infinity, Infinity}]
makes no sense in traditional math. $\endgroup$