Improper integrals and residues I'm already read Conway, Churchill and Marsden but I'm still with doubts when it comes to improper integrals.
Where come from this relation
$$\lim_{R\rightarrow\infty}\int_{-R}^Rf(x)dx+\int_{C_R}f(z)dz=2\pi i\sum_{k=1}^nRes(f;z_k)$$
it comes from the line integral?
Usually what I see in the book examples, is that they show using a substitution with $R$ that $\int_{C_R}f(z)dz=0$, this integral is always equal to $0$? What's the idea to show that?
 A: I'm guessing this is in a situation where you want to find $$\int_{-\infty}^\infty f(x)\; dx$$ using residues.  The Residue Theorem does not deal with improper integrals such as this, but rather with integrals around closed contours.  So you write 
$$ \int_{-\infty}^\infty f(x)\; dx = \lim_{R \to \infty} \int_{-R}^R f(x)\; dx$$
But you're still not done: you need a closed contour, so you take a curve $C_R$ that goes from $R$ to $-R$; taking the line segment from $-R$ to $R$ and then $C_R$, you have a simple closed positively oriented contour.  The Residue Theorem then says
$$  \int_{-\infty}^\infty f(x)\; dx + \int_{C_R} f(z)\; dz = 2\pi i \sum_k \text{Res}(f; z_k)$$
where $z_k$ are the poles of $f$ inside the contour.  Well, that's fine, except what do you do with the integral over $C_R$?  In order to get anything useful out of this, you'll need to know the limit of $\int_{C_R} f(z)\; dz$ as $R \to \infty$.  In the most common scenario, $C_R$ is going through a region where $f(z)$ is small, so that suitable estimates get you 
$\int_{C_R} f(z)\; dz \to 0$.  This is not always the case, however.
In some situations (taking advantage of some symmetry) you might, for example, have $\int_{C_R} f(z) \; dz \to c \int_{-R}^{R} f(x)\; dx$ for some constant $c$ (other than $-1$ which would be no help), and then you'd be
able to conclude that $$\int_{-\infty}^\infty f(x)\; dx = \dfrac{2\pi i}{1+c}
 \sum_k \text{Res}(f; z_k)$$
