Hi I find my notes for how to calculate complex integrals woefully inadequate, and I'm hoping someone can explain to me how to do them. One that the notes particularly fail for is: 'Integrate z/(a-exp(-iz)) along the rectangle with vertices at pi, -pi, pi+iR, -pi+iR Hence integrate xsinx/(1-2acos(x) +a^2) dx from 0 to infinity, for 0<a<1' 1)Epic fail because it doesn't tell me what a is in the first one. If |a|=/=1, then surely the integral of the first one would be zero because there are no poles? 2) You can sort of get the second integral from the first by taking the imaginary part of it - assuming that |z|=1. Which makes it clear that my first point is wrong. So, how do I do the first integral? Why that particular contour? What do I take a to be? Why? How does this relate at all to the second integral? How do I do any of this? Sorry about the lack of LATEX knowhow, and thanks for any help.