Computing a limit of a very complicated complex exponential expression; Fourier Transform of $\tan(x)$ 1. BACKGROUND
I stumbled upon this problem while doing something very unusual -- computing the Fourier Transform of the tangent function.
I got that:
$$\mathcal{F}\{\tan(x)\}=-i\cdot\Bigg(\int_{-\infty}^{\infty}e^{-2\pi ixf}\,dx\;-\;\int_{-\infty}^{\infty}{2e^{-2\pi ixf}\over e^{2ix}+1}\,dx\Bigg)$$
The first integral computes to $\delta(f)$, the dirac delta function. The other integral is very messy. I won't show my computations here because they are way too long to write out (I hope they are correct), but I got an infinite series, which is:
$$\int_{-\infty}^{\infty}{2e^{-2\pi ixf}\over e^{2ix}+1}\,dx\;=\;{1\over i}\sum_{k=0}^{\infty}\Bigg((-1)^{k+1}\,\cdot\frac{\Gamma(\pi f-k)}{\Gamma(\pi f+1)}\,\cdot\Bigg[\frac{e^{2ix(k-\pi f)}}{(e^{2ix}+1)^{k+1}}\Bigg]_{x=-\infty}^{x=\infty}\Bigg)$$
2. THE PROBLEM
The infinite series contains a problematic expression, that I have no idea how to compute. More precisely, it is:
$$\Bigg[\frac{e^{2ix(k-\pi f)}}{(e^{2ix}+1)^{k+1}}\Bigg]_{x=-\infty}^{x=\infty}$$
Which means the same thing as:
$$\lim_{x\to\infty}\Bigg[\frac{e^{2ix(k-\pi f)}}{(e^{2ix}+1)^{k+1}}\Bigg]\;-\;\lim_{x\to-\infty}\Bigg[\frac{e^{2ix(k-\pi f)}}{(e^{2ix}+1)^{k+1}}\Bigg]$$
At this point, I tried everything from L'Hopital's rule to decomposition of complex exponentials into trigonometric functions (and using trigonometric properties). I have considered changing the exponentials into geometric series, but haven't been able to do so...I don't even know how to do this at that point, and I'm not sure that would help anyhow.
I expect a discrete answer: something in terms of (or similar to) the dirac delta function, which would make the most sense with such a weird expression like this. But to be honest, I have no idea whether this expression even exists or converges...
Thank you for any help.
 A: First we define $\tan$ to be the distribution understood in the sense of the principal value. Then we can compute its Fourier coefficients and use the general formula for the Fourier transform of a periodic function:
$$\frac 1 \pi \int_0^\pi e^{-2 i k t}\tan t \, dt =
(-1)^k i \operatorname{sgn} k, \\
(\tan t, e^{-2 \pi i f t}) =
i \sum_{k \in \mathbb Z} (-1)^k \hspace {1px}
 \delta {\left( f - \frac k \pi \right)} \operatorname{sgn} k.$$
