Application to real integration

Exercise5.3
1. Find the residue at the singularity of the following function (m is positive real number).

(a)
$\int_{-\infty}^{\infty}\frac{1}{x^2 + x +1} dx$
(b)
$\int_{0}^{\infty}\frac{1}{(x^2 +1)(x^2 + 4)} dx$
(c)
$\int_{0}^{2\pi}\frac{1}{2 + \sin{\theta}} d\theta$
(d)
$\int_{0}^{2\pi}\frac{1}{(2 + \sin{\theta})^{2}} d\theta$
(e)
$\int_{0}^{\infty}\frac{\cos{x}}{(x^2 + 1)^{2}} dx$
(f)
$\int_{0}^{\infty}\frac{x\sin{mx}}{x^2 + 1} dx$
(g)
$\int_{0}^{\infty}\frac{\sin{x}}{x(x^2 + 1)^{2}} dx$
(h)
$\int_{0}^{\infty}\frac{1- \cos{mx}}{x^2} dx$
2. Find the following integral using complex integration (a is positive constant)
(a)
$\int_{0}^{\infty}\frac{\log_{e}{x}}{x^2 + a^2} dx  [\int_{c}\frac{\log{z}}{z^2 + a^2} dz,$   C is fig19.5
(b)
$\int_{0}^{\infty}\frac{(\log_{e}{x})^2}{(x + a)^{3}} dx  [\int_{c}\frac{(\log{z})^{3}}{(z + a)^{2}} dz,$   C is fig19.7