Finding the asymptotic of an integral I came across the following exercise on asymptotic behavior of integrals:
$$I(a) = \int_0^\infty\frac{\cos x}{x^a} \, dx, \text{ where } a\to0^+.$$
I have tried integrating by parts or replacing $\cos x$ with the first summands of its Taylor series, but I end up with something equal to infinity (independent of $a$ and that is not what we want). 
I just thought about the substitution $x \leftrightarrow\frac{1}{1+x^2}$ and I get the  following result: 
$$I(a) = \frac{\cos(1/2)}{2^{2-a}} + \int_0^1\frac{2x^3 \cos\left(\frac{1}{1+x^2}\right)}{(1+x^2)^{3-a}} \, dx - \int_0^1 \frac{2x^3\sin\left(\frac{1}{1+x^2}\right)}{(1+x^2)^{2-2a}}\,dx$$
If I could prove that the last summands are $o(I(a))$ then it would be OK, but I think, in general my strategy won't work.
Apparently this is supposed to be an easy exercise, but I can't come up with anything right now.
 A: Integration by parts is a good idea (as it usually is when one factor of the integrand is oscillating): when $0<a<1$,
$$
I(a) = \int_0^\infty \frac{\cos x}{x^a} \,dx = \frac{\sin x}{x^a}\bigg|_0^\infty - \int_0^\infty \frac{-a\sin x}{x^{1+a}} \,dx = a \int_0^\infty \frac{\sin x}{x^{1+a}} \,dx.
$$
This is enough to prove convergence, but not yet enough to get an upper bound that goes to $0$ with $a$. However, let's integrate by parts again!—being careful to choose an antiderivative that still allows us to control functions' behavior at the lower endpoint $0$.
\begin{align*}
I(a) = a \int_0^\infty \frac{\sin x}{x^{1+a}} \,dx &= a\frac{1-\cos x}{x^{1+a}}\bigg|_0^\infty - a \int_0^\infty -(1+a)\frac{1-\cos x}{x^{2+a}}\,dx \\
&= a(1+a) \int_0^\infty \frac{1-\cos x}{x^{2+a}}\,dx.
\end{align*}
This new integrand is nonnegative (showing $I(a)\ge0$) and
\begin{align*}
I(a) &= a(1+a) \int_0^\infty \frac{1-\cos x}{x^{2+a}}\,dx \\
&= a(1+a) \int_0^1 \frac{1-\cos x}{x^{2+a}}\,dx + a(1+a) \int_1^\infty \frac{1-\cos x}{x^{2+a}}\,dx \\
&\le a(1+a) \int_0^1 \frac{x^2/2}{x^{2+a}}\,dx + a(1+a) \int_1^\infty \frac{1}{x^{2+a}}\,dx \\
&= \frac{a(1+a)}{2(1-a)} + 2a = a \cdot\frac{5-3a}{2(1-a)};
\end{align*}
since that last factor is continuous at $a=0$,
these inequalities are enough to show that $\lim_{a\to0+} I(a) = 0$.
A: If you consider that
$$I=\int\frac{\cos(x)}{x^a}\,dx=\Re\left(\int\frac{e^{ix}}{x^a}\,dx\right)$$ we have 
$$I=\Re \Big[-(-i x)^{a-1} x^{1-a} \Gamma (1-a,-i x)\Big]$$ which makes that
$$J=\int_0^\infty\frac{\cos(x)}{x^a}\,dx=\sin \left(\frac{\pi  a}{2}\right)\, \Gamma (1-a)\qquad \text{if} \qquad 0<\Re(a)<1$$
Developed as series around $a=0$, this would give as asymptotics
$$\frac{\pi  }{2}a+\frac{\gamma  \pi}{2}   a^2+O\left(a^3\right)$$ Using it for $a=\frac 1 {12}$ the exact value is $\sin \left(\frac{\pi }{24}\right) \Gamma \left(\frac{11}{12}\right)\approx 0.137776$ while the above truncated series gives $\frac{12+\gamma}{288}  \pi\approx 0.137196$.
Edit
If you want a good approximation of the function over the whole range, you could use the Padé approximant
$$\sin \left(\frac{\pi  a}{2}\right)\, \Gamma (1-a)\sim\frac \pi 2\, a\, \frac{1+\alpha \,a } {1+\beta \,a }$$
$$\alpha=\frac{\gamma }{2}-\frac{\pi ^2}{24 \gamma }\qquad \beta= -\frac{\gamma }{2}-\frac{\pi ^2}{24 \gamma }$$ which is equivalent to an $O(a^4)$ expansion.
For $a=\frac 1 {12}$, this would give $0.137769$
