TITLE: How can I evaluate this improper integral?
QUESTION [7 upvotes]: I have a problem: evaluate $$\int_{0}^{\infty}\frac{\cos(x)-\cos(2x)}{x}dx\,.$$ I am told this integral is not an elementary one and that's why I am stuck where to start. Thank you for helping me.

REPLY [2 votes]: This is a bit similar to @aliakbar's way but in detailed. Let $f(x)=\cos(x)-\cos(2x)$ and let's evaluate the following integral: $$I(s)=\int_{0}^{\infty}\exp(-sx)\frac{f(x)}{x}~dx$$ We can easily seen that $\lim_{x\to 0^+}\frac{f(x)}{x}=0$ and that: $$\mathcal{L}\{\cos(x)-\cos(2x)\}=\frac{s}{s^2-1}-\frac{s}{s^2+4}$$ Moreover $$\int_0^{\infty}\frac{f(x)}{x}=\int_0^{\infty}F(s)~ds$$ wherein $F(s)=\mathcal{L(f(x))}$. So $I(s)=\mathcal{L\left(\frac{f(x)}{x}\right)}=\int_s^{\infty}\left(\frac{t}{t^2-1}-\frac{t}{t^2+4}\right)dt=...=\frac{1}{2}\ln\left(\frac{s^2+4}{s^2+1}\right)$. Now set $s=0$ in the later integral. It equals to $\ln(2)$.