(L&L vol. 4, sec. 7) Normalization of Spherical Wavefunctions of Photons In volume 4, section 7 of the Landau and Lifshitz collection (second edition) the authors discuss spherical wavefunctions of photons. I'm having trouble understanding how the equality in (7.7) is obtained.
It is said that the wavefunction (in the momentum representation) of a photon having an angular momentum $j$ and component along some given axis $m$ is
$$\mathbf{A}_{\omega j m}(\mathbf{k})=\frac{4\pi^2}{\omega^{3/2}} \delta(|\mathbf{k}|-\omega)\mathbf{Y}_{jm}(\mathbf{n}),$$
where $\mathbf{n}$ is a unit vector representing direction and $\mathbf{Y}_{jm}$ are the "spherical harmonic vectors" which satisfy the normalization relation
$$\int \mathbf{Y}_{jm}\cdot \mathbf{Y}_{j'm'}^* d o = \delta_{jj'}\delta_{mm'},$$
where $o$ represents solid angle and integration takes place over all directions.
Equation (7.7) states that the photon wavefunctions satisfy the normalization
$$\frac{1}{(2\pi)^4} \int \omega\omega' \mathbf{A}_{\omega'j'm'}^*(\mathbf{k})\cdot\mathbf{A}_{\omega jm}(\mathbf{k})d^3k=\omega \delta(\omega'-\omega)\delta_{jj'}\delta_{mm'}.$$
I do not follow how this equality is obtained. When I attempt to plug in the available expressions in this integral I obtain
$$ \int \frac{1}{\sqrt{\omega\omega'}}\delta(|\mathbf{k}|-\omega')\delta(|\mathbf{k}|-\omega)\mathbf{Y}_{jm}\cdot \mathbf{Y}_{j'm'}^* |\mathbf{k}|^2\hphantom{;}d|\mathbf{k}|\hphantom{;}d o = \int \frac{\delta(|\mathbf{k}|-\omega')\delta(|\mathbf{k}|-\omega)}{\sqrt{\omega\omega'}}\delta_{jj'}\delta_{mm'} |\mathbf{k}|^2\hphantom{;}d|\mathbf{k}|.$$
I do not understand how to deal with the two delta functions appearing under the integral. I can see that if $\omega\neq\omega'$ then this could be interpreted to be $0$. However when $\omega=\omega'$, a square of the delta function appears, the integral of which does not exist.
I hope someone can help out, and thank you in advance.
 A: You need the identity
$$
\int dx \delta(x-y)f(x) = f(y).
$$
In particular, for $f(x)=\delta(x-z)g(x)$ you get
$$
\int dx \delta(x-y)\delta(x-z)g(x)=\delta(y-z)g(y)=\delta(y-z)g(z).
$$
This is, of course, "physicist" level of rigor. Formally to work with such integrals you need to interpret them as convolutions of distributions etc.
A: One can see this a bit more directly also:
When squaring a delta function like $\delta(P_f - P_i)$ we interpret can it as
$$[\delta(P_f - P_i)]^2 = \delta(P_f - P_i) \delta(P_f - P_i) = \delta (P_f - P_i) \delta(0)$$
where the first factor imposes $P_f - P_i = 0$ so that in the second one we can just insert this value into it. This is used for example in the first section on the scattering matrix chapter.
In this case we can do a similar thing, setting
$$\delta(|\mathbf{k}|-\omega') \delta(|\mathbf{k}|-\omega) = \delta(\omega-\omega') \delta(|\mathbf{k}|-\omega)$$
where you should check what happens below if we choose the other delta function, i.e. you just look at it and interpret it and done.
Using also
$$d^3 k = |\mathbf{k}|^2 d |\mathbf{k}| d o$$
we find
\begin{align}
\frac{1}{(2\pi)^4} &\int \omega\omega' \mathbf{A}_{\omega'j'm'}^*(\mathbf{k})\cdot\mathbf{A}_{\omega jm}(\mathbf{k})d^3k \\
&= \frac{1}{(2\pi)^4} \int \omega\omega' \frac{(2\pi)^2}{\omega'^{3/2}} \delta(|\mathbf{k}|-\omega')\mathbf{Y}_{j'm'}^*(\mathbf{n}) \cdot \frac{(2\pi)^2}{\omega^{3/2}} \delta(|\mathbf{k}|-\omega)\mathbf{Y}_{jm}(\mathbf{n}) d^3 k \\
&= \frac{(2 \pi)^4}{(2\pi)^4} \int \frac{1}{\sqrt{\omega \omega'}} \delta(|\mathbf{k}|-\omega') \delta(|\mathbf{k}|-\omega)\mathbf{Y}_{j'm'}^*(\mathbf{n}) \cdot \mathbf{Y}_{jm}(\mathbf{n}) ||\mathbf{k}|^2 d |\mathbf{k}| d o \\
&= \int \frac{|\mathbf{k}|^2}{\sqrt{\omega \omega'}} \delta(|\mathbf{k}|-\omega') \delta(|\mathbf{k}|-\omega) \delta_{j'j} \delta_{m'm} d |\mathbf{k}| \\
&= \delta_{j'j} \delta_{m'm}\int \frac{|\mathbf{k}|^2}{\sqrt{\omega \omega'}} \delta(\omega-\omega') \delta(|\mathbf{k}|-\omega) d |\mathbf{k}| \\
&= \delta_{j'j} \delta_{m'm} \frac{\omega^2}{\sqrt{\omega \omega'}} \delta(\omega-\omega') \\
&= \delta_{j'j} \delta_{m'm} \frac{\omega^2}{\sqrt{\omega \omega}} \delta(\omega-\omega')  \\
&=  \delta_{j'j} \delta_{m'm} \omega \delta(\omega-\omega')
\end{align}
where we set $\omega' = \omega$ under the square root in the second last step due to the delta funtion beside this term.
