# Thread: contour integral and residue thm.

1. ## contour integral and residue thm.

Hi there!

I am trying to confirm the following integral using the residue theorem but I'm stuck in the end and I don't know what I did wrong:

$\int_{-\infty}^{+\infty}\frac{1}{\cosh x}dx=\pi$

Here's my solution:

We chose \gamma to be the positively oriented semicircle around the origin of radius R, so we get:

$\gamma=\gamma_1+\gamma_2$

$\gamma_1=Re^{it}, t\in[0, \pi]$

$\gamma_2=t, t\in[-R,R]$

and we are going to apply the residue thm on the following holomorphic function:

$\oint_{\gamma}\frac{1}{\cosh z}dz=2\pi i\sum_k Res_{z=c_k}f(z)$

where $\frac{1}{\cosh z}=f(z)$ and c_k are the zeroes of coshz, i.e. $c_k=\frac{2k+1}{2}\pi i$

First, we show that the integral over the semicircle vanishes for big R:

Using the estimation lemma, where ||-|| denotes the supremum norm, we get

$||\oint_{\gamma}\frac{1}{\cosh z}dz||_{\gamma}=2\pi R||\frac{1}{e^z+e^{-z}}||_{\gamma}$

Observe that $||e^z+e^{-z}||\geq ||e^z||-||e^{-z}||=e^{Re^{it}}-e^{-Re^{it}}\geq e^R-e^{-R}$

so it follows that

$||\oint_{\gamma}\frac{1}{\cosh z}dz||_{\gamma}=2\pi R||\frac{1}{e^z+e^{-z}}||_{\gamma}\leq 2\pi R\frac{1}{e^R-e^{-R}}\longrightarrow^{R\rightarrow\infty}0$ using l'Hospitals rule.

so we got: $\int_{\gamma_1}\frac{1}{\cosh z}dz=0$ for R very big, and

$\int_{\gamma_2}\frac{1}{\cosh z}dz=\int_{-\infty}^{+\infty}\frac{1}{\cosh x}dx=2\pi i\sum_k Res_{z=c_k}f(z)$

Now all we have to do is compute the residue of f in its poles. Since they're all poles of order 1 we proceed:

$Res_{z=c_k}f(z)=\lim_{z\rightarrow\frac{2k+1}{2}\p i i}\frac{z-\frac{2k+1}{2}\pi i}{\cosh z}=\lim_{z\rightarrow\frac{2k+1}{2}\pi i}\frac{1}{\sinh z}=\frac{1}{i\sin(\frac{2k+1}{2}\pi)}=-i(-1)^k$

so, finally we obtain:

$\int_{-\infty}^{+\infty}\frac{1}{\cosh x}dx=2\pi i\sum_k Res_{z=c_k}f(z)=2\pi i\sum_{k=0}^{\infty} -i(-1)^k=2\pi \sum_{k=0}^{\infty}(-1)^k$

but the series is DIVERGENT?!

Now, this means that whether I did something wrong using the residue thm., or I computed wrong the residues.

What is interesting to me is that the residue sum here appears to be actually a residue series. This is not impossible, since no residue lies ot the integraition contour and the zeroes of coshz are infinitely many, but countable.

I hope someone could help me with this puzzle

Thanks a lot, Marine

2. Try the rectangular contour with vertices $-R+\mathrm i0$, $R+\mathrm i0$, $R+\mathrm i\pi$ and $-R+\mathrm i\pi$. This contains a single pole at $0+\mathrm i\pi/2$.

3. hmmm, this does not answer the question about the mistake in the obove calculations, but let's give it a try:

$\int_{R}^{R+\pi i}\frac{1}{\cosh t}dt+\int_{R+\pi i}^{-R+\pi i}\frac{1}{\cosh t}dt+\int_{-R+\pi i}^{-R}\frac{1}{\cosh t}dt+\int_{-R}^{R}\frac{1}{\cosh t}dt=2\pi$

so far so good, but what should I do next?

If I let R to infty, then then first 3 integrals go to 0 but I'd do an error, because there come other poles in the interior of the contour which have to be added to the total residue..

If I don't let R to infty, the best I eventually could achieve is to express the first 3 integrals via the fourth and then let go R to infty. But then I'm in trouble, since I'd get an identity of the type $\int_{-R}^{R}\frac{1}{\cosh t}dt=const$ but when I finally let R to infty, the constant won't change, so it'd be something like:

$\int_{-R}^{R}\frac{1}{\cosh t}dt=const=\int_{-\infty}^{+\infty}\frac{1}{\cosh t}dt$

which is also incorrect...

or is there a third oppotunity I can't see?

4. Let $f(z) = \frac{1}{\cosh z}$

$\int_{C} f(z) dz = \int_{-R}^{R} f(x) dx + \int_{R}^{R+i \pi} f(z)dz + \int_{R + i \pi}^{-R + i \pi} f(z) dz + \int_{-R + i \pi}^{-R} f(z) dz$

$\cosh(x + i \pi) = -\cosh x$

