Fourier transform of 1/cosh How do you take the Fourier transform of 
$$
f(x) = \frac{1}{\cosh x}
$$
This is for a complex class so I tried expanding the denominator and calculating a residue by using the rectangular contour that goes from $-\infty$ to $\infty$ along the real axis and $i \pi +\infty$ to $i \pi - \infty$ to close the contour (with vertical sides that go to 0).  Therefore, I tried to calculate the residue at $\frac{i \pi}{2}$ of 
$$
\frac{e^{-ikx}}{e^x + e^{-x}} $$ which will be give me the answer, but I don't know how to do this.  Thanks for the help!
 A: $\newcommand{\+}{^{\dagger}}
 \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}
 \newcommand{\wt}[1]{\widetilde{#1}}$
$\ds{{1 \over \cosh\pars{x}}
     =\int_{-\infty}^{\infty}\tilde{\fermi}\pars{k}\expo{\ic kx}
     \,{\dd k \over 2\pi}\quad\imp\quad\tilde{\fermi}\pars{k}
     =\int_{-\infty}^{\infty}{\expo{-\ic k x} \over \cosh\pars{x}}\,\dd x:\
     {\large ?}}$

In order to avoid the infinite poles of $\ds{\cosh\pars{x}}$, we can make a suitable change of variables which 'leave us' with just ${\large\tt\ul{one}}$ pole. As an extra bonus, we don't have to sum a serie:
  \begin{align}
\tilde{\fermi}\pars{k}&=2\ \overbrace{%
\int_{-\infty}^{\infty}{\expo{-\ic k x} \over \expo{x} + \expo{-x}}\,\dd x}
^{\ds{\mbox{Set}\ t = \expo{x}\ \imp\ x = \ln\pars{t}}}
=2\int_{0}^{\infty}{t^{-\ic k} \over t + 1/t}\,{\dd t \over t}
=2\int_{0}^{\infty}{t^{-\ic k} \over t^{2} + 1}\,\dd t
\\[3mm]&=\
\overbrace{\color{#c00000}{%
\int_{0}^{\infty}{t^{-1/2 - \ic k/2} \over t + 1}\,\dd t}}
^{\ds{=\ \tilde{\fermi}\pars{k}}}\
=\ 2\pi\ic\pars{\expo{\ic\pi}}^{-1/2 - \ic k/2}
-\int^{0}_{\infty}
{t^{-1/2 - \ic k}\pars{\expo{2\pi\ic}}^{-1/2 - \ic k/2} \over t + 1}\,\dd t
\\[3mm]&=2\pi\expo{\pi k/2}
-\expo{\pi k}\
\overbrace{\color{#c00000}{\int_{0}^{\infty}{t^{-1/2 - \ic k/2} \over t + 1}\,\dd t}}
^{\ds{=\ \tilde{\fermi}\pars{k}}}
\ \imp\ \tilde{\fermi}\pars{k}=\pi\,{2\expo{\pi k/2} \over 1 + \expo{\pi k}}
=\pi\,{2 \over \expo{-\pi k/2} + \expo{\pi k/2}}
\end{align}

$$\color{#00f}{\large%
\int_{-\infty}^{\infty}{\expo{-\ic k x} \over \cosh\pars{x}}\,\dd x}
=
\color{#00f}{\large\pi\sech\pars{{\pi \over 2}\,k}}
$$
A: I know that this question is rather old, but here is an answer which does not rely on the residue theorem:
Letting $t = (1 + x^\beta)^{-1}$ we find for $0 < \operatorname{Re} \alpha < \beta$
\begin{align} \int \limits_0^\infty \frac{x^{\alpha -1}}{1+x^\beta} \, \mathrm{d} x &= \frac{1}{\beta} \int \limits_0^1 t^{-\frac{\alpha}{\beta}} (1-t)^{\frac{\alpha}{\beta} - 1} \, \mathrm{d} t  = \frac{1}{\beta} \operatorname{B} \left(1-\frac{\alpha}{\beta},\frac{\alpha}{\beta}\right) \\ &= \frac{1}{\beta} \Gamma \left(1-\frac{\alpha}{\beta}\right) \Gamma \left(\frac{\alpha}{\beta}\right) = \frac{\pi}{\beta} \csc\left(\frac{\alpha}{\beta} \pi \right) \, .
\end{align}
Now using Felix Marin's substitution $x = \ln(t)$ we obtain for $k \in \mathbb{R}$
\begin{align}
\int \limits_{-\infty}^\infty \frac{\mathrm{e}^{-\mathrm{i} k x}}{\cosh(x)} \, \mathrm{d} x &= 2 \int \limits_0^\infty \frac{t^{-\mathrm{i} k}}{1+t^2} \, \mathrm{d} t = 2 \frac{\pi}{2} \csc \left(\frac{1 - \mathrm{i} k}{2} \pi \right) = \pi \sec \left(\mathrm{i} \frac{\pi}{2} k\right) \\ &= \pi \operatorname{sech} \left( \frac{\pi}{2} k\right) \, .
\end{align}
A: First, let's compute the FT of $\text{sech}{(\pi x)}$, which may be derived using the residue theorem.  We simply set up the Fourier integral as usual and comvert it into a sum as follows:
$$\begin{align}\int_{-\infty}^{\infty} dx \, \text{sech}{(\pi x)} \, e^{i k x} &= 2 \int_{-\infty}^{\infty} dx \frac{e^{i k x}}{e^{\pi x}+e^{-\pi x}}\\ &= 2 \int_{-\infty}^0 dx \frac{e^{i k x}}{e^{\pi x}+e^{-\pi x}} + 2 \int_0^{\infty}dx \frac{e^{i k x}}{e^{\pi x}+e^{-\pi x}}\\ &= 2 \sum_{m=0}^{\infty} (-1)^m \left [\int_0^{\infty}dx \, e^{-[(2 m+1) \pi+i k] x} +\int_0^{\infty}dx \, e^{-[(2 m+1) \pi-i k] x} \right ] \\ &= 2 \sum_{m=0}^{\infty} (-1)^m \left [\frac{1}{(2 m+1) \pi-i k} + \frac{1}{(2 m+1) \pi+i k} \right ]\\ &= 4\pi \sum_{m=0}^{\infty} \frac{(-1)^m (2 m+1)}{(2 m+1)^2 \pi^2+k^2}\\ &= \frac{1}{2 \pi}\sum_{m=-\infty}^{\infty} \frac{(-1)^m (2 m+1)}{\left (m+\frac12\right)^2+\left(\frac{k}{2 \pi}\right)^2}  \end{align}$$
By the residue theorem, the sum is equal to the negative sum of the residues at the non-integer poles of
$$\pi \csc{(\pi z)} \frac{1}{2 \pi}\frac{2 z+1}{\left ( z+\frac12\right)^2+\left (\frac{k}{2 \pi}\right)^2}$$
which are at $z_{\pm}=-\frac12 \pm i \frac{k}{2 \pi}$. The sum is therefore
$$-\frac12\csc{(\pi z_+)} - \frac12 \csc{(\pi z_-)} = -\Re{\left [\frac{1}{\sin{\pi \left (-\frac12+i \frac{k}{2 \pi}\right )}}\right ]} = \text{sech}{\left ( \frac{k}{2}\right)}$$
By this reasoning, the FT of $\operatorname{sech}{x}$ is $\pi\, \text{sech}{\left ( \frac{\pi k}{2}\right)}$.
A: To calculate the residue, we use the formula
\begin{equation*}
\text{Res}_{z_0}f=\lim_{z\rightarrow z_0}(z-z_0)f(z)
\end{equation*}
Then we replace $z_0$ by $i\pi/2$
\begin{equation*}
\begin{split}
(z-z_0)f(z)&=e^{-2\pi iz\xi}\frac{2(z-z_0)}{e^{\pi z}+e^{-\pi z}} \\ &=2e^{-2\pi iz\xi}e^{\pi z}\frac{2(z-z_0)}{e^{２\pi z}-e^{2\pi z_0}}
\end{split}
\end{equation*}
\begin{equation*}
\lim_{z\rightarrow z_0}(z-z_0)f=2e^{-2\pi iz_0\xi}e^{\pi z_0}\frac{1}{2\pi e^{2\pi z_0}}=\frac{e^{\pi\xi}}{\pi i}
\end{equation*}
A: Here is another approach based in Calculus of residues.
$f(x)=\frac{1}{\operatorname{cosh}(x)}=\frac{2}{e^x+e^{-x}}$ is an even function and
\begin{align*}  |f(x)|=\frac{2e^{-|x|}}{1+e^{-2|x|}}\leq2e^{-|x|}\in L_1(\mathbb{R})
  \end{align*}
It follows that
\begin{align*}
    \int_{\mathbb{R}}e^{-i2\pi tx}f(x)\,dx=\int_{\mathbb{R}}\cos(2\pi tx)f(x)\,dx
  \end{align*}
Consider the contour $C_R$ joining the points $-R$, $R$, $R+i\pi$, and $-R+i\pi$ as in figure below

The function $\phi(z)=\frac{2\cos(2\pi tz)}{e^z+e^{-z}}$ has only one pole inside the bounded region bounded by $C_R$ at $z=\frac{\pi}{2}i$. Hence
\begin{align}
   \int_{C_R}\frac{2\cos(2\pi tz)}{e^z+e^{-z}}\,dz&=2\pi i \operatorname{Re}_{i\pi/2}(\phi)=2\pi i\lim_{z\rightarrow\pi i/2}(z-i\frac{\pi}{2})\phi(z)\\
    &=\pi\big(e^{\pi^2t}+e^{-\pi^2t}\big)
  \end{align}
Since $f$ is even, the countour integral above can be expressed as
$$\begin{align}
\int_{C_R}\phi(z)\,dz&=\int^R_{-R}\phi(x)\,dx+i\int^\pi_0\phi(R+ix)\,dx-\int^R_{-R}\phi(x+i\pi)\,dx \\
&\quad -i\int^\pi_0\phi(-R+ix)\,dx \\
&=\frac12 (2+e^{2\pi^2t}+e^{-2\pi^2t})\int^R_{-R}\phi(t)\,dt+ \\
&\quad i\int^\pi_0\frac{e^{2\pi itR}e^{-2\pi tx}+e^{-2\pi itR}e^{2\pi tx}}{e^{R}e^{itx}+e^{-R}e^{-itx}}\,dx \\
&\quad -i\int^\pi_0\frac{e^{-2\pi itR}e^{-2\pi tx}+e^{2\pi itR}e^{2\pi tx}}{e^{-R}e^{itx}+e^{R}e^{-itx}}\,dx
\end{align}
$$
Letting $R\rightarrow\infty$ and applying dominated convergence yields
\begin{align}
    \frac12\big(e^{\pi^2t}+e^{-\pi^2t}\big)^2\widehat{f}(t)=\pi(e^{\pi^2t}+e^{-\pi^2t})
  \end{align}
whence we ontain
$$\widehat{f}(t)=\pi\operatorname{sech}(\pi^2t)$$
