This question is related to $f(k) = 0$, but we now we consider $\delta(f(k))$, i.e.
$\delta\left( \left[\sqrt{p^2+m^2}-\sqrt{k^2+p^2+2\cdot k\cdot p\cos(\theta)}\right]^2 -k^2-m^2 \right)$
We found in the link given that the only real solutions of $f(k)=0$ occur when $\cos\theta = -1 $ and $k=p$.
The problem is that to use the composition formula Dirac Delta Composition with a function, we must have $f'(k_i) \not=0$ where $k_i$ are the roots of $f(k) = 0$, but this is not so in this case
$f'(k)\vert_{k=p,\cos\theta=-1}=0$,
so how should one go on from here regarding the Dirac-$\delta$?
Thanks.