so $\int_{C} f(z) dz = \int_{-R}^{R} f(x) dx + \int_{R}^{R+i \pi} f(z)dz - \int_{R }^{-R } f(x) dx + \int_{-R + i \pi}^{-R} f(z) dz$

or $\int_{C} f(z) dz = 2 \int_{-R}^{R} f(x) dx + \int_{R}^{R+i \pi} f(z)dz + \int_{-R + i \pi}^{-R} f(z) dz$

$\text{Res} \{f, z_{0}\} = \lim_{z \to z_{0}} \frac{(z-z_{0})}{\cosh z} = \lim_{z \to z_{0}} \frac{1}{\sinh z}$

$\text{Res} \{f, i \frac{\pi}{2}\} = -i$

(The other poles lie above above and below the rectangular contour along the vertical axis.)

so $\int_{C} f(z) dz = \int_{-R}^{R} f(x) dx = 2 \pi$

Because $\cosh x$ grows exponentially, the other two integrals evaluate to zero when you let R go to infinity.

so we're left with

$2 \int_{-\infty}^{\infty} f(x) dx = 2 \pi$

$\int_{-\infty}^{\infty} \frac{1}{\cosh x} dx = \pi$

5. May be that an error lies at the point...

$\lim_{z\rightarrow\frac{2k+1}{2}\pi i}\frac{z-\frac{2k+1}{2}\pi i}{\cosh z}=\lim_{z\rightarrow\frac{2k+1}{2}\pi i}\frac{1}{\sinh z}$

... where you have [apparently] applied De l'Hopital's rule to an expression that is well determinate, as you can easily verify remembering the following 'product infinite'...

$\cosh z = \prod_{k=0}^{\infty} [1+i \frac{2z}{(2k+1) \pi}] [1-i \frac{2z}{(2k+1) \pi}]$

Kind regards

$\chi$ $\sigma$

6. Originally Posted by chisigma
May be that an error lies at the point...

$\lim_{z\rightarrow\frac{2k+1}{2}\pi i}\frac{z-\frac{2k+1}{2}\pi i}{\cosh z}=\lim_{z\rightarrow\frac{2k+1}{2}\pi i}\frac{1}{\sinh z}$

... where you have [apparently] applied De l'Hopital's rule to an expression that is well determinate, as you can easily verify remembering the following 'product infinite'...

$\cosh z = \prod_{k=0}^{\infty} [1+i \frac{2z}{(2k+1) \pi}] [1-i \frac{2z}{(2k+1) \pi}]$

Kind regards

