Definite integral of $\cos (x)/ \sqrt{x}$? How do I integrate
$$ \int^{+\infty}_0 \frac{\cos(x)}{\sqrt{x}} dx$$
I tried setting $u = x^{-1/2}$ and $dv = \cos(x)dx$. Then I integrate by part twice to get:
$$ \int^\infty_0 \frac{\cos x}{\sqrt{x}} dx = \lim_{x \rightarrow \infty} \left[\sqrt{x} \sin(x) - \frac{1}{2} \sqrt{x} \cos(x)\right] - \frac{1}{4} \int^\infty_0 \frac{\cos x}{\sqrt{x}} dx $$
Hence:
$$ \frac{5}{4} \int^\infty_0 \frac{\cos x}{\sqrt{x}} dx = \lim_{x \rightarrow \infty} \left[\sqrt{x} \sin(x) - \frac{1}{2} \sqrt{x} \cos(x)\right] $$
I'm not sure how to evaluate the terms on the right. Also, if you think I made a mistake above, please help me point it out.
 A: Setting $\sqrt{x}=t$, we obtain
$$I = \int_0^{\infty} \dfrac{\cos(t^2)}{t} (2tdt) = 2\int_0^{\infty} \cos(x^2)dx = 2 \text{Real}\left(\int_0^{\infty} e^{ix^2}dx\right)$$
Consider the integral
$$F_R = \int_0^{R} e^{iz^2}dz + \int_{C_R} e^{iz^2}dz + \int_{Re^{i\pi/4}}^0 e^{iz^2}dz = \int_0^{R} e^{iz^2}dz + \int_{C_R} e^{iz^2}dz + \int_{R}^0 e^{i\left(te^{i\pi/4}\right)^2} e^{i\pi/4}dt $$
where $C_R$ is one-eighth of the circle in the first quadrant. We have $F_R = 0$, since $e^{iz^2}$ is analytic inside $[0,R]\cup C_R \cup[iR,0]$. Further, we have
$$\left \vert\int_{C_R} e^{iz^2}dz \right \vert \leq \int_{0}^{\pi/4} e^{-R^2\sin(2\theta)} R d\theta$$
Hence,
$$\lim_{R \to \infty}\left \vert\int_{C_R} e^{iz^2}dz \right \vert \leq \lim_{R \to \infty}\int_{0}^{\pi/4} e^{-R^2\sin(2\theta)} R d\theta \leq \int_{0}^{\pi/4} \lim_{R \to \infty}e^{-R^2\sin(2\theta)} R d\theta = 0$$
We hence have
$$0 = \lim_{R \to \infty}F_R = \int_0^{\infty} e^{iz^2}dz + e^{i\pi/4} \int_{\infty}^0 e^{-t^2}dt = \int_0^{\infty} e^{iz^2}dz  - \dfrac{\sqrt{\pi}}2e^{i \pi /4}$$
This gives us
$$\int_0^{\infty} e^{iz^2}dz = \dfrac{\sqrt{\pi}}2 e^{i\pi/4}$$
Hence, our integral is
$$I = 2 \times \dfrac{\sqrt{\pi}}2 \times \cos\left(\dfrac{\pi}4\right) = \sqrt{\dfrac{\pi}{2}}$$
A: It doesn't look to me like you did integration by parts right.  Doing it once, I get
$$u = x^{-1/2}\qquad v = \sin(x)$$
$$du = -\frac{1}{2}x^{-3/2}\;dx \qquad dv =\cos(x)\;dx$$
so
$$\int_0^\infty \frac{\cos(x)}{\sqrt{x}}\;dx = \left[\frac{\sin(x)}{\sqrt{x}}\right]_0^\infty +\frac{1}{2} \int_0^\infty \frac{\sin(x)}{x^{3/2}}\;dx$$
which is not any easier to evaluate.
One way to do the integration is to substitute $u=\sqrt{x}$, so $x=u^2$ and $du = \frac{1}{2\sqrt{x}}\;dx$, so
$$\int_0^\infty \frac{\cos(x)}{\sqrt{x}}\;dx = 2 \int_0^\infty \cos(u^2)\;du$$
The left hand side is twice the limit of the Fresnel Integral $C(t)$ as $t\to\infty$, so
$$2 \int_0^\infty \cos(u^2)\;du = 2 \sqrt{\frac{\pi}{8}} = \sqrt{\frac{\pi}{2}}$$
A: One way to evaluate the integral would be to note that it is the real part of $$ \int^{+\infty}_0 \frac{e^{ix}}{\sqrt{x}} dx$$ and use the gamma function to evaluate this.