A: From a table in Bracewell:
$$\mathscr{F}\left\{\mathrm{III}(x)H(x)\right\} = \dfrac{1}{2}-i\dfrac{1}{2}\cot(\pi s)$$
where $H(x)$ is the Heaviside unit step function, and $\mathrm{III}(x)$ is an infinite $\delta(x)$ impulse train.
So one can use Fourier Transform properties, $\delta(x)$ function properties, and trigonometric identities, to find the Fourier Transform of $\tan(x)$.
$$\begin{align*}\ \mathscr{F}\left\{\dfrac{1}{2}-i\dfrac{1}{2}\cot(\pi x)\right\} &= \mathrm{III}(s)H(-s)\\
\\
\mathscr{F}\left\{1\right\}-i\mathscr{F}\left\{\cot(\pi x)\right\} &= 2\mathrm{III}(s)H(-s)\\
\\
-i\mathscr{F}\left\{\cot(\pi x)\right\} &= 2\mathrm{III}(s)H(-s) - \delta(s)\\
\\
\mathscr{F}\left\{\cot(\pi x)\right\} &= 2i\mathrm{III}(s)H(-s) - i\delta(s)\\
\\
\mathscr{F}\left\{\cot(x)\right\} &= 2\pi i\mathrm{III}(\pi s)H(-\pi s) - i\pi\delta(\pi s)\\
\\
\mathscr{F}\left\{\cot(x)\right\} &= 2\pi i\mathrm{III}(\pi s)H(-s) - i\delta(s)\\
\\
\mathscr{F}\left\{\tan\left(\dfrac{\pi}{2}-x\right)\right\} &= 2\pi i\mathrm{III}(\pi s)H(-s) - i\delta(s)\\
\\
\mathscr{F}\left\{-\tan\left(x-\dfrac{\pi}{2}\right)\right\} &= 2\pi i\mathrm{III}(\pi s)H(-s) - i\delta(s)\\
\\
\mathscr{F}\left\{\tan\left(x-\dfrac{\pi}{2}\right)\right\} &= i\delta(s)-2\pi i\mathrm{III}(\pi s)H(-s) \\
\\
\mathscr{F}\left\{\tan\left(x-\dfrac{\pi}{2}+\dfrac{\pi}{2}\right)\right\} &= e^{-i2\pi\frac{-\pi}{2} s}\left[i\delta(s)-2\pi i\mathrm{III}(\pi s)H(-s)\right] \\
\\
\mathscr{F}\left\{\tan\left(x\right)\right\} &= ie^{i\pi^2 s}\left[\delta(s)-2\pi \mathrm{III}(\pi s)H(-s)\right] \\
\\
\mathscr{F}\left\{\tan\left(x\right)\right\} &= 2\pi ie^{i\pi(\pi s)}\left[\dfrac{1}{2}\delta(\pi s)-\mathrm{III}(\pi s)H(-\pi s)\right] \\
\\
\mathscr{F}\left\{\tan\left(x\right)\right\} &= 2\pi i(-1)^{\pi s}\left[\dfrac{1}{2}\delta(\pi s)-\mathrm{III}(\pi s)H(-\pi s)\right] \\
\\
\end{align*}$$
Update to compute the Fourier Transform of $\tan(x)$ more directly
By performing the long division of the exponential form of $\tan(\pi x)$, the Fourier Transform can be computed without relying on an uncommon table entry:
$$\begin{align*} \mathscr{F}\left\{\tan(\pi x)\right\} &= \mathscr{F}\left\{\dfrac{\sin(\pi x)}{\cos(\pi x)}\right\} = -i\mathscr{F}\left\{\dfrac{e^{i\pi x}-e^{-i\pi x}}{e^{i\pi x}+e^{-i\pi x}}\right\}\\
\\
&= -i\mathscr{F}\left\{1 - 2e^{-2\pi i x}+2e^{-4\pi i x}-2e^{-6\pi ix} + \dots \right\}\\
\\
&= -i\mathscr{F}\left\{-1 + 2 \sum_{k=0}^{\infty} (-1)^k e^{-2\pi i k x}\right\}\\
\\
&= i\mathscr{F}\left\{1 - 2 \sum_{k=0}^{\infty} (-1)^k e^{-2\pi i k x}\right\}\\
\\
&= i\left[\delta(s) - 2 \sum_{k=0}^{\infty} (-1)^k \delta(s+k)\right]\\
\\
&= 2i\left[\dfrac{1}{2}\delta(s) - (-1)^s \sum_{k=0}^{\infty} \delta(s+k)\right]\\
\\
\mathscr{F}\left\{\tan(\pi x)\right\} &= 2i(-1)^s \left[\dfrac{1}{2}\delta(s) - \mathrm{III}(s)H(-s)\right]\\
\\
\mathscr{F}\left\{\tan(x)\right\} &= 2\pi i(-1)^{\pi s} \left[\dfrac{1}{2}\delta(\pi s) - \mathrm{III}(\pi s)H(-\pi s)\right]\\
\\
\end{align*}$$
