When to use upper and lower half-circle when evaluating improper integrals (Residue Intergration)

206 Views Asked by At

Im working on evaluating integrals of the form

$\int_{-\infty}^{\infty} f(x)dx$.

Im using the technique where i am looking at the corresponding complex function, $f(z)$, and integrating $f(z)$ over a contour formed as a semi-circle. Then i use the fact that the intergral is zero over the semi-cirlce to say that my improper integral is equal to the residues of $f(z)$ in my semi-cricle.

My question is simply, when should I use a semi-circle in the lower half-plane, and when should I use a semi-circle in the upper half plane to decide wich poles i should calculate the Residue of?