# Fourier transform of $1/\sin(\pi x)$ - a quest to find the sign function!

While performing the following (presumably) correct manipulations in Mathematica, I obtain a result that is missing a sign function. Is there a mistake in my code, or is there some bug in Mathematica?

Let's say we want to reproduce the following Fourier transform in Mathematica:

$$\frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty dx \frac{e^{iwx}}{\sin(\pi x)}=\frac{i}{\sqrt{2\pi}}\text{sign}(w)\sum_{n=-\infty}^{\infty}e^{i n(\pi+w)}$$

The FourierTransform routine is hopeless here, since it never finishes evaluating. That's not surprising, since the result is an infinite sum without a closed form representation. So we have to try something else.

One way to proceed seems to be to take an anti-derivative

f = Exp[I x w]/(Sqrt[2 \[Pi]] Sin[\[Pi] x]);
F = Assuming[Element[w, Reals], Integrate[f, x]]


We can readily verify the anti-derivative to be correct:

D[F, x] // FullSimplify


(E^(I w x) Csc[\[Pi] x])/Sqrt[2 \[Pi]]

We know that anti-derivatives are only useful in analytic regions of functions. In the case of $e^{i wx}/\sin(\pi x)$ the function is analytic for $x\in\mathbb{R\backslash\mathbb{Z}}$, so that we will have to compute

\begin{align}\tilde{f}(w)&=\lim_{\epsilon\to0^+}\sum_{n\in\mathbb{Z}}(F(n+1-\epsilon)-F(n+\epsilon))\\ &=\lim_{\epsilon\to0^+}\sum_{n\in\mathbb{Z}}(F(n-\epsilon)-F(n+\epsilon))\end{align} (where we shifted the infinite sum by one step in the first term for convenience).

For just a single summand we therefore calculate:

Assuming[Element[w, Reals] && Element[n, Integers] && 1/10 > \[Epsilon] > 0,
Series[(F/.x->n-\[Epsilon]) - (F/.x->n+\[Epsilon]), {\[Epsilon], 0, 0}]//FullSimplify
]


This summand is almost the correct one! Just an overall factor $\text{sign}(w)$ is missing, which breaks the Fourier transform and makes our result wrong. I have been trying to find a mistake in my calculation, to see where the sign function was neglected. Unfortunately, it all looks correct to me. Therefore, I'd like to ask if I made a mistake somewhere, or if there is a bug in Mathematica? Thanks for any suggestion!

• You should focus on the residuum theorem and Jordan's lemma. Perhaps the winding numbers of the residuals depend on sign[w] ... – Ulrich Neumann Dec 5 '17 at 10:15
• @UlrichNeumann Thanks for the hints, I'll look into it! – Kagaratsch Dec 5 '17 at 13:56
• @UlrichNeumann OK, using Jordan's lemma gives the correct result very easily. But it is a math exercise, not Mathematica, so I wrote it up here: math.stackexchange.com/a/2551343/39367 – Kagaratsch Dec 5 '17 at 16:06
• In your calculation with limit of the antiderivative function every thing seems to be ok. But doing so you neglect an infinite set of small deviations !!! – Ulrich Neumann Dec 5 '17 at 21:44
• @UlrichNeumann Interesting! Could you elaborate a bit on the nature of the neglected small deviations? – Kagaratsch Dec 5 '17 at 22:40

I assume you want to do the Fourier Transform of Csc[x]. Consider that:

$\csc x=\sum_{n=-\infty}^{\infty}\frac{(-1)^n}{x-n\pi}$

Thus, we have to do the Fourier Transform of $1/(\pi(x-n))$:

Assuming [n \[Element] Integers && \[Omega] \[Element] Reals,
FourierTransform[1/(\[Pi] (x - n)), x, \[Omega]]]

(* (I E^(I n \[Omega]) Sign[\[Omega]])/Sqrt[2 \[Pi]] *)


Therefore, you have your desired result:

$\frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty dx \frac{e^{iwx}}{\sin(\pi x)}=\frac{i (-1)^n}{\sqrt{2\pi}}\text{sign}(\omega)\sum_{n=-\infty}^{\infty}e^{i n \omega}$

as

$(-1)^n=\exp(i n \pi)$

• Yeah, that is what I ended up doing in math.stackexchange.com/a/2551343/39367 . My beef here is more with Mathematica seemingly losing a sign function when trying to apply the anti-derivative approach. – Kagaratsch Dec 5 '17 at 13:55