<s>[INST] 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.
 [/INST] 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$.
</s>