I am trying to evaluate the sum $$\sum_{k=1}^{n}\frac{\cos\left(k\theta\right)}{k}$$ using $\sum_{k=1}^{n}e^{ki\theta}/k$ as a first step. I recognize this as being similar to $\log\left(1-e^{i\theta}\right)$ plus some terms for sufficiently large $n;$ however, I am tempted to write $$i\sum_{k=1}^{n}\frac{e^{ki\theta}}{ik}=i\sum_{k=1}^{n}\left(-\int^{+\infty}_{\theta}e^{ki\alpha}\,\mathrm{d}\alpha\right)$$ and then replace the sum and the integral with justification, but I'm not sure the improper integral converges. A careful analysis on the improper integral yields $$-\int^{+\infty}_{\theta}e^{ki\alpha}\,\mathrm{d}\alpha=-\lim_{b\rightarrow+\infty}\int^{b}_{\theta}e^{ki\alpha}\,\mathrm{d}\alpha=\frac{1}{ik}\left[\lim_{b\rightarrow+\infty}\left(e^{ki\theta}-e^{kib}\right)\right]=\frac{1}{ik}\left[e^{ki\theta}-\lim_{b\rightarrow+\infty}\left(e^{kib}\right)\right]$$ and I'm stuck here. I'm not sure how to evaluate $$\lim_{b\rightarrow+\infty}\left(e^{kib}\right)$$ for a couple of reasons. First, I know that if $k\in\mathbb{N}$ and $b\in\mathbb{R},$ then $\left|e^{kib}\right|\leq1.$ It seems that whenever $b$ is close enough to $2t\pi$ ($t$ integer), $\left|e^{kib}\right|$ approches $1.$ In my mind, a graph of $f(x)=\left|e^{kib}\right|$ would sporadically get close to one. For my assumption to behold, I need $\displaystyle\lim_{b\rightarrow+\infty}\left(e^{kib}\right)=0.$ My guts say maybe it is right, but I don't know how to properly justify it. It seems like the limit can be $1,$ another complex number or simply doesn't exist.
So, how can I formally show what $\displaystyle\lim_{b\rightarrow+\infty}\left(e^{kib}\right)$ is? If $\displaystyle\lim_{b\rightarrow+\infty}\left(e^{kib}\right)\neq0,$ is there another integral that nicely fits this situation?