$\chi$ $\sigma$
No, this part is correct. I would have used the fact that if $a$ is a simple pole of $\frac{A}{B}$, then the residue at $a$ is $\frac{A(a)}{B'(a)}$. This gives the same result $\frac{1}{\sinh((2k+1)i\frac{\pi}{2})}$.

Originally Posted by Marine
hmmm, this does not answer the question about the mistake in the obove calculations, but let's give it a try:

$\int_{R}^{R+\pi i}\frac{1}{\cosh t}dt+\int_{R+\pi i}^{-R+\pi i}\frac{1}{\cosh t}dt+\int_{-R+\pi i}^{-R}\frac{1}{\cosh t}dt+\int_{-R}^{R}\frac{1}{\cosh t}dt=2\pi$

so far so good, but what should I do next?

If I let R to infty, then then first 3 integrals go to 0 but I'd do an error, because there come other poles in the interior of the contour which have to be added to the total residue..
You have the following important formula:

$\cosh(a+ib)=\cosh a\cos b+i\sinh a\sin b$.

It shows that $\cosh(t+i\pi)=-\cosh t$. Thus, integrating $\frac{1}{\cosh}$ from $-R$ to $+R$ or from $R+i\pi$ to $-R+i\pi$ gives the same result. In the integral along the rectangle, the horizontal parts are equal (to $\int_{-R}^R \frac{1}{\cosh}$), and the vertical parts converge to 0. Thus, letting $R$ tend to infinity, we get $2\int_{\mathbb{R}}\frac{1}{\cosh}=2\pi$, as expected.

----

About the mistake in your first computation, it has really bothered me... I quickly found a mistake, but I first thought it could be corrected. It turns out that the correction was not that easy, and maybe it's even impossible (hence the problem). It is in the following part:

Originally Posted by Marine
First, we show that the integral over the semicircle vanishes for big R:

Using the estimation lemma, where ||-|| denotes the supremum norm, we get

$\left|\oint_{\gamma}\frac{1}{\cosh z}dz\right|{\color{red}\leq }2\pi R||\frac{1}{e^z+e^{-z}}||_{\gamma}$

Observe that $||e^z+e^{-z}||\geq ||e^z||-||e^{-z}||={\color{red}e^{Re^{it}}-e^{-Re^{it}}\geq e^R-e^{-R}}$

so it follows that

$||\oint_{\gamma}\frac{1}{\cosh z}dz||_{\gamma}=2\pi R||\frac{1}{e^z+e^{-z}}||_{\gamma}\leq 2\pi R\frac{1}{e^R-e^{-R}}\longrightarrow^{R\rightarrow\infty}0$ using l'Hospitals rule.

so we got: $\int_{\gamma_1}\frac{1}{\cosh z}dz=0$ for R very big
The "estimation lemma" gives an upper bound, not an equality (but I guess this is just a typo); the mistake is the inequality with exponentials.

For any $z$, you have $|e^z|=e^{\Re z}$ (real part of $z$). So you should have written:

$|e^z+e^{-z}|\geq |e^z|-|e^{-z}|=e^{R\cos t}-e^{-R\cos t}$.

And this is not greater than $e^R-e^{-R}$. Actually, if $\cos t>0$, the first term tends to infinity and the second one to 0; if $\cos t<0$, this is the contrary. And if $\cos t=0$, this equals 0... So you cannot use the "estimation lemma" only. It does not work for $t$ close to $\pi/2$.

Anyway, there should have been a problem because you didn't specify that $R$ is such that the circle avoids the poles (if there is a pole on the boundary, the integral diverges). For instance, a good choice seems to be $R=k\pi$ where $k\in\mathbb{N}$.

I thought one could use the bounded convergence theorem instead of a rough upper bound. The semi-circle integral is $\int_0^\pi \frac{Rie^{i\theta}}{\cosh(Re^{i\theta})}d\theta$. We have (using the first formula I gave) $|\cosh(a+ib)|^2=\cos^2 b+\sinh^2 a$, hence $|\cosh(Re^{i\theta})|\geq \sinh(R\cos\theta)$, so that we have the upper bound, for $\theta\in[0,\pi]\setminus\{\pi/2\}$, $\left|\frac{Rie^{i\theta}}{\cosh(Re^{i\theta})}\ri ght|\leq \frac{R}{|\sinh(R\cos\theta)|}\to_{R\to\infty} 0$. Thus, for almost all values of $\theta$ the integrand tends to 0. We would then need an integrable uniform upper bound to apply the bounded convergence theorem. The last inequality and $\sinh x\geq x$ give $\left|\frac{Rie^{i\theta}}{\cosh(Re^{i\theta})}\ri ght|\leq\frac{1}{|\cos\theta|}$ but the right-hand side is not integrable. That's because we haven't used the fact that $R=k\pi$. We should use $|\cosh(Re^{i\theta})|^2=\cos^2(R\sin\theta)+\sinh^ 2(R\cos\theta)$. It is simple to find an upper bound, but it's difficult to find a bound that is uniform (valid for all large $k$), and I wonder if this is even possible.

I also tried to split the integral in two parts (near $\pi/2$ and far away from it), but the same problem of uniformity occured. In a word, I needed to choose a small $\epsilon>0$ such that $\cos(R\cos\epsilon)$ would be bounded away from 0, uniformly in $R=k\pi$. However this can't be.

My guess is that, because of what happens at the neighbourhood of the imaginary axis (when $\theta\simeq\pi/2$), the semi-circle integral (with radius $R=k\pi$, $k\in\mathbb{N}$) does not converge when $k\to\infty$. Hence the problem with this computation.

7. Random Variable, so the idea is actually to deform the contour so that it's not closed any more, and then let R to infty, so that the residue thm. still holds, but for the initial closed contour?

chisigma, I suppose the residue, gained using the product will still be the same, since:

$\Pi_k(1+i\frac{2z}{(2k+1)\pi})(1-i\frac{2z}{(2k+1)\pi})=\Pi_k\frac{2i}{(2k+1)\pi}(z-\frac{2k+1}{2}\pi i)(1-i\frac{2z}{(2k+1)\pi})$

$\lim_{z\rightarrow\frac{2k+1}{2}\pi i}\frac{z-\frac{2k+1}{2}\pi i}{\Pi...}=\lim_{z\rightarrow\frac{2k+1}{2}\pi i}\frac{z-\frac{2k+1}{2}\pi i}{\Pi_k\frac{2i}{(2k+1)\pi}(z-\frac{2k+1}{2}\pi i)(1-i\frac{2z}{(2k+1)\pi})}=$ $\frac{1}{\Pi_k\frac{2i}{(2k+1)\pi}(1-i\frac{2\frac{2k+1}{2}\pi i}{(2k+1)\pi})}=\frac{1}{\frac{4i}{\pi}\Pi_k\frac{ 1}{2k+1}}$

the last result is I guess (but I'm not sure) the product expansion of $\frac{1}{\sinh\frac{2k+1}{2}\pi i}$

8. Laurent, thanks a lot, I think I got it.

So in the end it turns out the problem lies (besides my lack of estimation expressions) in the definition of the contour. The contour, Random Variable suggested, seems to be the right choice. Does anyone of you know, how to choose the right contour? I mean, are there any clues on where it should be the semicircle or the rectangle (when dealing with integral limits from -infty to +infty). I have also seen integrations over parallelograms or sectors? Are there any rules at all?

As to the point I made about residue sum turning into residue series, does it make sence? I've never seen such thing in books, and here it's clear it's not always a pretty thing to deal with. What do you think about it?