How to compute the following real integrals using the residue theorem:
$$\int_{-\infty}^{\infty} \frac{1}{(x^2+p^2)(x^2+q^2)} dx$$ $$\int_{0}^{2\pi} \frac{sin^2(\theta)}{5+4cos(\theta)} d\theta$$
Where for the first integral we have $p>q>0$. I was fine with calculating complex integrals using the residue theorem, however I am having trouble with these real integrals. As I understand it, for the second problem I can express $cos(\theta)$ as $$\cos\theta=\frac{1}{2}\left(e^{i\theta}+e^{-i\theta}\right)$$ However I do not see why this helps in the computation if I was to substitute this in.
As for the first problem I am unsure how to tackle the problem.
Thanks for any help