How do you do an integral involving the derivative of a delta function?

The $\delta$ function is not continuous, so it's a priori not differentiable. In fact, it's not even well-defined as an ordinary real-valued function, but can be made so in terms of distributions - linear maps on a space of test functions given by $f\mapsto\int\delta f=f(a)$.

It's possible to sensibly define derivatives of distributions by looking at representations as limits of functions:

If $\delta_i$ is a family of functions so that $\lim_{i\rightarrow\infty}\int\delta_i(x) f(x)\mathrm dx=f(a)$ for any test function $f$, then it can be considered a representation of the Dirac delta. Now, if we take the family of derivatives $\frac{\mathrm d}{\mathrm dx}\delta_i$ we arrive at $$ \int\left[\frac{\mathrm d}{\mathrm dx}\delta_i(x)\right]f(x)\mathrm dx=-\int\delta_i(x)\left[\frac{\mathrm d}{\mathrm dx}f(x)\right]\mathrm dx $$ through integration by parts and using the fact that $f$ has by definition compact support (which makes the boundary term vanish).

As the derivative is linear as well, this defines another linear map $f\mapsto-\int\delta f'$ on the space of test functions, which we call the derivative of our distribution.

Symbolically, $$ \left[\frac{\mathrm d}{\mathrm dx}\delta(x-a)\right]f(x)=-\delta(x-a)f'(x) $$ which you can just plug in into your formula above without any need for actual computation as it holds true by definition.


The Dirac delta function is often defined as the following distribution:

$$\int_a^b \delta(x - x_0) F(x)\mathrm{d}x = \begin{cases}F(x_0), & a < x_0 < b \\ 0, & \text{otherwise}\end{cases}$$

where $F$ is a suitable test function. Its derivative is then defined as

$$\int_a^b \delta'(x - x_0) F(x)\mathrm{d}x = -\int_a^b \delta(x - x_0) F'(x)\mathrm{d}x$$

which is also the result one would get from naively applying integration by parts. You can use this result directly to calculate your integral by setting $F(x) = \frac{y(x)}{x}$ - no need to split the integral or take any limits.


So, the properties of the derivative of the delta function can be shown relatively quickly though the following ansatz: Consider a function $\delta(x)$ such that $\delta(x) = \frac{1}{a^{2}}(x+a)$ if $-a<x<0$ and $\delta(x) = \frac{1}{a^{2}}(a-x)$ if $0<x<a$, and $\delta(x) = 0$ elsewhere. It is easy to see that $\delta(x)$ has area 1 irrespective of the value of $a$, so we can consider $\delta(x)$ to be the dirac delta function in the limit $a\rightarrow0$.

Now, consider the derivative of our putative delta function. It will be $\frac{1}{a^{2}}$ for $-a<x<0$ and $-\frac{1}{a^{2}}$ for $0<x<a$. Let's integrate a function $f(x)$ against $\delta^{\prime}(x)$:

$\begin{align} \int \delta^{\prime}(x)f(x)dx &= \int_{-a}^{0}\frac{f(x)}{a^{2}}dx - \int_{0}^{a}\frac{f(x)}{a^{2}}dx\\ &=\int_{0}^{a}\frac{f(-x)}{a^{2}}dx-\int_{0}^{a}\frac{f(x)}{a^{2}}dx\\ \end{align}$

Extracting the $a^{2}$ out of the integral, and taking the limit $a\rightarrow0$, we find, after applying L'Hopital's rule once, and then using the definition of the derivative:

$\int \delta^{\prime}(x)f(x) = -f'(0)$