(1)
I want to compute $\int_{-\infty}^{+\infty}\frac{\cos x}{x^2+a^2}=\frac{\pi}{a}e^{-a}, a>0$
I started with partial integration, which gives me $$\int_{-\infty}^{+\infty}\frac{\cos x}{x^2+a^2}=\frac{\sin x}{x^2+a^2} |_{-\infty}^{\infty}+\int_{-\infty}^{\infty}\frac{2x\sin x}{(x^2+a^2)^2}dx, $$
My idea was it might has something to do with $\int_0^\infty\frac{\sin x}{x}=\pi/2$ but I do not see any relation, may you can help me with that
(2) $\int_{-\infty}^{+\infty} \frac{x-\sin x}{x^3}dx=\pi/2$ I started by deforming the contour to avoid the origin and split the sin into exponentials: $\frac{x-\sin x}{x^3}=\frac{1}{x^2}+\frac{ie^{ix}}{2x^3}-\frac{ie^{-ix}}{2x^3}$, the residues of the three terms are 0,-1/4,-1/4, but this gives me the result $0$, something must be wrong here?