Does the integral converge $\int_{-\infty}^{+\infty}\frac{\exp(ibx)}{1+e^x}\,dx$ for $b>0$? I try to calculate integral $$\int_{-\infty}^{+\infty}\frac{\exp(ibx)}{1+e^x}\,dx.$$ Does it converge for $b>0$? Wolfram Mathematica shows contradictory results: for $b=2$ it converges, for $b=1$ and $b=3$ it does not. I need to calculate it.
 A: Probably something along these lines ...
Set $f(z) = e^{i\alpha z}/(1 + e^z)$ for complex $z$ and integrate round the closed contour running along the real axis from $z = -R$ to
$z = R$, then continuing on the semicircle of radius $R$ in the upper half plane:
\begin{align}
I_1(R) &= \int_{-R}^R f(x)\, dx, \\
I_2(R) &= iR \int_0^\pi f(Re^{i\theta}) e^{i\theta}\, d\theta.
\end{align}
We're aiming for using Cauchy's integral theorem. On the semicircle
\begin{align}
f(Re^{i\theta}) &= \frac{\exp(i\alpha R e^{i\theta})}{1 + \exp(Re^{i\theta})} \\
&= \frac{\exp(-\alpha R \sin\theta + i\alpha R \cos\theta)}{1 + \exp(R\cos\theta + iR\sin\theta)}
\end{align}

*

*For $0 < \theta < \pi/2$, both $\cos\theta$ and $\sin\theta$ are positive. The numerator is $O(e^{-\alpha R \sin \theta})$ and the denominator is $O(e^{R\cos\theta})$ so the ratio is $O(e^{-\alpha R \sin\theta - R\cos\theta})$.


*When $\pi/2 < \theta < \pi$, $\sin\theta$ remains positive but $\cos\theta$ is negative. The numerator is $O(e^{-\alpha R\sin\theta})$ and the denominator is
$O(1)$, so the ratio is $O(e^{-\alpha R\sin\theta})$.
All of this to justify that $I_2(R) \rightarrow 0$ as $R \rightarrow \infty$. It follows from Cauchy's integral theorem, letting $R \rightarrow \infty$, that
$I_1(\infty)$ is $2\pi i$ times the sum of the residues of $f$ in the upper half-plane. Here the poles of $f$ are simple and occur at $z_k = (2k + 1)\pi i$ for $k = 0, 1, \dots$. Verify that $\text{Res}(f, z_k) = -e^{-\pi\alpha (2k + 1)}$,
which yields:
\begin{align}
I_1(\infty) &= -2\pi i \sum_{k=0}^\infty e^{-\pi\alpha(2k + 1)} \\
&= -2\pi i e^{-\pi \alpha}\sum_{k=0}^\infty e^{-2\pi \alpha k} \\
&= -2\pi i e^{-\pi \alpha}\frac{1}{1 - e^{-2\pi\alpha}} \\
&= -\frac{\pi i}{\sinh(\pi \alpha)}.
\end{align}
A: This note explains the comment (to the OP) by @Maxim regarding $\mathscr{F}\left[\frac{1}{e^x+1}\right](\xi)$ of a tempered distribution, provided that we define it as $\mathscr{F}\big[f(x)\big](\xi)=\int_{-\infty}^\infty f(x)e^{i\xi x}\,dx$ for regular $f$.
Using the sign function, $$\frac{1}{e^x+1}=\frac{\operatorname{sgn}x}{e^{|x|}+1}+\frac{1-\operatorname{sgn}x}{2},$$ and the first term on the RHS has a regular Fourier transform $\color{LightGray}{\texttt{(todo: link)}}$: $$\mathscr{F}\left[\frac{\operatorname{sgn}x}{e^{|x|}+1}\right](\xi)=2i\int_0^\infty\frac{\sin\xi x}{e^x+1}\,dx=\frac{i}{\xi}-\frac{\pi i}{\sinh\pi\xi}.$$ The FT of the remainder is found using $\mathscr{F}[1](\xi)=2\pi\delta(\xi)$ and $\mathscr{F}[\operatorname{sgn}x](\xi)=2i$$\mathscr{P}\frac{1}{\xi}$.
A: The integral $I^+(b)=\int_{0}^\infty \frac{e^{ibx}}{1+e^x}\,dx$ exists, both as an improper Riemann integral or a Lebesgue integral.  In fact, by expanding $\frac{1}{1+e^x}=\frac{e^{-x}}{1+e^{-x}}$ in a geometric series, we can write $I^+(b)$ in series form as
$$I^+(b)=\sum_{n=1}^\infty \frac{(-1)^{n-1}}{n-ib}\tag1$$
But the integral $I^-(b)=\int_{-\infty}^0 \frac{e^{ibx}}{1+e^x}\,dx$ fails to exist.  As has already been discussed by others on this page, we may interpret $I^-(b)$ as a distribution.
So, I thought it might be instructive to present an approach to evaluating the distribution $I^-(b)$ that is distinct to the other posted answers.  It is to that end that we now proceed.

