Manoukian in QFT I page 236 writes an equality of the form
$$\delta\left((k^0)^2-|\mathbf{k}|^2\right)=\frac{\delta(k^0-|\mathbf{k}|)+\delta(k^0+|\mathbf{k}|)}{2|\mathbf{k}|}$$
(with $k$ the components of a photon four-momentum) but provides no further explanation.
My approach was with a product $\delta(ab)$, in which working backwards with a limit definition gives $$\frac{\epsilon}{\frac{a^2b^2 + \epsilon^4}{a^2+b^2} + \epsilon^2} + \mathcal{O}( \epsilon^2)$$ $$\implies \delta(a)+\delta(b)=\delta\left(\frac{ab}{\sqrt{a^2+b^2}}\right)$$
For the case at hand we are dealing with a photon four-momentum so on shell $(k^0)^2+|\mathbf{k}|^2=0+2|\mathbf{k}|^2$, but this gives
$$\delta\left(\frac{(k^0)^2-|\mathbf{k}|^2}{\sqrt{2}|\mathbf{k}|}\right)=\delta(k^0-|\mathbf{k}|)+\delta(k^0+|\mathbf{k}|)$$
instead. Treating $k$ as a constant my derivation is off by a factor of $\sqrt{2}$.
- How is the identity derived?
Since $\int_{\Bbb R}\delta(x)f(x)dx=f(0)$, integration by substitution gives$\int_{\Bbb R}\delta(g(x))f(g(x))g^\prime(x)dx=f(0)$ for injective $g$ of domain and range $\Bbb R$. If instead $g$ has countably many roots, each of them gets a $\delta$-spoke contribution, viz.$$\int_{\Bbb R}\delta(g(x))h(x)dx=\sum_{g(y)=0}\frac{h(y)}{\left|g^\prime(y)\right|}=\sum_{g(x)=0}\int_{\Bbb R}\frac{\delta(x-y)h(x)dx}{\left|g^\prime(y)\right|}.$$Restating this as a result on measures instead of integrals,$$\delta(g(x))=\sum_{g(y)=0}\frac{\delta(x-y)}{|g^\prime(y)|}.$$You want the special case $x=k^0,\,g(k^0)=\left(k^0\right)^2-|\mathbf{k}|^2$, so $g$ has two roots, $\pm|\mathbf{k}|$.
As an addendum, let's revisit your approach. With $a=k^0-|\mathbf{k}|,\,b=k^0+|\mathbf{k}|$ we get$$\frac{\delta(a)+\delta(b)}{b-a}=\frac{1}{b-a}\delta\left(\frac{ab}{\sqrt{a^2+b^2}}\right)=\frac{\sqrt{a^2+b^2}}{b-a}\delta\left(ab\right),$$with $k^0=|\mathbf{k}|\implies a=0\implies\frac{\sqrt{a^2+b^2}}{b-a}=1$ as required.