Evaluating Improper Integral With No Closed-Form Antiderivative

calculusdefinite integralsimproper-integralsintegration

I am trying to evaluate $$\int_{0}^{\infty} \frac{\cos(x)-e^{-x}}{x} dx$$

I did manage to get the correct value of this integral through the use of Frullani's Integral Theorem, which states that $$\int_{0}^{\infty} \frac{f(ax)-f(bx)}{x} dx = (f(\infty)-f(0))\Big(\ln\Big(\frac{a}{b}\Big)\Big)$$

So from here, I substitute $e^{ix}-i\sin(x)$ for $\cos(x)$ to get this into something of the Frullani Integral form. It seems from the response here: Frullani 's theorem in a complex context., that we can extend the Frullani Theorem to a complex setting with a lot of work and on a case-by-case basis. However, I would like to approach this integral in a way that does not involve complex numbers. This integral was originally meant to be evaluated with just "advanced calc"/elementary real analysis methods, so I am looking for such an approach.

Best Answer

You can use feynmans trick to evaluate this. $$I=\int _0^{\infty }\frac{\cos \left(x\right)-e^{-x}}{x}\:dx$$ $$I\left(a\right)=\int _0^{\infty }e^{-ax}\frac{\cos \left(x\right)-e^{-x}}{x}\:dx$$ $$I'\left(a\right)=-\int _0^{\infty }e^{-ax}\left(\cos \left(x\right)-e^{-x}\right)\:dx=-\int _0^{\infty }e^{-ax}\cos \left(x\right)+\int _0^{\infty }\:e^{-x\left(a+1\right)}\:dx$$ $$=-\frac{a}{a^2+1}+\frac{1}{a+1}$$ Now integrating again: $$\int _0^{\infty }I'\left(a\right)\:da=\int _0^{\infty }-\frac{a}{a^2+1}\:da+\int _0^{\infty }\frac{1}{a+1}\:da$$ $$-I=\underbrace{-\frac{1}{2}\ln \left(a^2+1\right)+\ln \left(a+1\right)}_{0}|^{\infty }_0$$ Thus $$I=\int _0^{\infty }\frac{\cos \left(x\right)-e^{-x}}{x}\:dx=0$$

Related Question