How do you write $\int_0^\infty d\phi\ \cos(x\phi)\sin(y\phi)$ as a sum of Dirac deltas? The following result is well-known (ie; I read it in a book)
$$
\int_0^\infty d\phi\ \cos(x\phi)\cos(y\phi) = \frac{\pi}{2} \delta( x + y ) + \frac{\pi}{2} \delta( x - y )
$$
I read it in the appendix of a paper once, wrote it down, and can't find the paper since then. I don't understand how this is derived. My questions are:


*

*How is the above result derived? I can see that setting $x = y$ in the original integral gives $\infty$ and everything else gives $0$, but I don't understand.

*Can a similar kind of result be stated for the integral $\int_0^\infty d\phi\ \cos(x\phi)\sin(y\phi)$?
 A: From trig,
$\cos((x+y)\phi) = \cos(x\phi)\cos(y\phi)-\sin(x\phi)\sin(y\phi)  \\
\cos((x-y)\phi) = \cos(x\phi)\cos(y\phi)+\sin(x\phi)\sin(y\phi)
$
Therefore,
$\cos((x+y)\phi) + \cos((x-y)\phi) = 2\cos(x\phi)\cos(y\phi)$
I figure you can take it from there.
As for your part 2, $\sin((x+y)\phi)+\sin((x-y)\phi)=2\sin(x\phi)\sin(y\phi)$
A: First note that
$$
\cos(x\phi)\cos(y\phi)
=\cos((x+y)\phi)+\cos((x-y)\phi)
$$
In any case, the integral
$$
\int_0^\infty\cos(u\phi)\,\mathrm{d}\phi
$$
doesn't converge. However, we can write
$$
\begin{align}
\int_0^\infty e^{-\lambda\phi^2}\cos(u\phi)\,\mathrm{d}\phi
&=\frac12\int_{-\infty}^\infty e^{-\lambda\phi^2}\cos(u\phi)\,\mathrm{d}\phi\tag1\\
&=\frac12\int_{-\infty}^\infty e^{-\lambda\phi^2}e^{iu\phi}\,\mathrm{d}\phi\tag2\\
&=\frac12e^{-\frac{u^2}{4\lambda}}\int_{-\infty}^\infty e^{-\lambda\left(\phi-i\frac{u}{2\lambda}\right)^2}\,\mathrm{d}\phi\tag3\\
&=\frac12e^{-\frac{u^2}{4\lambda}}\int_{-\infty}^\infty e^{-\lambda\phi^2}\,\mathrm{d}\phi\tag4\\
&=\sqrt{\frac\pi{4\lambda}}e^{-\frac{u^2}{4\lambda}}\tag5
\end{align}
$$
Explanation:
$(1)$: symmetry
$(2)$: $e^{-\lambda u^2}\sin(u\phi)$ is odd
$(3)$: complete the square
$(4)$: no singularities, so we can move the contour
$(5)$: $\int_{-\infty}^\infty e^{-u^2}\,\mathrm{d}u=\sqrt\pi$
$(5)$ is $\pi$ times an approximation of the Dirac-delta function.
