# Problem in finding residue of a complex function

In the process of finding a solution to a mechanical problem I arrived at a contour integral. Then I had to use the residue theorem to solve the integral. Finally I got an integral with the following format:

$$\oint_C f(z)\,\mathrm dz$$ $$f(z)=\frac{e^{(Az^N+Bz^{-N})}}{z-a},\qquad A,B\in \mathbb R,N\in \mathbb Z$$

where $a$ is a constant and can be in/or out of the closed contour $C$. My problem is that how I should obtain the residue in both cases (when $a$ is in and out of the contour). Can I use the Laurent expansion? How should I treat the singularity at $z=0$? Thanks for hints in advance.

-
The singularity at $z=0$ is all you need to worry about; the residue at $z=a$ is trivially $\exp(Aa^N+Ba^{-N})$, and you'll either include it in using the Residue Theorem or you won't depending on whether or not it's inside the contour. – anon Jul 14 '11 at 9:56
This question is directly related to math.stackexchange.com/questions/50343/…. Please link to previous questions when you ask a question that's so closely related, so that people don't start thinking from scratch unnecessarily. – joriki Jul 14 '11 at 10:10
@anon Thank you for your hepful response. As you mentioned, the singularity at $z=0$ is what still makes me confused. – Benyamin Gholami Jul 14 '11 at 14:23
@joriki Thanks for editing the question. I thought it would be better to post the new problem as a new question. I'll post questions according to your advice. – Benyamin Gholami Jul 14 '11 at 14:26