How to chose the rectangle to solve $\int_{{ -\infty}}^{{\infty} } \frac{\mathrm{cos(x)}}{e^{x}+e^{-x}} dx$ with residues?

66 Views Asked by At

How to chose the rectangle to solve $\int_{{\textstyle\ -\infty}}^{{\textstyle\infty} } \frac{\mathrm{cos(x)}}{e^{x}+e^{-x}} dx$ with residues?

I tried 2 options:

  • Option 1: Rectangle lies on the x-axes
  • Option 2: x-axes is in the rectangle

What is the correct option, and why it is? I become two different answers... It's logic, because I used a different parameterization...

See pictures:

enter image description here

enter image description here

enter image description here

enter image description here