I have been following the course in Introduction to Probability, Statistics and Random Processes, by Hossien Pishro-Nik, and I was having some troubles understanding proof in chapter 4.3.2 Using the Delta Function. The lemma states that $$\int_{-\infty}^{\infty} g(x) \delta(x-x_0) dx = g(x_0).$$
The proof states that, let $I$ bet the value of the above integral. Then, we have $$I= \lim_{\alpha \rightarrow 0} \bigg[ \int_{-\infty}^{\infty} g(x) \delta_{\alpha} (x-x_0) dx \bigg]$$ $$=\lim_{\alpha \rightarrow 0} \bigg[ \int_{x_0-\frac{\alpha}{2}}^{x_0+\frac{\alpha}{2}} \frac{g(x)}{\alpha} dx \bigg].$$ By the mean value theorem in calculus, for any $α>0$, we have $$\int_{x_0-\frac{\alpha}{2}}^{x_0+\frac{\alpha}{2}} \frac{g(x)}{\alpha} dx=\alpha \frac{g(x_{\alpha})}{\alpha}=g(x_{\alpha}),$$ for some $x_{\alpha} \in (x_0-\frac{\alpha}{2},x_0+\frac{\alpha}{2}).$ Thus, we have $$I = \lim_{\alpha \rightarrow 0} g(x_{\alpha})=g(x_0).$$
Now, the lemma makes sense intuitively but I am unable to understand why $$\int_{x_0-\frac{\alpha}{2}}^{x_0+\frac{\alpha}{2}} \frac{g(x)}{\alpha} dx=\alpha \frac{g(x_{\alpha})}{\alpha}=g(x_{\alpha}).$$ From my understanding of the mean value theorem, shouldn’t $$\int_{x_0-\frac{\alpha}{2}}^{x_0+\frac{\alpha}{2}} \frac{g(x)}{\alpha} dx=\frac{1}{\alpha}\frac{G(x_{0}+\frac{\alpha}{2})-G(x_{0}-\frac{\alpha}{2})}{(x_{0}+\frac{\alpha}{2})-(x_{0}-\frac{\alpha}{2})}$$ $$=\frac{1}{\alpha}\frac{G(x_{0}+\frac{\alpha}{2})-G(x_{0}-\frac{\alpha}{2})}{\alpha}=\frac{G(x_{\alpha})}{\alpha^2},$$ where $G(x_{\alpha})$ is $G(x)$ defined in some range $x_{\alpha} \in (x_0-\frac{\alpha}{2},x_0+\frac{\alpha}{2}).$
As you can see I am unable to understand how the author managed to achieve the result he stated. Can you please help me understand how the author achieved the result?
Full credit goes to PNDas for his comment.
The mean value theorem states that if a function $f(x)$ satisfies the following conditions
then there is a number c such that $a<c<b$ and $$f'(c) = \frac{f(b) - f(a)}{b - a}$$ $${\implies}{f(b)-f(a)} = {f'(c)}{(b-a)},$$ where $f'$ is the differential of $f$.
Since $$\int_{a}^{b}{f'(x)dx} = {f(b)-f(a)},$$ then application of the mean value theorem would imply that $$\frac{1}{b-a}\int_{a}^{b}{f'(x)dx} = {f'(c)}$$ $${\implies}\int_{a}^{b}{f'(x)dx} = {f'(c)}{(b-a)},$$ where $a<c<b$.
Applying this to the problem in the question would produce $$\int_{x_0-\frac{\alpha}{2}}^{x_0+\frac{\alpha}{2}}{\frac{g(x)}{\alpha}dx} = {\frac{g(x_{\alpha})}{\alpha}}{[(x_0+\frac{\alpha}{2})-(x_0-\frac{\alpha}{2})]}$$ $$= {\alpha}{\frac{g(x_{\alpha})}{\alpha}} = g(x_{\alpha}),$$ where $x_{\alpha}{\space}{\in}{\space}({x_0-\frac{\alpha}{2}}, {x_0+\frac{\alpha}{2}}).$
The definition of the mean value theorem was taken from Paul's Online Notes.