I’ve tried many approaches to try and solve the following integral (replacing $\cos(x)$ with $e^{ix}$, applying Feynman’s trick and much more).
$$I := \int_0^\infty \frac{\cos(x)}{(2x-\pi)(x^2+\pi^2)} dx$$
What’s annoying me the most, is that we were advised to use a semicircle contour on a well-chosen function, but I can’t seem to figure out how to deal with the integral from $-\infty$ to $0$. So what I tried to do was the following.
$$I = \int_0^\infty \frac{\cos(x)(2x+\pi)}{(4x^2-\pi^2)(x^2+\pi^2)} dx$$
Now we essentially have two integrals to solve, one for each term in the numerator. The next idea I had was to integrate the integrandum without factor $x$ (slightly altered though), and use Feynman’s trick to get the second integral (taking the derivative and using it to introduce the factor $x$). I couldn’t make this idea work though. Any help is appreciated.
I’ve also looked all over this site in search of similar integrals, but wasn’t able to come up with anything similar enough. I’d also strongly prefer a solution using contour integration, specifically using a semicircle (definitely no keyholes).
An edit has been made fixing the denominator.
The problem is with the lower bound equal to $0$.
You can easily compute the antiderivative writing
$${(2 x-\pi ) \left(x^2+\pi ^2\right)}=(2x-\pi)(x+i \pi)(x-i\pi)$$ and use partial fraction decomposition to obtain $$\frac 1{(2 x-\pi ) \left(x^2+\pi ^2\right)}=$$ $$\frac{4}{5 \pi ^2 (2 x-\pi )}-\frac{\frac{1}{5}+\frac{i}{10}}{\pi ^2 (x+i \pi )}-\frac{\frac{1}{5}-\frac{i}{10}}{\pi ^2 (x-i \pi )}$$ So, three integrals $$J(k)=\int \frac{\cos(x)}{x-k}\, dx$$ Let $x=t+k$ expand the cosine $$J(k)=\cos (k)\, \text{Ci}(x-k)-\sin (k)\, \text{Si}(x-k)$$
Edit
$$I = \int_\pi^\infty \frac{\cos(x)}{(2x-\pi)(x^2+\pi^2)}\, dx$$ $$I= \left(\frac{2\, \text{Si}\left(\frac{\pi }{2}\right)}{5 \pi ^2}+\frac{\sinh (\pi )}{10 \pi }-\frac{1}{5 \pi }-\frac{(1+2 i) \cosh (\pi )}{10\pi }\right)+\frac A{10\pi^2}$$ where $$A=((2-i) \text{Ci}((-1+i) \pi )+(2+i) \text{Ci}((1+i) \pi )) \cosh(\pi )+$$ $$((1+2 i) \text{Si}((-1+i) \pi )-(1-2 i) \text{Si}((1+i) \pi )) \sinh (\pi )$$
Have a look at this paper for the evaluation of the sine and cosine integrals of complex arguments.