Let $R>0$ and denote $I^-_R(b)=\int_{-R}^0 \frac{e^{ibx}}{1+e^x}\,dx$ as the integral.  Note that $\lim_{R\to \infty}I^-_R(b)=I^-(b)$ in disribution.  Now, enforcing the substitution $x\mapsto -x$ and expanding $\frac{1}{1+e^{-x}}$ in a geometric series
$$\begin{align}
I^-_R(b)&=\sum_{n=0}^\infty \frac{(-1)^n(1-e^{-(n+ib)R})}{n+ib} \\\\
&=-\frac ib (1-e^{-ibR})-\sum_{n=1}^\infty \frac{(-1)^{n-1}(1-e^{-(n+ib)R})}{n+ib}\\\\
\end{align}$$
In the sense of distributions, $\lim_{R\to\infty}\frac{1-e^{-ibR}}b=\text{PV}\left(\frac1b\right)+i\pi\delta(b)$.  (See the Proof in the Appendix herein)
Therefore, in the sense of distributions
$$I^-(b)=-i\text{PV}\left(\frac1b\right)+\pi \delta(b)-\sum_{n=1}^\infty \frac{(-1)^{n-1}}{n+ib}\tag2$$

Putting $(1)$ and $(2)$ together, the Fourier Transform of $f(x)=\frac1{1+e^x}$ is
$$\mathscr{F}\{f\}(b)=\pi\delta(b)-i\text{PV}\left(\frac1b\right)+i2b\sum_{n=1}^\infty \frac{(-1)^{n-1}}{n^2+b^2}\tag3$$
The series in $(3)$ can be found using the Residue Theorem by integrating $\frac{\csc(\pi z)}{z^2+b^2}$ over a circular contour with radius $N+1/2$, $N\in \mathbb{N}$ and center at $z=0$ and then letting $N\to \infty$.  Proceeding reveals
$$\sum_{n=-\infty}^\infty \frac{(-1)^n}{\pi(n^2+b^2)}+\frac{1}{ib\sin(i\pi b)}=0$$
from which we find that
$$i2b\sum_{n=1}^\infty \frac{(-1)^{n-1}}{n^2+b^2}=\frac ib-i\pi \text{csch}(\pi b)\tag4$$
Substituting $(4)$ in $(3)$ yields the coveted result
$$\bbox[5px,border:2px solid #C0A000]{\mathscr{F}\{f\}(b)=\pi\delta(b)-i\text{PV}\left(\frac1b\right)+\frac ib-i\pi \text{csch}(\pi b)}$$


APPENDIX:  Proof that $\displaystyle \lim_{R\to\infty}\frac{1-e^{-ibR}}{b}=\text{PV}\left(\frac1b\right)+i\pi \delta(b)$
STEP $1$
Let $\phi(b)$ be a Schwartz function.  We will show that
$$\lim_{R\to \infty}\int_{-\infty}^\infty \phi(b) \frac{\sin(bR)}{b}\,db=\pi \phi(0)$$
Integrating by parts with $u=\phi(b)$ and $v=\int_{-\infty}^b \frac{\sin(kR)}{k}\,dk$, and applying the Dominated Convergence Theorem, we find that
$$\begin{align}
\lim_{R\to\infty}\int_{-\infty}^\infty \phi(b) \frac{\sin(bR)}{b}\,db&=-\lim_{R\to\infty}\int_{-\infty}^\infty \phi'(b) \int_{-\infty}^b \frac{\sin(kR)}{k}\,dk\,db\\\\
&=-\lim_{R\to\infty}\int_{-\infty}^\infty \phi'(b) \int_{-\infty}^{Rb} \frac{\sin(k)}{k}\,dk\,db\\\\
&=-\pi \int_{-\infty}^\infty \phi'(b)H(b)\,db\\\\
&=\pi \phi(0)
\end{align}$$
And we are done.

STEP $2$
Let $\phi(b)$ be a Schwartz function.  We will show that
$$\lim_{R\to \infty}\int_{-\infty}^\infty \phi(b) \frac{1-\cos(bR)}{b}\,db=\lim_{\varepsilon\to 0^+}\int_{|x|\ge\varepsilon}\frac{\phi(b)}{b}\,db$$
Fix $\varepsilon>0$.  Then, applying the Riemann-Lebesgue Lemma reveals
$$\begin{align}
\lim_{R\to\infty}\int_{-\infty}^\infty \phi(b) \frac{1-\cos(bR)}{b}\,db&=\lim_{R\to\infty}\int_{|b|<\varepsilon} \phi(b) \frac{1-\cos(bR)}{b}\,db+\lim_{R\to\infty}\int_{|b|>\varepsilon} \phi(b) \frac{1-\cos(bR)}{b}\,db\\\\
&=\lim_{R\to\infty}\int_{|b|<\varepsilon} \phi(b) \frac{1-\cos(bR)}{b}\,db+\int_{|b|>\varepsilon} \frac{\phi(b)}{b}\,db
\end{align}$$
Next, writing $\phi(b)=\phi(0)+\phi'(0)b+O(b^2)$ for $|b|<\varepsilon$ and noting that $\frac{1-\cos(bR)}{b}$ is integrable and an odd function of $b$, we find that
$$\int_{|b|<\varepsilon} \phi(b) \frac{1-\cos(bR)}{b}\,db=O(\varepsilon)$$
Letting $\varepsilon \to 0^+$ we conclude
$$\begin{align}
\lim_{R\to\infty}\int_{-\infty}^\infty \phi(b)\frac{1-\cos(bR)}{b}\,db&=\lim_{\varepsilon\to0^+}\int_{|x|\ge \varepsilon}\frac{\phi(b)}{b}\,db\\\\
&=\text{PV}\int_{-\infty }^\infty \frac{\phi(b)}{b}\,db
\end{align}$$

PUTTING STEPS $1$ AND $2$ TOGETHER
Using the results in Steps $1$ and $2$ yields
$$\lim_{R\to \infty }\left(\frac{1-e^{-ibR}}{b}\right)=\text{PV}\left(\frac1b\right)+i\pi \delta(b)$$
A: This will be not a purely mathematical but rather a physical illustration via the integrand regularization.
Lets consider $f(x,a)=\frac{\exp(ibx+ax)}{1+\exp(x)}$, where $a$ is a small parameter which we will finally set to zero. Let's consider the integral over the contour C - a rectangle from $-R$ to $R$ and from $0$ to $2\pi{i}$; counter clockwise.

The integrand is a single-valued function in the area, so $I(a,b)=\oint_C\frac{\exp(ibx+ax)}{1+\exp(x)}dx$. Taking integral along every line of the contour and due exponent periodicity $\exp(x+2\pi{i})=\exp(x)$ we get:
$I(a,b)=\int_{-R}^{R}\frac{\exp(ibx+ax)}{1+\exp(x)}(1-\exp(-2\pi{b}+2{\pi}ia))dx+I_1+I_2=2{\pi}iRes_{x=\pi{i}}\frac{\exp(ibx+ax)}{1+\exp(x)}=$$ =-2\pi{i}\exp(-\pi{b}+\pi{ia})$
$|I_1|<\int_0^{2\pi}|\frac{\exp(ibR+aR-bt+iat)}{1+\exp(R+it)}|dt<const\exp(-(1-a)R)\to0$ as $R\to{\infty}$ ($a<<1$)
$I_2=i\int_{2\pi}^0\frac{\exp(-ibR-aR-bt+iat)}{1+\exp(-R+it)}dt\to-i\exp(-aR-ibR)\int_0^{2\pi}\exp(-bt+iat)dt=$$=-i\exp(-aR-ibR)\frac{1-\exp(2\pi(ia-b))}{b-ia}$ as $R\to{\infty}$
$$\int_{-R}^{R}\frac{\exp(ibx+ax)}{1+\exp(x)}dx\to-2\pi{i}\frac{1}{\exp(\pi{b}-\pi{ia})-exp(-\pi{b}+\pi{ia})}+i\frac{\exp(-aR-ibR)}{b-ia}$$
As soon as we set $a\to0$ we get $$\int_{-R}^{R}\to-\pi{i}\frac{1}{\sinh(\pi{b})}+i\frac{\exp(-ibR)}{b}$$
Second term is not strongly defined - the limit at $R\to{\infty}$ does not exist.
Physically speaking it is strongly oscillating but limited by value. Here we have the same situation, for instance, when we identify delta-function  $\delta(x)$ as $\frac{1}{2\pi}\int_{-\infty}^{\infty}exp(ikx)dk=\lim_{R\to{\infty}}\frac{1}{2\pi}\int_{-R}^{R}\exp(ikx)dk=\lim_{R\to{\infty}}\frac{\sin(xR)}{\pi{x}}$
Limit does not exist, but any further manipulations (for instance, integrating with a smooth function) shows that this is actually delta-function which is equal to zero at any point except for zero.
All this is not of course a math proof - just an illustration.
