# 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.

• Breaking up a limit into a sum of two limits is valid only when both of the limits in the sum exist; $\sqrt{x}(\sin x - \frac12 \cos x)$ doesn't converge as $x\to\infty$. That is to say, this integration by parts can't be carried out. – Eugene Shvarts May 13 '15 at 0:13

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}}$$

• The interchange of the limit and integral requires justification. An straightforward way is to note that on $[0,\pi/4]$, we have $\sin 2x\ge 4x/pi$. Thus, $\int_0^{\pi/4}e^{-R^2\sin 2x}Rdx \le \int_0^{\pi/4}e^{-R^2 4x/\pi}Rdx=\frac{\pi}{4}\frac{1-e^{-R^2}}{R}\to 0$ as $R\to \infty$. Nice solution otherwise! – Mark Viola Jul 7 '15 at 5:31

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}}$$

• Bravo to your suggestion of the Fresnel Integral. I went that way with this integral once, but I didn't know how to integrate that integral. Thank you for the enlightenment. – Huy Nguyen May 13 '15 at 0:26
• @HuyNguyen Look at my answer for evaluating the Fresnel integral, the right way, – Leg May 13 '15 at 0:42

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.

• I actually reduced my integral from that form. I was doing a Fourier transform integral. – Huy Nguyen May 13 '15 at 0:24
• @HuyNguyen Well the above can be evaluated using the gamma function (substituting $x = iu$ and deforming contours to get to the gamma function form). – David Foster May 13 '15 at 0:27
• Can you put your suggestion into an answer? I'm not very familiar with deforming contours. It will be very helpful for related problems. – Huy Nguyen May 13 '15 at 0:32