Show that this function is RIemann Integrable this is what should be a basic integral problem, yet its been days and I havent solved it
The said integral is :
$\int_{0}^{\infty} \frac{1-cosx}{x^a}dx$
My goal is to figure out the values of a for which this integral converges (both for Riemann and Lesbegue, but Im still stuck at the Riemann part for now and Im hoping that I can use that to get the result for lesbegue since we're dealing with a continuous positive function).
We get one problem in 0 and one in $+\infty$, the 0 problem is easy to solve with Riemann's criteria but I cant seem to figure it out for $+\infty$.
Obviously we can majore it with $\frac{1}{x^a}$ and since our function is positive we know it is integrable if $a<1$, but we dont know for sure that if $a$ becomes greater than one the integral diverges.
This turned out harder than I thought, any help would be appreciated, the problem here is that Im not able to figure out all the values of a for which the integral diverges/converges.
Thanks in advance
 A: On $[0,2\pi],\ \cos x\le 1/\sqrt 2$ for $\pi/4\le x\le 7\pi/4$.
First suppose $a=1.$ Then, by periodicity,
$\int_{\pi/4}^\infty\frac{1-\cos x}{x^a}dx\ge \sum_{k=0}^\infty\int_{\pi/4+2\pi k}^{7\pi/4+2\pi k}\frac{1-\cos x}{x^a}dx\ge (1-\sqrt 2/2) \sum_{k=0}^\infty\int_{\pi/4+2\pi k}^{7\pi/4+2\pi k}\frac{1}{x^a}dx=$
$(1-\sqrt 2/2) \sum_{k=0}^\infty\ln\left|\frac{7\pi/4+2\pi k}{\pi/4+2\pi k}\right|,$ which diverges.
If $a<1,$ we have $\int_{\pi/4}^\infty\frac{1-\cos x}{x^a}dx\ge \frac{1-\sqrt 2/2}{1-a}\sum_{k=0}^\infty[(7\pi/4+2\pi k)^{1-a}-(\pi/4+2\pi k)^{1-a}],$ which also diverges.
We conclude that the integral diverges if $a\le 1$, so henceforth we may assume that $a>1,$ in which case it is easy to see that $\int_{\delta}^\infty\frac{1-\cos x}{x^a}dx$ converges for any $\delta>0$.
Now, expand $\cos$ in a Macaurin series in some neighborhood of $0$:
$\cos x=1-\frac{x^2}{2}+O(x^4).$ It follows that $\int_{0}^\delta\frac{1-\cos x}{x^a}dx=\frac{1}{2}\int_{0}^\delta [x^{2-a}+2O(x^{4-a})]dx,$ which converges if and only if $-1<2-a\Rightarrow a<3.$
It follows that the integral converges if and only if $1<a<3.$
