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. 

$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}
$$
