Residue Theorem to Compute Integrals of Rational Functions Any help would be very much appreciated. Thanks. 
$$\int_{-\infty}^{\infty}\frac{x^2}{x^4-4x^2+5}dx$$
Integral for the above using Residue Theorem. 
 A: Check the singularities of the function, in this case check the roots of the denominator. Consider only the ones that has imaginary part strictly greater then 0. If there are some real roots, you have to apply Jordan's Lemma, on the "deviation" you have to do with your path to avoid them. This is due to the fact that you are defining a particular closed path to trying apply residue theorem (there is a lot of details to fix here, just read any books on complex analysys)
Then verify that $f(z) := \frac{z^2}{z^4-4z^2+5} $ satisfy $|f(z)| \leq \frac{K}{|z|^{1+a}}$ for some,$a >0$. If all the hypothesis are satisfied apply Jordan Lemma (if needed) and,the residue theorem to compute the integral. 
the hypothesis on the module assure you that once defined a let's say square of side $m$ when $m \rightarrow \infty $ only the integral on the real axys (which is what are you trying to compute) is giving contribute to the result.
NB to calculate zeroes of the denominator just make a substitution $t=x^2$ and solve as always. Then you have to figure out the order of the poles you find, maybe using the criteria of the limit
Please note that this is only a hint of,how to do a integral of this kind using complex analysis technique.
A: $x^4-4x^2+5=x^4-4x^2+4+1=(x^2-2)^2+1$, and this is $0$ when $(x^2-2)^2=-1$, i.e. $x^2=2\pm i$. We will have four disctint roots, two in the upper half and two in the lower half of the complex plane.
Say, $2+i$ has angle $\alpha$ ($\arg(2+i)=:\alpha$, so it has $\tan\alpha=1/2$), then the first solution, $z_1$ will have angle $\alpha/2$, $z_2=-z_1$ has angle $\arg(z_2)=\alpha/2+\pi$ and $\arg(z_3)=-\alpha/2$ and $\arg(z_4)=\pi-\alpha/2$, so ${\rm Im}( z_4)>0$, $\ {z_1}^2={z_2}^2=2+i$ and ${z_3}^2={z_4}^2=2-i$. All $z_j$'s have length $\sqrt[4]5$.
Since the denominator has four distinct roots, it will have a simple pole at each $z_i$, that is, the integrand can be written as
$$\frac{x^2\,/\,(x-z_2)(x-z_3)(x-z_4)}{(x-z_1)}$$
where the nominator is regular around $z_1$. Its residue at $z_1$ can be obtained by simply substituting $x=z_1$ to the nominator.
And finally, the approach (I should have started here): consider semicircles $C_R$ in the upper half plane over the segment $[-R,\,R]$ on the real line for large $R$'s. We are about to calculate $\int_{-R}^R f(x)dx+\int_{C_R}f(z)dz$ using the residue theorem: also calculate the residue at $z_4$, then add them and multiply by $2\pi i$.
One thing is left: to show that $\int_{C_R}f(z)dz\,\to 0$ as $R\to\infty$. For this, observe that $f(x)\approx \displaystyle\frac1{x^2}$, so that we can write
$$\left|\int_{C_R}f(z)\,dz\right|\le c\cdot\int_{C_R}\frac1{R^2}=c\cdot\frac1{R^2}\cdot R\pi$$
which indeed tends to $0$ if $R\to\infty$.
