Q:

Boltzmann equation for Photons

I am computing the Boltzmann equation for Photons from the book "Modern Cosmology" by Scott Dodelson.
This is the colission term from Compton scattering

Then, the Dirac delta is expanded

I am trying to understand  how to expand the Dirac delta function and also how to derivative it. I don't know if it's possible.
The book is very clear but my problem is whith the calculus of Delta Dirac.
Pictures are in page 96(https://altexploit.files.wordpress.com/2017/05/scott-dodelson-auth-modern-cosmology-academic-press-2003.pdf)

A:

Expanding the Dirac Delta
I'm no expert, but this seems to be very sloppy mathematics, even for a Physics textbook.
Essentially what the author is trying to do there is perform a Taylor Series expansion on the Dirac Delta function. The problem with this is that the Dirac Delta function is not a "function" in the mathematical sense but a generalised function or a distribution. As such, it is not obvious to me that it has a Taylor Expansion.
Nevertheless, it is possible to write the $\delta(x)$ function as the limit of series of continuous functions (my favourite is:
$$\delta(x) = \lim_{a\to0}\delta_a(x) , \quad \quad \text{ where }\quad \delta_a(x) = \frac{1}{\sqrt{2\pi a^2}}e^{-x^2/2a^2},$$
a limit of squished Gaussians), and I assume that you can expand $\delta_a(x)$ however you wish since it's smooth and well behaved for all $a\neq 0$. Perhaps this is the author's justification? I don't know. But the rest is straightforward.
The Derivative of the Dirac Delta Function
The point to remember is that all of the operations with a Dirac Delta that make sense occur within an integral. The $\delta-$function itself is usually defined using a test function $f(x)$, in that
$$\int_{-\infty}^\infty\delta(x-x_0) f(x) = f(x_0)$$
What about the "function" $\delta'(x-x_0)$? Well, we can try to find a similar definition by acting it on a test function $f(x)$ and integrating over all $x$:
$$\int_{-\infty}^\infty\delta'(x-x_0) f(x) = \delta(x-x_0)f(x)\Bigg|_{-\infty}^\infty -\int_{-\infty}^\infty\delta(x-x_0) f'(x)$$
In the second step I have just integrated by parts. Clearly, since the $\delta-$function is zero at $\pm \infty$, this just means that
$$\int_{-\infty}^\infty\delta'(x-x_0) f(x) = -\int_{-\infty}^\infty\delta(x-x_0) f'(x) = - f'(x_0),$$
using the definition of $\delta(x-x_0)$ from above. In other words, while the $\delta-$function "picks out" a particular value of a test function $f(x)$, the derivative of the delta function "picks out" a particular value of the (negative of the) derivative of $f(x)$.
As far as I can see, these are the only "delta-function" identities that are used in the derivation.

