I am trying to evaluate the value of $$\int_0^\infty\frac{\cos(x) - e^{-x}}{x}dx$$. I am assuming I am supposed to use contour integration, as I was required just before to calculate the value of $$\int_0^\infty\frac{\sin(x)}{x}dx$$ using contour integration over a semicircle in the upper half complex plane.
I may be able to use contour integration directly again in order to calculate this new value, but I prefer using the value I already found for sin to get the new value, if possible.
I have tried differentiating the old term and exchanging the order of intgeration and differentiation (guided by the fact that $(sinx)' = cosx$), but got an expression I cannot simplify to the form above.
We know $$\int_{0}^{\infty }{\frac{f(x)}{x}}dx=\int_{0}^{\infty }{\mathcal{L}(f(x))}ds$$ then $$\int_{0}^{\infty }{\frac{\cos x-{{e}^{-x}}}{x}}dx=\int_{0}^{+\infty }{\left( \frac{s}{1+{{s}^{2}}}-\frac{1}{s+1} \right)}\,ds=\underset{s\to \infty }{\mathop{\lim }}\,\ln \left(\frac{\sqrt{s^2+1}}{s+1} \right)=0$$