# 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

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