$$ \int^{+\infty}_{-\infty} \frac{x\sin 4x}{x^2-4x+8}dx \, $$
My Thoughts:
I know that I should start by changing the integral to:
$$ \int^{+\infty}_{-\infty} \frac{x(\frac{e^{4ix}-e^{-4ix}}{2i})4x}{x^2-4x+8}dx \, $$ and from there I should change them to the complex form using the definition $z=e^{ix}$.
I've been continuing to work through this problem but I get all mixed up when it comes time to manipulate the expression inside the integral so that I can find the singularities and residue and apply the formulas.
Should I split it up into three separate integrals?
I would like to see a worked out solution to this problem.
We want the $$\text{Imag}\left(\int_{-\infty}^{\infty} \dfrac{x\exp(4ix)dx}{x^2-4x+8}\right)$$ Consider the contour integral $$f(R) = \int_{[-R,R]\cup \Gamma_R} \dfrac{z\exp(4iz)dz}{z^2-4z+8} = \int_{-R}^R \dfrac{z\exp(4iz)dz}{z^2-4z+8} + \int_{\Gamma_R} \dfrac{z\exp(4iz)dz}{z^2-4z+8}$$ where $\Gamma_R$ is a semi-circle of radius $R$ on the upper half plane. Since the integrand encloses the pole $z=2+2i$, which is inside $[-R,R]\cup \Gamma_R$, we have $$f(R) = 2\pi i \cdot \dfrac{(2+2i)\exp(4i(2+2i))}{(2+2i-2+2i)} = \pi(1+i)\exp(-8+8i)$$ Hence, $$\lim_{R \to \infty} \left(\int_{-R}^R \dfrac{z\exp(4iz)dz}{z^2-4z+8} + \int_{\Gamma_R} \dfrac{z\exp(4iz)dz}{z^2-4z+8} \right) = \pi(1+i)\exp(-8+8i)$$ which gives us $$\int_{-\infty}^{\infty} \dfrac{z\exp(4iz)dz}{z^2-4z+8} + \lim_{R \to \infty} \int_{\Gamma_R} \dfrac{z\exp(4iz)dz}{z^2-4z+8} = \pi(1+i)\exp(-8+8i)$$ Further, we have $$\left \vert \lim_{R \to \infty} \int_{\Gamma_R} \dfrac{z\exp(4iz)dz}{z^2-4z+8}\right \vert \leq \lim_{R \to \infty} \pi \left \vert \dfrac{f(R^2)}{g(R^2)} \int_0^{\pi}\exp\left(-4R \sin(t)\right)dt\right \vert = 0$$ Hence, we obtain that $$\int_{-\infty}^{\infty} \dfrac{z\exp(4iz)dz}{z^2-4z+8} = \pi(1+i)\exp(-8+8i) = \dfrac{\pi}{e^8} (1+i)\exp(8i)$$ Taking the imaginary part we obtain $$\text{Imag}\left(\dfrac{\pi}{e^8} (1+i)\exp(8i) \right) = \dfrac{\pi(\cos(8)+\sin(8))}{e^8}$$