Integral with a Dirac Delta and a Heaviside Theta function in statistical mechanics $$I=\frac{4\pi L }{h^2}\int_{-L}^{L} dy \int_{0}^{+\infty} dp \delta(\epsilon-\frac{p^2}{2m}-ky)$$ I put $\epsilon-ky=\epsilon_1$ so the integral:
$$I=\frac{4\pi L }{h^2}\int_{-L}^{L} dy \int_{0}^{+\infty} dp \delta(\epsilon_1-\frac{p^2}{2m})$$ now from the identity $\delta(f(p))=\frac{\delta(p-p_0)}{f'(p_0)}$, here $p_0=\pm\sqrt{2m\epsilon_1}$ so the integral becomes:
$$I=\frac{4\pi L m}{p_0h^2}\int_{-L}^{L} dy \int_{0}^{+\infty} dp [\delta(p-p_0)+\delta(p+p_0)]\theta(\epsilon_1)$$ with the choice of this theta, the integral becomes:
$$I=\frac{4\pi Lm }{h^2}\int_{-L}^{L} dy \theta(\epsilon_1)=\frac{4\pi Lm }{h^2}\int_{-L}^{L} dy \theta(\epsilon-ky)$$ and the integral solution is:
$$I=\frac{4 \pi Lm}{h^2k}[(\epsilon+kL)\theta(\epsilon+kL)+2kL\theta(\epsilon-kL)]$$ but the solution should be:
$$I=\frac{12 \pi Lm}{h^2k}[(\epsilon+kL)\theta(\epsilon+kL)-(\epsilon-kL)\theta(\epsilon-kL)]$$ could you please tell me where I'm wrong?
The $\theta$ function is the Heaviside function.
Using the notation for positive and negative parts, OP's integral becomes
$$\begin{align}\frac{h^2}{4\pi L }I~=~&amp;\int_{[-L,L]}~\mathrm{d}y \int_{\mathbb{R}_+} \!\mathrm{d}p~ \delta(\epsilon-\frac{p^2}{2m}-ky)\cr
~\stackrel{k,m&gt;0}{=}&amp;\frac{\sqrt{2m}}{k}\int_{\mathbb{R}_+} \!\mathrm{d}p\int_{[-kL,kL]}~\mathrm{d}y ~ \delta(\epsilon-p^2-y)\cr
~=~&amp;\frac{\sqrt{2m}}{k}\int_{\mathbb{R}_+} \!\mathrm{d}p~1_{\{-kL\leq \epsilon-p^2\leq kL\}}(p)\cr
~=~&amp;\frac{\sqrt{2m}}{k}\int_{\mathbb{R}_+} \!\mathrm{d}p~1_{\{\epsilon-kL\leq p^2\leq \epsilon+kL\}}(p)\cr
~=~&amp;\frac{\sqrt{2m}}{k}( \sqrt{(\epsilon+kL)^+}-\sqrt{(\epsilon-kL)^+} ). 
\end{align} $$
Using the notation for positive and negative parts, OP's integral becomes
$$\begin{align}\frac{h^2}{4\pi L }I~=~&amp;\int_{[-L,L]}~\mathrm{d}y \int_{\mathbb{R}_+} \!\mathrm{d}p~ \delta(\epsilon-\frac{p^2}{2m}-ky)\cr
~\stackrel{k,m&gt;0}{=}&amp;\frac{\sqrt{2m}}{k}\int_{\mathbb{R}_+} \!\mathrm{d}p\int_{[-kL,kL]}~\mathrm{d}y ~ \delta(\epsilon-p^2-y)\cr
~=~&amp;\frac{\sqrt{2m}}{k}\int_{\mathbb{R}_+} \!\mathrm{d}p~1_{\{-kL\leq \epsilon-p^2\leq kL\}}(p)\cr
~=~&amp;\frac{\sqrt{2m}}{k}\int_{\mathbb{R}_+} \!\mathrm{d}p~1_{\{\epsilon-kL\leq p^2\leq \epsilon+kL\}}(p)\cr
~=~&amp;\frac{\sqrt{2m}}{k}( \sqrt{(\epsilon+kL)^+}-\sqrt{(\epsilon-kL)^+} ). 
\end{align} $$