Computing the complex integral? I am dealing with the following:
$$\int_{0}^{\infty}\frac{x\sin(x)}{(x^2+a^2)(x^2+b^2)}dx$$
Furthermore, I know $a,b>0$ and I know $a\neq b$. I believe this is using Jordan's Lemma? I see that the singularities in the upper half of the plane are $ai$ and $bi$ where $R>a$. I'm stuck writing out my function of z. I think it should be: $$f(z)=\frac{1}{(z^2+a^2)(z^2+b^2)}.$$
But I do not know how exactly the $x\sin(x)$ numerator comes back into play. 
 A: $x\sin(x)$ is an even function, so your integral is equal to
$$
\int_0^\infty\frac{x\sin(x)}{(x^2+a^2)(x^2+b^2)}\,\mathrm{d}x
=\frac12\int_{-\infty}^\infty\frac{x\sin(x)}{(x^2+a^2)(x^2+b^2)}\,\mathrm{d}x
\tag{1}
$$
We can break up $\sin(z)=\frac{e^{iz}-e^{-iz}}{2i}$ and compute
$$
\begin{align}
\frac12\int_{-\infty}^{\infty}\frac{z\sin(z)}{(z^2+a^2)(z^2+b^2)}\,\mathrm{d}x
&=\frac1{4i}\int_{\gamma^+}\frac{ze^{iz}}{(z^2+a^2)(z^2+b^2)}\,\mathrm{d}z\tag{2}\\
&-\frac1{4i}\int_{\gamma^-}\frac{ze^{-iz}}{(z^2+a^2)(z^2+b^2)}\,\mathrm{d}x\tag{3}
\end{align}
$$
where
$$
\gamma^\pm=[-R,R]\cup Re^{\pm i[0,\pi]}\tag{4}
$$
as $R\to\infty$, since the integrals along $Re^{\pm i[0,\pi]}$ vanishes.
Now, we can use
$$
\frac1{z^2+a^2}=\frac1{2ia}\left(\frac1{z-ia}-\frac1{z+ia}\right)\tag{5}
$$
To get that the sum of residues inside $\gamma^+$ is
$$
\overbrace{\frac1{2ia}\frac{ia\,e^{-a}}{b^2-a^2}}^{\large\text{at $z=ia$}}\overbrace{+\frac1{2ib}\frac{ib\,e^{-b}}{a^2-b^2}}^{\large\text{at $z=ib$}}\tag{6}
$$
and the sum of residues inside $\gamma^-$ is
$$
\overbrace{-\frac1{2ia}\frac{-ia\,e^{-a}}{b^2-a^2}}^{\large\text{at $z=-ia$}}\overbrace{-\frac1{2ib}\frac{-ib\,e^{-b}}{a^2-b^2}}^{\large\text{at $z=-ib$}}\tag{7}
$$
Combining $(2)$ with $(6)$ and $(3)$ with $(7)$, remembering $(1)$ and the direction of the contours, we get
$$
\begin{align}
\int_0^\infty\frac{x\sin(x)}{(x^2+a^2)(x^2+b^2)}\,\mathrm{d}x
&=\frac{2\pi i}{4i}\left(\frac{e^{-a}}{b^2-a^2}+\frac{e^{-b}}{a^2-b^2}\right)\\
&=\frac\pi2\frac{e^{-a}-e^{-b}}{b^2-a^2}\tag{8}
\end{align}
$$
A: Your integral is the imaginary part of 
$$\int_{-\infty}^\infty f(x)e^{ix}\, dx,$$
where
$$f(z) = \frac{z}{2(z^2 + a^2)(z^2 + b^2)}.$$
Show that if $R > \max\{a,b\}$, then for all $z$ in the semicircular arc $\{Re^{i\theta}: 0 \le \theta \le \pi\}$,
$$|f(z)| \le \frac{R}{2(R^2 - a^2)(R^2 - b^2)}$$
This implies $\lim_{R\to \infty} \max_{\theta \in [0,\pi]} |f(Re^{i\theta})| = 0$. Hence, by Jordan's lemma,  
$$\int_{-\infty}^\infty f(x)e^{ix}\, dx = 2\pi i(\operatorname{Res}_{z = ai} f(z)e^{iz} + \operatorname{Res}_{z = bi} f(z)e^{iz}).$$
Once you compute the right-hand side, take the imaginary part to get the result.
