# Integral with Dirac delta (me or wolfram mathematica?) [closed]

I asked the question on math.stackexchange but didn't get an answer so I came here.
I tried to compute with Wolfram Mathematica the following integral $$I=\int_0^\pi\int_{-\infty}^\infty x e^{-\mathrm jx\cos(\theta-\varphi)}f(\alpha\cos(\theta-\psi))\mathrm \, \mathrm dx\mathrm \, \mathrm d\theta$$ where $-\pi\leq\varphi,\psi\leq\pi$.

Assuming that the inner intergral is by definition the derivative of the Dirac delta function I get: $$I=2\pi \mathrm j\int_0^\pi\delta'(\cos(\theta-\varphi))f(\alpha\cos(\theta-\psi)) \, \mathrm \, \mathrm d\theta$$ Wolfram Mathematica tells me that $$I_\mathrm{wolfram}=0$$ Then I tried to do it by hand. If I use the definition of a delta function: $$\begin{eqnarray} \delta^{'} (\cos(\theta-\varphi))&=&\left[ \sum_i \frac{\delta(\theta-\varphi-\frac{\pi}{2}-i\pi)}{|\sin(\frac{\pi}{2}+i\pi)|}\right]^{'}=\sum_i \delta^{'}\left(\theta-\left(\varphi+\frac{\pi}{2}+i\pi\right)\right) \end{eqnarray}$$ $$\begin{eqnarray} I_\mathrm{me}&=&2\pi \mathrm j\sum_i\int_0^\pi\delta'\left(\theta-\left(\varphi+\frac{\pi}{2}+i\pi\right)\right)f(\alpha\cos(\theta-\psi)) \, \mathrm d\theta=\\ &=&-2\pi \mathrm j \sum_i f'(\alpha\cos(\varphi+\frac{\pi}{2}+i\pi-\psi))u(\pi -2 \varphi ) u(2 \varphi +\pi ) \end{eqnarray}$$ where $u(\cdot)$ is a Heaviside function. Here I used the fact that $$\int f(x)\delta'(x-a)\mathrm dx=-\int f'(x)\delta(x-a)\mathrm dx=-f'(a)$$
And $I_\mathrm{me}$ is actually not $0$.
So where's the catch?

-

## closed as off-topic by Alain Valette, Stefan Kohl, Andrey Rekalo, Daniel Moskovich, Ryan BudneyJan 2 '14 at 17:40

This question appears to be off-topic. The users who voted to close gave these specific reasons:

• "MathOverflow is for mathematicians to ask each other questions about their research. See Math.StackExchange to ask general questions in mathematics." – Daniel Moskovich, Ryan Budney
• "This question does not appear to be about research level mathematics within the scope defined in the help center." – Alain Valette, Stefan Kohl, Andrey Rekalo
If this question can be reworded to fit the rules in the help center, please edit the question.

Link to the post on math.stackexchange.com: math.stackexchange.com/questions/484081/… – UwF Sep 12 '13 at 11:34
@m0nhawk --- this product of Heaviside functions just says that $\phi$ should be in the interval $(-\pi/2,\pi/2)$, why would that be zero? – Carlo Beenakker Sep 12 '13 at 19:45
This should be probably be moved to mathematica.SE, as it is probably a matter of what Mma is thinking than anything else. – Mariano Suárez-Alvarez Sep 13 '13 at 6:43

the answer is indeed nonzero, and Mathematica does just fine; here is a screenshot of the output I got:

this answer is not quite what you have written in your post, but in any case nonzero.

UPDATE: with some more experimentation, I think I know why Mathematica might have failed you; as you can see from the code I gave above, I'm evaluating the integral for one value of $\phi$ at the time; an attempt to get an answer with $\phi$ as a symbolic variable returns zero; no idea why, but fortunately there is a workaround, as shown above.

-
Amusingly, Integrate[ f[\[Alpha] Cos[\[Theta] - \[Psi]]] Derivative[1][DiracDelta][ Cos[\[Theta] - \[Phi]]], {\[Theta], 0, \[Pi]}, Assumptions :> \[Phi] > 0] evaluates correctly (albeit a bit strangely), as does the same thing but wth the assumption changed to <0 or ==0. But if the assumption is changed to Element[\[Phi], Reals] nothing is evaluated. – Mariano Suárez-Alvarez Sep 13 '13 at 6:42

Since the solutions to this query and its twin on MSE are riddled with errors, I have decided to bite the bullet and give a rigorous treatment. Perhaps I can begin with the the general remark that most of the inquiries about distributions here and on its two siblings are about the Dirac distribution and its derivatives, usually in connection with their composition with a smooth function. As far as I can tell, none of the treatments that one finds employ a rigorous definition of this concept (although this has been known for over 50 years) but rely on formal manipulations under the motto---if it works for smooth functions, then it will work for distributions. While this might be acceptable,even desirable, for a theoretical physicist, one expects more from a forum for research mathematicians. And it can lead to disaster, as the present case shows.

And so to the definitions. Here there is another pitfall. There are two such, one as in Schwartz which uses duality and does not correspond to the usage of physicists---it generalises the notion of composition for measures.

The one we give here is simpler and does correspond to that of the physicists. It uses the fact that a distribution $T$ has the form $D^n F$ for some continuous function $F$. (This is true locally for every distribution and globally for the ones in question here). One then defines $T\circ \phi$ to be $(\frac 1{\phi'} D)^n F\circ \phi$ for suitable smooth functions $\phi$---more on this later. We remark that there is an issue here---one has to show that this is independent of the partular representation of the distribution as a (higher) derivative of a continous function. This is covered in the reference below.

If one applies this to $\delta'$, which is, up to a factor, the third derivative of $|x|$, one gets the formula $$\delta'\circ \phi=\pm \frac 1{\phi'(0)^2}\delta',$$ the sign being that of $\phi'(0)$.

This is valid for smooth diffeomorphisms with zero at the origin and whose derivative there is non zero. One can extend this to functions such as are required here (the cosine function) using standard partition of unity methods (called "recollement des morceaux" by Schwartz). The basic idea is to cover the real line with open intervals on each of which $\phi$is a diffeomorphism whose derivative is non-zero at any zero and then to sum the corresponding expressions over the zeros.

The integral in the OP can then be obtained in one line and takes on a simple and elegant form as an infinite sum over the zeros of the cosine terms---since I am typing this on my iPad I would rather leave the details to the poser.

Final remark: The above method is due to J. Sebastião e Silva and a detailed treatment can be found in "An Introduction to the Theory of Distributions" by J. Campos Ferreira, which is based on lectures given by the former in Lisbon in the late 60's.

-
you mention that my solution is "riddled with errors", which it may well be, but I'm curious: can you correct the two explicit answers I give for $\phi=0$ and $\phi=\pi/4$? – Carlo Beenakker Jan 2 '14 at 16:16
I didn't write that your solution was riddled with errors, but the the solutions were (meaning the text comprising the family of solutions on the two sites).Having said that I would repeat my main quibble that I don't think that pressing a button and getting two terms of an infinite series which comprises the correct solution and which can be obtained simply and rigorously in a couple of lines is really a correct and appropriate solution. – 7891user Jan 2 '14 at 16:45
but that's probably just me. – 7891user Jan 2 '14 at 16:50
If you feel that my answer does you an injustice, I have no objection to your deleting it. – 7891user Jan 2 '14 at 17:18