Recently I was solving some problems on Fourier transform and in one of the problems I encountered the following integral:$$\int_0^{\infty}\cos x\,dx.$$ Surely the integral does not converge and also they are not Riemann integrable, according to me. Then I searched for it online and found out the two results mentioned in title. But the proof was done by Complex analysis. I haven't studied Complex analysis yet so was unable to understand those proofs. But seeing those proofs I got an idea to evaluate the integrals as follows:$$\int_0^{\infty}e^{-ix}\,dx=\frac1{-i}\Big[e^{-ix}\Big]_0^{\infty}=-i.$$Thus comparing real and imaginary parts, we have:$\displaystyle\int_0^{\infty}\cos x\,dx=0$ and $\displaystyle\int_0^{\infty}\sin x\, dx=1.$
Is this a proper approach?
[Another approach which I could think of, uses the following property of Laplace Transform:
If $\mathscr{L}\{f(t)\}=\bar f(s).$ Then $$\int_0^{\infty}\bar f(s)\,ds=\int_0^{\infty}\frac{f(t)}t\, dt.$$ Letting $f(t)=t\sin t$ yeilds $\int_0^{\infty}\sin t\,dt=1$ and letting $f(t)=t\cos t$ yeilds $\int_0^{\infty}\cos t\, dt=0.$]