I am trying to solve the below problem using residues,
$$\int_0^\infty\frac{x^3\sin(x)}{(x^2+4)(x^2+16)}dx$$
This is what I have so far:
Firstly, Change the equation to $z$ as follows
$$f(z)=\frac{z^3}{(z^2+4)(z^2+16)}dz$$
Then, Identify the singularities in the upper half plane - these being $2i$ and $4i$ where $R>4$.
This brings us to the 2 equations:
$$\operatorname*{Res}_{z=2i} [f(z)e^{iz}]=\frac{z^3e^{iz}}{(z+2i)(z^2+16)}\biggr]_{z=2i}$$
and
$$\operatorname*{Res}_{z=4i} [f(z)e^{iz}]=\frac{z^3e^{iz}}{(z^2+4)(z+4i)}\biggr]_{z=4i}$$
Now when I try to solve each of these equations I am going wrong somewhere and ending up with some ridiculous answer... any help with this would be greatly appreciated!
Since you seem to have trouble with calculating the residue part, here's a brief outline on how they're calculated. Obviously, you need to consider when $z=2i$ and when $z=4i$ because they lie inside the contour.
Therefore$$\operatorname*{Res}_{z\, =\, 2i}\frac {z^3e^{iz}}{(z^2+4)(z^2+16)}=\lim\limits_{z\,\to\, 2i}\frac {z^3e^{iz}}{(z+2i)(z^2+16)}=-\frac 1{6e^2}$$$$\operatorname*{Res}_{z\, =\, 4i}\frac {z^3e^{iz}}{(z^2+4)(z^2+16)}=\lim\limits_{z\,\to\,4i}\frac {z^3e^{iz}}{(z^2+4)(z+4i)}=\frac 2{3e^4}$$The contour integral then evaluates to$$\oint\limits_{\mathrm C}dz\,\frac {z^3e^{iz}}{(z^2+4)(z^2+16)}=2\pi i\left(\frac 2{3e^4}-\frac 1{6e^2}\right)=\frac {\pi i(4-e^2)}{3e^4}$$