# Dirac Delta of a Function When the Derivative of the Function is Discontinuous at its Roots

We know that the Dirac delta function of a function can be written as $$\delta(f(x))=\sum_i\frac{\delta(x-x_i)}{|f'(x_i)|},$$ where $x_i$ are roots of function $f(x_i)$.

Now my question is the following: how can we write a same expression for $\delta(f(x))$ if we have $f'(x_i^+)\neq f'(x_i^-)$?

Split the integral into regions around $a_i$, the zeros of $f$ (as integration of a delta function only gives nonzero results in regions where its argument is zero) $$\int_{-\infty}^{\infty}\delta\big(f(x)\big)g(x)\,\mathrm{d}x = \sum_{i}\int_{a_i-\epsilon}^{a_i}\delta(f(x))g(x)\,\mathrm{d}x+\int_{a_i}^{a_i+\epsilon}\delta(f(x))g(x)\,\mathrm{d}x\ .$$ Write out the Taylor expansion of $f$ for $x$ near some $a_i$ (ie. different for each term in the summation) to the right $$f(x) =f(a_i) + f_+'(a_i)(x-a_i) + \mathcal{O}((x-a_i)^2) =f_+'(a_i)(x-a_i) + \mathcal{O}((x-a_i)^2)$$ and to the left $$f(x) =f(a_i) + f_-'(a_i)(a_i-x) + \mathcal{O}((a_i-x)^2)=f_-'(a_i)(a_i-x) + \mathcal{O}((a_i-x)^2)\ .$$ Therefore $$\int_{-\infty}^{\infty}\delta\big(f(x)\big)g(x)\,\mathrm{d}x \simeq \sum_{i}\int_{a_i-\epsilon}^{a_i}\delta( f_-'(a_i)(a_i-x))g(x)\,\mathrm{d}x+\int_{a_i}^{a_i+\epsilon}\delta(f_+'(a_i)(x-a_i))g(x)\,\mathrm{d}x\ .$$ Changing variables $a_i-x=y$ and $x-a_i=z$ in the two integrals, we get $$\int_{-\infty}^{\infty}\delta\big(f(x)\big)g(x)\,\mathrm{d}x \simeq \sum_{i}\int_{0}^{\epsilon}\delta( f_-'(a_i)y)g(a_i-y)\,\mathrm{d}y+\int_{0}^{\epsilon}\delta(f_+'(a_i)z)g(a_i+z)\,\mathrm{d}z\ .$$
Now, for each term, it is tempting to use the following property $$\int_{-\infty}^\infty\delta(kx)g(x)\,\mathrm{d}x = \frac{1}{|k|}g(0) = \int_{-\infty}^\infty\frac{1}{|k|}\delta(x)g(x)\,\mathrm{d}x\ ,$$ however it should be noted that the integration range is truncated, and the argument of the deltas vanishes at one of the integration bounds. The best way to handle this situation seems to include a factor of $1/2$ in front (see this thread). Therefore in the end $$\boxed{\delta(f(x))=\frac{1}{2}\sum_{i}\left(\frac{1}{|f'(a^+_i)|}+\frac{1}{|f'(a^-_i)|} \right)\delta(x-a_i)}\ ,$$ i.e. the factor in front of the simple delta is now the arithmetic average of the inverse of left and right derivatives. Note that, if such derivatives are equal, we recover the 'standard' formula.
$$\delta(f(x))~=~\frac{1}{2}\sum_{i}^{f(x_i)=0}\left(\frac{1}{|f'(x^+_i)|}+\frac{1}{|f'(x^-_i)|} \right)\delta(x-x_i).$$