Delta function and $\sum_{t}\exp\{ i k t\} $ I am interested in evaluating the following, which appears in an integrand,
$$
\sum_{t=0}^{\infty}e^{ikt}
$$
where $k$ is real. Using the following relation
$$
\sum_{t=-\infty}^{\infty}e^{ikt} = 2\pi\delta(k),
$$
the real part of it is
\begin{eqnarray}
\Re\left[\sum_{t=0}^{\infty}e^{ikt}\right]&=&\frac{1}{2}+\frac{1}{2}\Re\left[\sum_{t=-\infty}^{\infty}e^{ik}\right]\\&=&\frac{1}{2}+\pi\delta(k).
\end{eqnarray}
Note the addition of $\frac{1}{2}$ term! This $\frac{1}{2}$ term does not agree with the following derivation using $\epsilon$ trick!
\begin{eqnarray}
\lim_{\epsilon\rightarrow0_{+}}\lim_{T\rightarrow\infty}\sum_{t=0}^{T}e^{ikt}e^{-\epsilon t}&=&\lim_{\epsilon\rightarrow0_{+}}\lim_{T\rightarrow\infty}\frac{e^{\epsilon}-e^{ik\left(T+1\right)}e^{-\epsilon T}}{e^{\epsilon}-e^{ik}}\\
&=&\lim_{\epsilon\rightarrow0_{+}}\frac{1}{e^{\epsilon}-e^{ik}}
\end{eqnarray}
which becomes, when $k \rightarrow 0$,
\begin{eqnarray}
\lim_{k\rightarrow0,}\lim_{\epsilon\rightarrow0_{+}}\frac{1}{e^{\epsilon}-e^{ik}}&=&\lim_{k\rightarrow0,}\lim_{\epsilon\rightarrow0_{+}}\frac{1}{\epsilon-ik}\\
&=&\lim_{k\rightarrow0}\lim_{\epsilon\rightarrow0_{+}}\frac{i}{k+i\epsilon}\\&=&\lim_{k\rightarrow0}\left[\pi\delta\left(k\right)+i\mathcal{P}\frac{1}{k}\right]
\end{eqnarray}
where Sokhotsky's formula is used.
Now when $k\nrightarrow0$,
$$
\lim_{\epsilon\rightarrow0_{+}}\frac{1}{e^{\epsilon}-e^{ik}}=\frac{1}{1-e^{ik}}
$$
Therefore, for all $k$,
$$
\sum_{t=0}^{\infty}e^{ikt}=\pi\delta\left(k\right)+\mathcal{P}\frac{1}{1-e^{ik}}
$$
Note that the real part of it does not have $\frac{1}{2}$ addition term, instead has $\Re\mathcal{P}\frac{1}{1-e^{ik}}$.
What am I doing wrong?

Building on Svyatoslav's answer which in turn supported by vitamin d, the conclusion is the following:
$$
\sum_{t=0}^{\infty}e^{ikt} = \frac{1}{2} + \pi \delta(k) + \frac{i}{2} \mathcal{P} \cot (k/2)
$$
 A: In addition to Svyatoslav's answer
In order to prove that $$\delta_\varepsilon(k) =\frac{1}{\pi}\frac{\varepsilon}{\varepsilon^2+k^2}$$ is a nascent delta function we have to consider it's definition:
A sequence $(\delta_\alpha)_{\alpha\in\mathbb{N}}$ of integrable functions $\delta_\alpha\in L^1(\mathbb{R}^n)$ is called a nacent delta function if

*

*for all $x\in\mathbb{R}$ and $\alpha\in\mathbb{N}$, $(\delta_\alpha)_{\alpha\in\mathbb{N}}\ge0,$

*for all $\alpha\in\mathbb{N}$, $$\int_{\mathbb{R}^n}\delta_{\alpha}(x)\,\mathrm{d}x=1,$$

