# Integral involving the derivative of the Dirac's Delta “function”

I'm dealing with the integral $$\int\limits_{-1}^{+1}\delta'(\cos(\pi x))(x^2+1)\ \mathrm{d}x \label{1}\tag{1}$$ This makes me in me lot of confusion about the derivative of the Dirac's Delta, as I only know how to deal with the derivative of the Dirac Delta Distribution, that is the usual derivative of a distribution $$\delta_0^{(n)}(f) = (-1)^n\delta_0(f')$$ Also, I've found some exercises where it is said that it is true the derivation rule for function composition as $$\frac{\mathrm{d}}{\mathrm{d}x}\delta(f(x)) = \delta'(f(x))f'(x) \label{2}\tag{2}$$ so that i can make a swap in \eqref{1} between the derivative of the distribution and the delta of the argument function of the Delta: \begin{gather} \delta'_{\frac{2k+1}{2}}(x^2+1) \equiv \langle\delta'_{\frac{2k+1}{2}}, x^2+1 \rangle = \int\limits_{-1}^{+1}\delta'(\cos(\pi x))(-\pi\sin(\pi x))\frac{(x^2+1)}{(-\pi\sin(\pi x))}\ \mathrm{d}x = \\ \int\limits_{-1}^{+1}\frac{\mathrm{d}\delta(\cos(\pi x))}{\mathrm{d}x}\frac{(x^2+1)}{(-\pi\sin(\pi x))}\ \mathrm{d}x = -\langle\delta_{\frac{2k+1}{2}}, \left(\frac{x^2+1}{-\pi\sin(\pi x)}\right)' \rangle =\\ \frac{1}{\pi}\int\limits_{-1}^{+1}\delta(\cos(\pi x))\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{x^2+1}{\sin(\pi x)}\right)\ \mathrm{d}x \end{gather} from the last relation we can simplify the delta by finding the zeros of the function inside the delta \begin{align} \delta(\cos(\pi x)) = \frac{1}{\pi}\sum_{k\in\mathbb{Z}}\delta_{\frac{2k+1}{2}} \end{align} Inside the interval of integration there are just two zeros, for k = 0, -1, so \begin{gather} \frac{1}{\pi}\int\limits_{-1}^{+1}\frac{1}{\pi}\left(\delta\left(x - \frac{1}{2}\right) + \delta\left(x + \frac{1}{2}\right)\right)\frac{2x\sin(\pi x) - (x^2+1)\pi\cos(\pi x)}{\sin^2(\pi x)}\ \mathrm{d}x\\ = \frac{2}{\pi^2} \end{gather} result which is not right, as I checked on Mathematica and with the result of the exercise. Summing up all my doubts:

1. How do I solve cases like this with the derivative of the delta function?
2. Can I apply \eqref{2} all the times I deal with the function? Under which circumstance can I use it?
3. Does anybody know some good literature very rigorous and helpful to solve this kind of doubt, maybe with solved exercises? Thanks.

You look for all points in the domain of integration where $\cos(\pi x)=0$. You evaluate the negative of the derivative of the test function at those points, which in this case are $1/2$ and $-1/2$. Then you divide by the absolute value of the derivative of $\cos(\pi x)$ at those points and sum. So overall you have
$$\frac{1}{\pi} \left ( -\left. \frac{d}{dx} \frac{1}{x^2+1} \right |_{x=1/2} - \left. \frac{d}{dx} \frac{1}{x^2+1} \right |_{x=-1/2} \right ).$$
The main idea of this construction is to locally change variables around the zeros of $\cos(\pi x)$. That is you split your domain of integration into $[0,1]$ and $[-1,0]$ and take $u=\cos(\pi x)$ on each of those. Then you use the definition of the Dirac delta and the distributional derivative, which tell you that $\langle \delta',f \rangle = -f'(0)$.