# Complex Contour Integration - Complex Analysis

I'm just practising for my upcoming exam, and I've come across a question I'm having a bit of difficulty with.

I've been asked to show the following; $$\int_{0}^{\infty} \frac{dz}{\cosh(z)} = \frac{\pi}{2}$$

Which, we're told, needs to be integrated around an appropriate contour, with the hint that this countour should be a rectangle with vertices at $-R$, $R$, $R + \pi i$, $-R + \pi i$, oriented in the positive sense.

So, I started by noting that the function $f(z) = \frac{1}{\cosh(z)}$ is even, so we can say that, as $R \rightarrow \infty$, $\int_{-R}^{R} f(z)\cdot dz = PV \int_{-\infty}^{\infty} f(z)\cdot dz = \int_{-\infty}^{\infty} f(z)\cdot dz$

So, now, we can evaluate the contour using Cauchy's Residue Theorem, noting that the only singularity to occur within this contour is $z = \frac{\pi i}{2}$, which has the residue $-i$, so the integral simply becomes; $$\int_C \frac{dz}{\cosh(z)} = 2 \pi i \times -i = 2 \pi$$

Then, I need to deal with the integrals above the real axis. So, let's do the following; $$\Gamma_{1} = \int_{0}^{R + \pi i} f(z) \cdot dz$$ $$\Gamma_{2} = \int_{R + \pi i}^{-R + \pi i} f(z) \cdot dz$$ $$\Gamma_{3} = \int_{0}^{-R + \pi i} f(z) \cdot dz$$ Then; $$\int_{\Gamma_{1} + \Gamma_{2} + \Gamma_{3}}f(z) \cdot dz = \int_{\Gamma_1}f(z) \cdot dz + \int_{\Gamma_2}f(z) \cdot dz + \int_{\Gamma_3}f(z) \cdot dz$$ $$= \int_{0}^{R + \pi i} f(z) \cdot dz + \int_{R + \pi i}^{-R + \pi i} f(z) \cdot dz - \int_{-R + \pi i}^{0} f(z) \cdot dz$$ $$= \int_{0}^{R + \pi i} f(z) \cdot dz + \int_{0}^{-R + \pi i} f(z) \cdot dz +\int_{R + \pi i}^{0} f(z) \cdot dz - \int_{0}^{-R + \pi i} f(z) \cdot dz$$ $$= \int_{0}^{R + \pi i} f(z) \cdot dz +\int_{R + \pi i}^{0} f(z) \cdot dz = 0$$

Assuming I've done all of that correctly, I get; $$Lim(R \rightarrow \infty) \int_{-R}^{R} \frac{dz}{\cosh(z)} = \int_{-\infty}^{\infty} \frac{dz}{\cosh(z)} = 2\pi$$

And, as $f(z)$ is even, we have;

$$\int_{0}^{\infty} \frac{dz}{\cosh(z)} = \pi$$

What have I missed?? Unless those three gamma integrads are meant to equate to give $\pi$, I can't see what I've done incorrectly here. I know it's a lot of working to go through, but any help would be fantastic. :)

• $\Gamma_1$ and $\Gamma_3$ should go from $R$ to $R+i\pi$ resp. $-R$ to $-R+i\pi$ respectively. They tend to $0$ The integral $\Gamma_2$ does not vanish. – Daniel Fischer Jun 12 '14 at 12:19
• Aha, that'll be it then!! Outside of evaluating the integral of $1 / cosh(z)$, is there any quicker way/trick of getting the $\Gamma_2$ integral?? – Jack Jun 12 '14 at 12:21
• Hint: $\cosh(z+\pi i)=-\cosh(z)$. – Harald Hanche-Olsen Jun 12 '14 at 12:21
• Well, what Harald said. – Daniel Fischer Jun 12 '14 at 12:22
• Does that essentially turn the $\Gamma_2$ integral into $\int_{-R}^{R} f(z) \cdot dz$ ?? – Jack Jun 12 '14 at 12:27

## 1 Answer

$\newcommand{\+}{^{\dagger}} \newcommand{\angles}{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}{\displaystyle{#1}} \newcommand{\expo}{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}{\,\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}{\left\vert #1\right\rangle} \newcommand{\ol}{\overline{#1}} \newcommand{\pars}{\left(\, #1 \,\right)} \newcommand{\partiald}[]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}{\underline{#1}} \newcommand{\verts}{\left\vert\, #1 \,\right\vert} \newcommand{\wt}{\widetilde{#1}}$ $\ds{\int_{0}^{\infty}{\dd z \over \cosh\pars{z}} = {\pi \over 2}:\ {\large ?}}$

Besides the $\ds{\color{#c00000}{\tt 'tricky' complex\ integration}}$, it's indeed quite simple:

\begin{align}&\color{#66f}{\Large\int_{0}^{\infty}{\dd z \over \cosh\pars{z}}} =2\ \overbrace{\int_{0}^{\infty}{\expo{z}\,\dd z \over \expo{2z} + 1}} ^{\ds{\mbox{Set}\ \expo{z}\ \equiv t}}\ =\ =2\int_{1}^{\infty}{\dd t \over t^{2} + 1} =\left.\vphantom{\huge A}2\arctan\pars{t}\,\right\vert_{1}^{\infty} \\[3mm]&=2\pars{{\pi \over 2} - {\pi \over 4}} = \color{#66f}{\Large{\pi \over 2}} \end{align}