determine whether an improper integral converges Let $b\in\mathbb{R}$, prove or disprove that the improper integral 
$$ \int_0^\infty x^b \cos(e^x)dx$$
converges.
I used Wolfram Alpha to compute several values of $b$, it seems that for $b\geq 0$ this integral converges and $b<0$ it does not. But I don't know how to prove or disprove it. Any hint would be appreciated.
 A: The oscillatory behavior of the integral is really pesky, so we need some control over this. A well-known trick is to perform integration by parts to facilitate cancellation and thus improve the speed of convergence.
To this end, we first split the integral into two parts: for $a = \log(3/2)$ and $\epsilon < a < R$, we have
$$ \int_{\epsilon}^{R} x^b \cos (e^x) \, dx = \int_{\epsilon}^{a} x^b \cos (e^x) \, dx + \int_{a}^{R} x^b \cos (e^x) \, dx =: I_1(\epsilon) + I_2(R). $$



*

*Integral $I_1(\epsilon)$. We find that $0 < \cos(\tfrac{3}{2}) \leq \cos(e^x) \leq 1$ for $x \in [0, a]$ and hence
$$ \cos(\tfrac{3}{2}) \int_{\epsilon}^{a} x^b \, dx \leq I_1(\epsilon) \leq \int_{\epsilon}^{a} x^b \, dx $$
Taking $\epsilon \downarrow 0$, we find that $I_1(\epsilon)$ converges if and only if $b > -1$.

*Integral $I_2(R)$. Write $x^b \cos(e^x) = (x^b e^{-x}) \cdot (e^x \cos(e^x))$. Then by integration by parts,
$$ I_2(R) = R^b e^{-R} \sin (e^R) - a^b e^{-a} \sin(e^a) + \int_{a}^{R} (x^b - bx^{b-1})e^{-x} \sin (e^x) \, dt. $$
Notice that this converges for any $b$ as $R \to \infty$, since the integrand decays exponentially.

Therefore the improper integral converges if and only if $b > -1$.
A: We may simplify Sangchul Lee's (perfectly fine) approch.
If we substitute $x=\log t$, we get:
$$ I = \int_{1}^{+\infty}\frac{\left(\log t\right)^b}{t}\,\cos(t)\,dt $$
and assuming the integrand function is integrable in a right neighbourhood of $1$, the integral is converging by Dirichlet's test, since $\cos(t)$ has a bounded primitive and $\frac{\left(\log t\right)^b}{t}$ is decreasing to zero from some point on. So we just need to ensure integrability in a right neighbourhood of $1$, where the integrand function is $(t-1)^b (\cos(1)+o(1))$. That means the original integral is convergent iff $\color{red}{b>-1}$.
