Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How to evaluate these integrals by hand

I am trying to evaluate the following: $$\int_{-\infty}^\infty \frac{\cos x}{e^x+e^{-x}}\, dx$$ using the residue theorem but I could not do it. Any help will be much appreciated.

share|cite|improve this question

marked as duplicate by joriki, Raymond Manzoni, Henry T. Horton, Matthew Pressland, Andrew Dec 13 '12 at 16:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

This was done here. – Raymond Manzoni Dec 13 '12 at 14:51
Hint, integral it in the rectangle $\{x+iy| -R\leq x\leq R, 0\leq y\leq a\}$, a is just a fixed number. – ougao Dec 13 '12 at 14:51
In the first comment the height of rectangle $a=2\pi$ was chosen but $a=\pi$ should be faster (requiring only one zero). – Raymond Manzoni Dec 13 '12 at 15:06
@Raymond: Why didn't you vote to close as duplicate? – joriki Dec 13 '12 at 15:06
@Joriki: Yes I'll follow you on that. But I must admit that other people may enjoy to think about this... Ok this one is often asked but here is an example of thread that I liked thinking about before looking at the other (somewthat incomplete) answers... – Raymond Manzoni Dec 13 '12 at 15:09
up vote 0 down vote accepted

Let us put


We can see the poles of the function are $$2z_k=\pi i(1+2k)\Longleftrightarrow z_k=\frac{\pi i}{2}(1+2k)\,\,,\,\,k\in\Bbb Z$$

We're going to take the contour

$$C_R:=[-R,R]\cup\gamma_R:=\{z=Re^{it}\;;\;0\leq t\leq \pi\}\,\,,\,R\in\Bbb R^+$$

and since the poles are simple and taking into account that $\,\displaystyle{e^{\pm z_k}=(-1)^k\,(\pm i)}\,$:

$$Res_{z=z_k}(F)=\lim_{z\to z_k}(z-z_k)f(z)\stackrel{\text{L'Hospital}}=\lim_{z\to z_k}\frac{e^{iz}}{e^z-e^{-z}}=\frac{e^{-\frac{\pi(1+2k)}{2}}}{e^{z_k}-e^{-z_k}}=\frac{e^{-\frac{\pi(1+2k)}{2}}}{2i(-1)^k}$$

Since when $\,R\to\infty\,$ we're going to contain all the poles with positive imaginary part within $\,C_r\,$ (taking care the contour never touches one of the poles), we get

$$\sum_{Res(f)}=\frac{e^{-\pi/2}}{2i}\sum_{k=0}^\infty \left(-e^{-\pi}\right)^k=\frac{e^{-\pi/2}}{2i}\cdot\frac{1}{1+e^{-\pi}}=(-i)\frac{1}{4\cosh \pi/2}$$

so that

$$\oint_{C_R}f(z)\,dz=2\pi i\left(\sum_{Res(f)}\right)=\frac{\pi}{2\cosh\frac{\pi}{2}}$$

Finally, just check



$$\int_{\gamma_R}f(z)\,dz\xrightarrow [R\to\infty]{} 0$$

by Jordan's Lemma , since

$$z\in\gamma_R\Longrightarrow \max_{z\in\gamma_R}\left|\frac{e^{z}}{z^{2z}+1}\right|\leq\max_{z\in\gamma_R}\left|\frac{e^{Re^{it}}}{e^{2Re^{it}}+1}\right|\xrightarrow [R\to\infty]{}0$$

share|cite|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.