*for all $\varepsilon$, $$\lim_{\alpha \to \infty} \int_{\mathbb{R}^n \setminus B_\varepsilon (0)} \delta_{\alpha}(x) \mathrm{d}x = 0.$$
It can easily be shown that the first condition is satisfied. I will prove condition 2. and I will leave 3. to to you. A hint: A sphere in $1$ dimension is a line. If you still have questions, ask in the comments.
We want to prove
$$\int\limits_{-\infty}^{\infty}\frac{1}{\pi}\frac{\varepsilon}{\varepsilon^2+k^2}\,\mathrm{d}k=1.$$
Substitute $x=k/\varepsilon$. We get
$$\frac{1}{\pi}\int\limits_{-\infty}^{\infty}\frac{\varepsilon^2}{\varepsilon^2+k^2\varepsilon^2}\,\mathrm{d}k = \frac{1}{\pi}\int\limits_{-\infty}^{\infty}\frac{1}{1+x^2}\,\mathrm{d}x.$$
This is a well known integral, the $\arctan$. Applying the limits
$$\frac{1}{\pi}\left[\arctan x\right]_{-\infty}^\infty = \frac{\pi}{\pi} = 1.$$
If you prove the third condition right, we can conclude that
$$\lim_{\varepsilon\to0}\frac{1}{\pi}\frac{\varepsilon}{\varepsilon^2+k^2} = \delta(k).$$
A: The Dirichlet Kernel is a Fourier Series approximations to the Dirac delta. It relies on cancellation rather than decay away from $0$. The Fejér Kernel makes a better approximation to the Dirac delta since it is positive and decays to $0$ away from $0$.
$$
\sum_{k=-n}^ne^{ikx}=\underbrace{\frac{\sin\left(\frac{2n+1}2x\right)}{\sin\left(\frac12x\right)}}_{2\pi\times\text{Dirichlet Kernel}}
$$
If we multiply this by $e^{inx}$ we get
$$
\begin{align}
\sum_{k=0}^{2n}e^{ikx}
&=\frac{\sin\left(\frac{2n+1}2x\right)}{\sin\left(\frac12x\right)}\,e^{inx}\\[3pt]
&=\frac12\left(\vphantom{\frac{\frac12}{\frac12}}\!\right.\underbrace{\frac{\sin\left(\frac{4n+1}2x\right)}{\sin\left(\frac12x\right)}}_{2\pi\times\text{Dirichlet Kernel}}+1\left.\vphantom{\frac{\frac12}{\frac12}}\!\right)+\frac i2\cot\left(\frac12x\right)\left(\vphantom{\frac{\frac12}{\frac12}}\!\right.1-\underbrace{\frac{\cos\left(\frac{4n+1}2x\right)}{\cos\left(\frac12x\right)}}_{\substack{2\pi\times\text{Dirichlet Kernel}\\\text{rotated by $\pi$,}\\\text{which is killed}\\\text{by $\cot\left(\frac12x\right)$}}}\left.\vphantom{\frac{\frac12}{\frac12}}\!\right)
\end{align}
$$
So the real part tends to $\frac12(2\pi\delta+1)$ the imaginary part tends to $\frac12\cot\left(\frac12x\right)$.


A: If we do formal calculations (without the proof of validity) we get
$S(k)=\sum_{t=0}^{\infty}e^{ikt}=1+\sum_{t=1}^{\infty}e^{ikt}+\sum_{t=-1}^{-\infty}e^{ikt}-\sum_{t=-1}^{-\infty}e^{ikt}=\sum_{t=-\infty}^{+\infty}e^{ikt}+1-\sum_{t=0}^{\infty}e^{-ikt}$
$\Rightarrow$ $S(k)+S^*(k)=1+2\pi\delta(k)$
On the other hand, if we use $\epsilon$-regularization
$$S(k,\epsilon)=\sum_{t=0}^{\infty}e^{ikt-\epsilon{t}}=\frac{e^{\epsilon}}{e^{\epsilon}-e^{ik}}=\frac{e^{\epsilon}(e^{\epsilon}-e^{-ik})}{1+e^{2\epsilon}-e^{\epsilon}(e^{ik}+e^{-ik})}=\frac{e^{\epsilon}-\cos{k}+i\sin{k}}{e^{\epsilon}+e^{-\epsilon}-(e^{ik}+e^{-ik})}$$
$$S(k,\epsilon)=\frac{1}{2}+\frac{\sinh\epsilon+i\sin{k}}{2(\cosh\epsilon-\cos{k})}=\frac{1}{2}+\frac{\sinh\epsilon}{2(\cosh\epsilon-\cos{k})}+\frac{i\sin{k}}{2(\cosh\epsilon-\cos{k})}$$
$S(k,\epsilon)\to\frac{1}{2}+\frac{\epsilon}{\epsilon^2+k^2}=\frac{1}{2}+\pi\delta(k)$,  $k<<\epsilon$, $\epsilon\to0$
$S(k,\epsilon)\to\frac{1}{2}+\frac{i}{2}\frac{\sin{k}}{1-\cos{k}}=\frac{1}{2}+\frac{i}{2}\cot\frac{k}{2}$, $k>>\epsilon$, $\epsilon\to0$
$S(k,\epsilon)+S^*(k,\epsilon)\to1+2\pi\delta(k)$ for all $k$
