Proving that $\sum_{k=0}^\infty \frac{e^{ikb}-e^{ika}}{k}=i\int_a^b\frac{e^{it}}{1-e^{it}}dt$ I deleted my previous question because it was basically totally wrong.

Let $a,b\in ]0,2\pi[$
Prove that $\displaystyle \sum_{k=0}^\infty \frac{e^{ikb}-e^{ika}}{k}=i\int_a^b\frac{e^{it}}{1-e^{it}}dt$

Here is my informal solution.
$\displaystyle \int_a^b\frac{e^{it}}{1-e^{it}}dt=-\int_a^b\frac{1}{1-e^{-it}}dt \stackrel{??}{=} -\int_a^b\sum_{k=0}^\infty e^{-ikt}dt\stackrel{??}{=} -\sum_{k=0}^\infty \int_a^b e^{-ikt}dt = -i\sum_{k=0}^\infty \frac{e^{ikb}-e^{ika}}{k}$
I put some $?$ signs on dubious equalities.

*

*I doubt that $\displaystyle \frac{1}{1-e^{-it}} = \sum_{k=0}^\infty e^{-ikt}dt$
Indeed, for fixed $N$, $\displaystyle \left| \sum_{k=0}^Ne^{-ikt}dt - \frac{1}{1-e^{-it}} \right|=\frac{1}{|1-e^{-it}|}$

*

*Even if that were true, how do you justify swaping sum and integral here ?

 A: You could also just evaluate both sides using the Maclaurin expansion for $\log(1-x)$ in combination with Abel's theorem.
http://mathworld.wolfram.com/AbelsConvergenceTheorem.html
Then
$$ \begin{align} \sum_{k=1}^{\infty} \frac{e^{ikb}-e^{ika}}{k} &= \sum_{k=1}^{\infty} \frac{e^{ikb}}{k} - \sum_{k=1}^{\infty} \frac{e^{ika}}{k} \\ &= -\log(1-e^{ib}) +\log(1-e^{ia}) \end{align}$$
While
$$ \begin{align} i  \int_{a}^{b} \frac{e^{it}}{1-e^{it}} \ dt &= \int^{e^{ib}}_{e^{ia}} \frac{du}{1-u} \ du \\ &= -\log(1-e^{ib}) + \log(1-e^{ia}) \end{align}$$
A: First, you obviously mean the sum from $k=1$ to $\infty$ (the term with $k=0$ is undefined). That said, we have
$$
 \sum_{k=1}^N\frac{e^{ikb}-e^{ika}}{k}=i\int_a^b\sum_{k=1}^Ne^{ikt}dt
=i\int_a^b e^{it}\frac{1-e^{iNt}}{1-e^{it}}dt.
$$
(For finite sum, no doubt we can swap the sum and the integral and then use the formula for the sum of a finite geometric progression.) Now let $N\to\infty$. We have
$$
\int_a^b e^{it}\frac{e^{iNt}}{1-e^{it}}dt=\frac{1}{iN}\int_a^b\frac{e^{it}}{1-e^{it}}\frac d{dt}(e^{iNt})dt=\frac{1}{iN}\left[\frac{e^{iNt}}{1-e^{it}}\bigg|_a^b-
\int_a^b\frac d{dt}\left(\frac{e^{it}}{1-e^{it}}\right)e^{iNt}dt\right]\xrightarrow{N\to\infty}0,
$$
and hence
$$
\sum_{k=1}^\infty\frac{e^{ikb}-e^{ika}}{k}=\lim_{N\to\infty}\sum_{k=1}^N\frac{e^{ikb}-e^{ika}}{k}=i\int_a^b \frac{e^{it}}{1-e^{it}}dt.
$$
We have simultaneously proved that the series converges (conditionally rather than absolutely) and computed the sum.
