Applications of Residue Theorem

Bonjour,

I'm just learning how to apply the residue theorem and manipulating functions to solve integrals that one previously couldn't solve. Some examples I have come across are:

a)Suppose a, b > 0 and a is not equal to b

$\displaystyle \int_{0 }^{\infty} \frac{1}{(x^2 + a^2)(x^2 + b^2)} dx$

b) $\displaystyle \int_{-\infty}^{\infty} \frac{1}{(x^2 + x + 1)^2}dx$

c) Suppose a > 0. $\displaystyle \int_{-\infty}^{\infty} \frac{cosx}{x^2 + a^2}dx$

I am mainly having trouble with the manipulations. I've tried to understand it through using the textbook and attempting the problems above but I end up with integrals I can't solve. The answers for each question respectively are:

a) $\displaystyle \frac{\pi}{2ab(a+b)}$

b) $\displaystyle \frac{4\pi }{3\sqrt{3}}$

c) $\displaystyle \frac{\pi e^{-a}}{a}$

I appreciate all your help in understanding this tough concept. Thanks!

ComplexXavier