Use contour integration to evaluate : $\int ^{\infty }_{0}\dfrac {1}{\left( x^{2}+4\right)\left( x^{2}+2\right) }dx$
Looking at the options we could use the residue theorem or we could use Cauchys Integral Formula. Where we could define $f\left( x\right) =\dfrac {1}{x^{2}+4}$ 
 A: HINT:
Use partial fraction expansion and write
$$\frac{1}{(x^2+4)(x^2+2)}=\frac{1/2}{x^2+2}-\frac{1/2}{x^2+4}$$
along with 
$$\int \frac{1}{x^2+a^2}\,dx=\frac{1}{a}\arctan(x/a)+C$$
A: Define
$$f(z)=\frac1{(z^2+4)(z^2+2)}=\frac1{(z+2i)(z-2i)(z+\sqrt2\,i)(z-\sqrt2\,i)}$$
Take the contour
$$C_R:=[-R,R]\cup\gamma_R\;,\;\;\text{with}\;\;\gamma_R:=\{z=Re^{it}\;:\;0\le t\le \pi\}\;,\;\;R\in\Bbb R_+$$
In the domain enclosed by $\;lC_R\;$ we only have two simple poles:
$$\text{Res}_{z=2i}(f)=\lim_{z\to2i}(z-2i)f(z)=\frac1{4i(-2)}=\frac i8$$
$$\text{Res}_{z=\sqrt2i}(f)=\lim_{z\to\sqrt2i}(z-\sqrt2\,i)f(z)=\frac1{2\cdot2\sqrt2\,i}=-\frac i{4\sqrt2}$$
so by the residue theorem
$$\oint_{C_R}f(z)\,dz=2\pi i\left(\frac i8-\frac i{4\sqrt2}\right)=-\frac\pi4+\frac\pi{2\sqrt2}=\frac\pi2\left(\frac{\sqrt2-1}2\right)$$
Now pass to the limit when $\;R\to\infty\;$ and use Jordan's lemma and the fact that the integrand is an even function:
$$\frac\pi2\left(\frac{\sqrt2-1}2\right)=\lim_{R\to\infty}\oint_{C_R}f(z)dz=\int_{-\infty}^\infty\frac{dx}{(z^2+4)(x^2+2)}$$
A: By contour integration, for any $\alpha>0$ we have $\int_{0}^{+\infty}\frac{dx}{x^2+\alpha}=\frac{\pi}{2\sqrt{\alpha}}$, hence:
$$\int_{0}^{+\infty}\frac{dx}{(x^2+2)(x^2+4)}=\frac{1}{2}\left(\int_{0}^{+\infty}\frac{dx}{x^2+2}-\int_{0}^{+\infty}\frac{dx}{x^2+4}\right)=\color{red}{\frac{\pi}{8}(\sqrt{2}-1)}.$$
