Dirichlet integral $\frac{\sin\ x}{x}$ with lebesgue integration In my exam i have got a problem with Lebesgue integration of $$\int_0^\pi \sum_{k=0}^\infty \frac{(-1)^k}{x+k\pi}\sin\ (x)\ dx$$ 
The hint i got is saying me that i should calculate this as a limit: 
$$\lim_{a \to 0}\int_0^\pi \sum_{k=0}^\infty \frac{(-1)^k}{x+k\pi} e^{-a(x+k\pi)}\sin\ (x)\ dx$$ 
I don't really know which sum and integral would be good to interchange and where to start. I would appreciate any of your help, thanks.
 A: Since $(-1)^k\sin x = \sin(x+k\pi)$, $$\int_{0}^\pi \dfrac{(-1)^ke^{-a(x+k\pi)\sin x}}{x+k\pi} dx = \int_{k\pi}^{(k+1)\pi}\dfrac{e^{-at}\sin t}{t}dt$$. 
Now the reason why the variable $a$ is introduced is because you now can interchange the integral and summation. You can justify the interchanging this using dominated convergence theorem, for instance. 
In the end, you will have to calculate $$F(a) = \int_{0}^\infty \dfrac{e^{-at}\sin t}{t} dt\, (1) $$. 
There are a number of way to do this. The simplest I can think of is to recognize that $F'(a) = L(-\sin t) = -\dfrac{1}{a^2+1}$, the Laplace transform of $g(t) = -\sin t.$ Hence, $F(a) = \arctan(\dfrac{1}{a}). $
A: Let us consider $$I=\int_{0}^{\pi}\sum_{k\geq0}\frac{\left(-1\right)^{k}}{x+k\pi}e^{-a\left(x+k\pi\right)}\sin\left(x\right)dx,\, a>0.
 $$ Since the series converges absolutely, we have $$I=\sum_{k\geq0}\int_{0}^{\pi}\frac{\left(-1\right)^{k}e^{-a\left(x+k\pi\right)}\sin\left(x\right)}{x+k\pi}dx\sup\stackrel{u=x+k\pi}{=}\sum_{k\geq0}\int_{k\pi}^{\left(k+1\right)\pi}\frac{\left(-1\right)^{k}e^{-au}\sin\left(u-k\pi\right)}{u}dx
 $$ and now since $\sin\left(u-k\pi\right)=\left(-1\right)^{k}\sin\left(u\right)
 $ we have$$ I=\int_{0}^{\infty}\frac{e^{-au}\sin\left(u\right)}{u}du.
 $$ Now let us consider the integral $$\int_{0}^{\infty}e^{-au}\sin\left(u\right)du=\textrm{Im}\left(\int_{0}^{\infty}e^{u(i-a)}du\right)=\textrm{Im}\left(\frac{1}{i-a}\right)=\frac{1}{a^{2}+1}
 $$ hence $$\int_{0}^{\infty}\frac{e^{-au}\sin\left(u\right)}{u}du=\int_{a}^{\infty}\int_{0}^{\infty}e^{-au}\sin\left(u\right)duda=\frac{\pi}{2}-\arctan\left(a\right)
 $$ so $$\int_{0}^{\pi}\sum_{k\geq0}\frac{\left(-1\right)^{k}}{x+k\pi}\sin\left(x\right)dx=\lim_{a\rightarrow0^{+}}\int_{0}^{\pi}\sum_{k\geq0}\frac{\left(-1\right)^{k}}{x+k\pi}e^{-a\left(x+k\pi\right)}\sin\left(x\right)dx=\color{red}{\frac{\pi}{2}}.
 $$
