Delta function integral I encountered an issue when doing some problems in solid state physics, and I spent a whole day trying to clear this up, unsuccessfully. I'm posting it here because my issue is purely mathematical.
Namely, there appears an integral of the Dirac $\delta$-function of this form:
$$n(E)=\frac{Na}{\pi}\int_\frac{-\pi}{a}^\frac{\pi}{a} \delta(E-E_s+2J\cos ka)dk$$
where $N,a,E,E_s,J,k$ are real.
This is supposed to be:
$$n(E)=\frac{N}{\pi J\sqrt{1-(\frac{E-E_s}{2J})^2}}(\theta(E-E_b)-\theta(E-E_t))$$
where $E_b=E_s-2J, E_t=E_s+2J$, and $\theta$ is the Heaviside step function.
Now, the integral of $\delta$ is either $1$ or $0$, depending whether the argument vanishes inside the integral limits or not. How exactly is this fact transformed into those terms involving $\theta$?
I have tried manipulating using definitions of $\theta$, but to no avail.
I suppose this may be very elementary, but I'd be grateful for any help.
 A: We first derive a simple formula for delta function integral. Let assume $\Omega$ is an open set and $f : \Omega \to \mathbb{R}$ is a $C^1$-function with finite zeros $x_1, \cdots, x_n$. We also assume that $f'(x_i) \neq 0$. Then there are sufficiently small neighborhoods $\mathcal{U}_i$ of $x_i$ such that


*

*$\mathcal{U}_i \cap \mathcal{U}_j = \varnothing$ if $i \neq j$ and

*$f$ has local $C^1$-inverse $g_i$ on each $\mathcal{U}_i$.


Then
$$\begin{align*}
\int_{\Omega} \delta(f(x)) \; dx
& = \sum_{i} \int_{\mathcal{U}_i} \delta(f(x)) \; dx \\
& = \sum_{i} \int_{f(\mathcal{U}_i)} \delta(y) |g_i'(y)| \; dy \\
& = \sum_{i} |g_i'(0)| \\
& = \sum_{i} \frac{1}{|f'(x_i)|}.
\end{align*}$$
Now let's return to the original problem. It is sufficient to assume that $|E - E_s| < 2J$, since we have $n(E) = 0$ for $|E - E_s| > 2J$. Then we may let 
$$ \frac{E - E_s}{2J} = -\cos\alpha$$
with $0 < \alpha < \pi$. Then
$$\begin{align*}
n(E)
&= \frac{N}{\pi} \int_{-\pi}^{\pi} \delta(E-E_s + 2J \cos x) \; dx \qquad (x = ka) \\
&= \frac{N}{\pi} \left[ \left.\frac{1}{2J|\sin x|}\right|_{x = -\alpha} + \left.\frac{1}{2J|\sin x|}\right|_{x = \alpha} \right] \\
&= \frac{N}{\pi J \sin \alpha} \\
&= \frac{N}{\pi J\sqrt{1-(\frac{E-E_s}{2J})^2}},
\end{align*}$$
as desired.
