I am trying to derive Gamma from the expectation principle (differentiating under expectation sign). I understand these steps
$\frac{d^2 C}{d x^2} = e^{-r\tau} \mathbb{E} [ \frac{\partial}{\partial x}Y 1_{[xY>K]}] = e^{-r\tau} \mathbb{E} [ Y \delta(x-K/Y)] = e^{-r\tau} \mathbb{E} [ K/U \delta(x-U)]$= $Ke^{-r\tau} \mathbb{E} [\frac{\delta(x-U)}{U}]$, where $U=K/Y$
but the last transformations to $Ke^{-r\tau} \int^{\infty}_0 \frac{\delta(x-u)}{u}\frac{\text{exp}(-\frac{1}{2} d_2(u)^2)}{u\sqrt{2\pi}\sigma \sqrt{\tau}}du=\frac{Ke^{-r\tau}}{x^2}\Phi'(d_2(x))=\frac{\Phi(d_1)}{x\sigma \sqrt{\tau}}$ are very confusing for me.
The problem is illustrated in http://www.gold-saucer.org/math/diff-int/diff-int.pdf at page 11.