# Proof only by transformation that : $\int_0^\infty \cos(x^2) dx = \int_0^\infty \sin(x^2) dx$

This was a question in our exam and I did not know which change of variables or trick to apply

How to show by inspection ( change of variables or whatever trick ) that

$$\int_0^\infty \cos(x^2) dx = \int_0^\infty \sin(x^2) dx \tag{I}$$

Computing the values of these integrals are known as routine. Further from their values, the equality holds. But can we show equality beforehand?

Note: I am not asking for computation since it can be found here and we have as well that, $$\int_0^\infty \cos(x^2) dx = \int_0^\infty \sin(x^2) dx =\sqrt{\frac{\pi}{8}}$$ and the result can be recover here, Evaluating $\int_0^\infty \sin x^2\, dx$ with real methods?.

Is there any trick to prove the equality in (I) without computing the exact values of these integrals beforehand?

• $$\int_0^\infty \cos(x^2) dx = \int_0^\infty \sin(x^2) dx =\sqrt{\frac{\pi}{8}}$$ Oct 31, 2017 at 19:18
• One way is to reproduce robjohn's proof here: math.stackexchange.com/questions/187729/… for the cosine case. Oct 31, 2017 at 19:55
• Experimenting numerically, it seems that $\left\lvert\int_0^X[\cos(x^2)-\sin(x^2)]\, dx\right\rvert \le C(1+X)^{-1}$: [![see this plot]] : i.stack.imgur.com/JK7Tj.gif Oct 31, 2017 at 20:37
• @GiuseppeNegro $\cos(x^2)-\sin(x^2) = -\sqrt 2\sin(x^2-\frac{\pi}4)$, so I don't think it's easier that way. Oct 31, 2017 at 20:53
• Well, the complex analysis argument using either a sector of angle $\pi/4$ or a similar triangle, on the function $f(z) = e^{-z^2}$, shows initially that $(1+i) \int_0^\infty (\cos(x^2) - i \sin(x^2)) \, dx$ is real. (Then, from there, you go on to compare it to the integral of a Gaussian.) From the tone of the original post, this might be beyond the subject matter for their current course, though. Oct 31, 2017 at 22:18

## <Here is what I found

Employing the change of variables $$2u =x^2$$ We get $$I=\int_0^\infty \cos(x^2) dx =\frac{1}{\sqrt{2}}\int^\infty_0\frac{\cos(2x)}{\sqrt{x}}\,dx$$ $$J=\int_0^\infty \sin(x^2) dx=\frac{1}{\sqrt{2}}\int^\infty_0\frac{\sin(2x)}{\sqrt{x}}\,dx$$

Summary: We will prove that $$J\ge 0$$ and $$I\ge 0$$ so that, proving that $$I=J$$ is equivalent to $$\color{blue}{0= (I+J)(I-J)=I^2 -J^2 =\lim_{t \to 0}I_t^2-J^2_t}$$ Where, $$I_t = \int_0^\infty e^{-tx^2}\cos(x^2) dx~~~~\text{and}~~~ J_t = \int_0^\infty e^{-tx^2}\sin(x^2) dx$$ $$t\mapsto I_t$$ and $$t\mapsto J_t$$ are clearly continuous due to the present of the integrand factor $$e^{-tx^2}$$.

However, By Fubini we have,

$$\begin{split} I_t^2-J^2_t&=& \left(\int_0^\infty e^{-tx^2}\cos(x^2) dx\right) \left(\int_0^\infty e^{-ty^2}\cos(y^2) dy\right) \\&-& \left(\int_0^\infty e^{-tx^2}\sin(x^2) dx\right) \left(\int_0^\infty e^{-ty^2}\sin(y^2) dy\right) \\ &=& \int_0^\infty \int_0^\infty e^{-t(x^2+y^2)}\cos(x^2+y^2)dxdy\\ &=&\int_0^{\frac\pi2}\int_0^\infty re^{-tr^2}\cos r^2 drd\theta\\&=&\frac\pi4 Re\left( \int_0^\infty \left[\frac{1}{i-t}e^{(i-t)r^2}\right]' dr\right)\\ &=&\color{blue}{\frac\pi4\frac{t}{1+t^2}\to 0~~as ~~~t\to 0} \end{split}$$

To end the proof: Let us show that $$I> 0$$ and $$J> 0$$. Performing an integration by part we obtain $$J = \frac{1}{\sqrt{2}} \int^\infty_0\frac{\sin(2x)}{x^{1/2}}\,dx=\frac{1}{\sqrt{2}}\underbrace{\left[\frac{\sin^2 x}{x^{1/2}}\right]_0^\infty}_{=0} +\frac{1}{2\sqrt{2}} \int^\infty_0\frac{\sin^2 x}{x^{3/2}}\,dx\color{red}{>0}$$ Given that $$\color{red}{\sin 2x= 2\sin x\cos x =(\sin^2x)'}$$. Similarly we have, $$I = \frac{1}{\sqrt{2}}\int^\infty_0\frac{\cos(2x)}{\sqrt{x}}\,dx=\frac{1}{2\sqrt{2}}\underbrace{\left[\frac{\sin 2 x}{x^{1/2}}\right]_0^\infty}_{=0} +\frac{1}{4\sqrt{2}} \int^\infty_0\frac{\sin 2 x}{x^{3/2}}\,dx\\= \frac{1}{4\sqrt{2}}\underbrace{\left[\frac{\sin^2 x}{x^{1/2}}\right]_0^\infty}_{=0} +\frac{3}{8\sqrt{2}} \int^\infty_0\frac{\sin^2 x}{x^{5/2}}\,dx\color{red}{>0}$$

Conclusion: $$~~~I^2-J^2 =0$$, $$I>0$$ and $$J>0$$ impliy $$I=J$$. Note that we did not attempt to compute neither the value of $$~~I$$ nor $$J$$.

Extra-to-the answer However using similar technique in above prove one can easily arrives at the following $$\color{blue}{I_tJ_t = \frac\pi8\frac{1}{t^2+1}}$$ from which one get the following explicit value of $$\color{red}{I^2=J^2= IJ = \lim_{t\to 0}I_tJ_t =\frac{\pi}{8}}$$

• This is a great answer. I think that you could prove that $I\ge 0$ and $J\ge 0$ more simply by looking at the graph of the integrand function. Starting from zero, there is a positive hump, followed by a negative one that is smaller. Then another positive hump that is bigger than the subsequent negative, and so on. Therefore the total integral must be positive. This is hand waving but can be made rigorous without much difficulty, I think. Nov 7, 2017 at 15:02
• Yes you are right with the graph show. But with graph it is not 100% convincing. I know people that will partially reject that. Because they say "graphics make conjecture but not proofs":) Nov 7, 2017 at 15:10
• I can't believe nobody is upvoting this. This answer is great. Nov 9, 2017 at 18:58
• I still wondering whether they did not see or did not agree with this Nov 9, 2017 at 19:25
• out of the blue, yet an interesting approach Nov 10, 2017 at 22:31

Note by change of variable it suffices to show

$$\int^\infty_0\frac{\cos(x)}{\sqrt{x}}\,dx =\int^\infty_0\frac{\sin(x)}{\sqrt{x}}\,dx$$

Consider the following function

$$f(z)=z^{-1/2}\,e^{iz}$$

Where we choose the principal root for $z^{-1/2}=e^{-1/2\log(z)}$. By integrating around the following contour $$\int_{C_r}f(z)\,dz+\int_{r}^R f(x)\,dx+\int_{\gamma}f(z)\,dz+\int^{iR}_{ir}f(x)\,dx = 0$$

Taking the integral around the small quarter circle with $r\to 0$ $$\left| \int_{C_r}f(z)\,dz\right|\leq \left|\sqrt{r}\int^{\pi/2}_{0}e^{it/2} e^{rie^{it}}\,dt\right| \leq \sqrt{r}\int^{\pi/2}_{0}\left|e^{-r\sin(t)}\right|\,dt\sim 0$$

On $\gamma(t)=(1-t)R+iRt$ where $0\leq t \leq 1$

$$\left|\int_{\gamma}f(z)\,dz\right| = \left| R(i-1)\int^1_0e^{-1/2\log(R(1-t)+iRt)}e^{i(1-t)R-Rt}\,dt\right| \\ \leq \frac{\sqrt{2}}{\sqrt{R}} \int^1_0 \frac{e^{-Rt}}{\sqrt{(1-t)^2+t^2}}\,dt$$

Hence we have

$$\left|\int_{\gamma}f(z)\,dz\right| \leq \frac{\sqrt{2}}{\sqrt{R}} \int^1_0 e^{-Rt}\,dt=\frac{\sqrt{2}}{R\sqrt{R}}\left(1-e^{-R}\right)\sim_{\infty}0$$

Finally what is remaining when $r\to 0$ and $R \to \infty$

$$\int^\infty_0 \frac{e^{ix}}{\sqrt{x}}\,dx =i \int^{\infty}_{0}(ix)^{-1/2}e^{-x}\,dx$$

Note that $i^{-1/2}=e^{-i\pi/4}$

$$\int^\infty_0\frac{e^{ix}}{\sqrt{x}}\,dx = ie^{-i\pi/4}I = \frac{I}{\sqrt{2}}+i\frac{I}{\sqrt{2}}$$

By equating the real part with the real part and the imaginary part with the imaginary part we reach $$\int^\infty_0\frac{\cos(x)}{\sqrt{x}}\,dx =\int^\infty_0\frac{\sin(x)}{\sqrt{x}}\,dx = \frac{I}{\sqrt{2}}$$

Although $I$ is easy to evaluate using the gamma function, we didn't have to evaluate it to show equivalence.

• In fact this is how we compute the integral. From this you have the evaluation already.:( Nov 1, 2017 at 10:30
• @GuyFsone, this is less expensive than solving each integral individually. Note than in the derivation we didn't have to solve any integral besides proving the some integrals go to zero in the limit. Nov 1, 2017 at 10:48
• check the answer below. it prove without computing the values Nov 6, 2017 at 21:18

Since $e^{iz^2}$ is entire, by Cauchy's Integral Theorem, we have $$\int_0^R e^{iz^2}\,\mathrm{d}z =\int_0^{(1+i)R} e^{iz^2}\,\mathrm{d}z+\int_{(1+i)R}^R e^{iz^2}\,\mathrm{d}z\tag1$$ where, using the parameterization $z=R(1+it)$, we have the estimate \begin{align} \left|\,\int_{(1+i)R}^R e^{iz^2}\,\mathrm{d}z\,\right| &\le R\int_0^1e^{-2R^2t}\,\mathrm{d}t\\ &\le\frac1{2R}\tag2 \end{align} and using the reparameterization $z\mapsto(1+i)z$, \begin{align} \int_0^{(1+i)R}e^{iz^2}\,\mathrm{d}z &=(1+i)\int_0^Re^{-2z^2}\,\mathrm{d}z\tag3 \end{align} Combining $(1)$, $(2)$, and $(3)$, while letting $R\to\infty$, validates the following change of variables: $\boldsymbol{\color{#C00}{z\mapsto(1+i)z}}$. \begin{align} \int_0^\infty\left(\cos\left(z^2\right)+i\sin\left(z^2\right)\right)\mathrm{d}z &=\boldsymbol{\color{#C00}{\int_0^\infty e^{iz^2}\,\mathrm{d}z}}\\ &\boldsymbol{\color{#C00}{=(1+i)\int_0^\infty e^{-2z^2}\,\mathrm{d}z}}\tag4 \end{align} Since the real and imaginary parts of $(4)$ are the same, we get that $$\int_0^\infty\cos\left(z^2\right)\,\mathrm{d}z =\int_0^\infty\sin\left(z^2\right)\,\mathrm{d}z\tag5$$

Note that $$\int_0^\infty(\mathcal{L} g)(x)f(x)\,dx = \int_0^\infty g(x)(\mathcal{L}f)(x)\,dx$$ With $$f(x) =\sin x -\cos x$$, $$g(x)=\frac1{\sqrt x}$$ along their transformations $$\mathcal{L} f=\frac{x-1}{x^2+1}$$, $$\mathcal{L} g=\sqrt{\frac \pi x}$$ \begin{align} &\sqrt\pi\int_0^\infty\frac{ \sin x -\cos x}{\sqrt x}dx\\ =&\ \int_0^\infty\frac{ x-1}{\sqrt x(x^2+1)}dx \overset{x\to \frac1x}= \int_0^\infty\frac{1- x}{\sqrt x(x^2+1)}dx=0 \end{align} where the vanishing LHS with $$x\to x^2$$ yields $$\int_0^\infty \sin x^2 dx= \int_0^\infty \cos x^2dx$$.

This is an extended comment not a proper answer.

The question can be rewritten as follows: to show that $$\tag{1} \Re \int_{-\infty}^\infty e^{-i|\xi|^2}\, d\xi + \Im \int_{-\infty}^\infty e^{-i|\xi|^2}\, d\xi=0,$$ where the integral is in the principal-value sense. This integral arises in PDEs as evaluation at the spatial origin of the fundamental solution to the Schrödinger equation. More precisely, if $E=E(t, \mathbf x)$ solves $$\tag{2} \begin{cases} (i\partial_t + \Delta) E(t, \mathbf x)=0, & t\in \mathbb R, \mathbf x\in\mathbb R^n\\ E(0, \mathbf x)=\delta(\mathbf x)\end{cases}$$ (where $\delta$ is the Dirac distribution) then the Fourier transform of $E(t, \cdot)$ is $$\hat{E}(t,\boldsymbol \xi)=\int_{\mathbb R^n} e^{-i\mathbf x\cdot \boldsymbol\xi}E(t, \mathbf x)\, d\mathbf x= e^{-it|\boldsymbol\xi|^2},\quad \boldsymbol\xi\in\mathbb R^n.$$ Now we observe that, for all suitable function $u$, we have that $\int_{\mathbb R^n} \hat{u}(t,\boldsymbol \xi)\, d\boldsymbol\xi=u(t, \mathbf 0)$. This gives a reformulation of problem (1) that generalizes to arbitrary dimension:

Is it true that $$\tag{3}\Re E(1,\mathbf 0)+ \Im E(1, \mathbf 0) =0,$$ where $E$ is the solution to (2)?

I found it surprising that the answer is affirmative if and only if $n=1\mod 4$: this follows from the explicit formula $$E(1,\mathbf 0)=\lim_{R\to \infty}\int_{[-R, R]^n}e^{-i|\boldsymbol \xi|^2}\, d\boldsymbol\xi = \frac{\pi^\frac{n}{2}}{i^\frac{n}{2}}=\pi^{\frac n 2}e^{-i \frac{n}{4}\pi}.$$

Conclusion. The OP asks for a solution that relies purely on change of variable in the integrals. In view of the reformulation (3), such changes of variable correspond to the symmetries of the PDE (2). These symmetries are dimension-independent, but the solution to the problem (3) is dependent on the dimension. Therefore, it seems to me that this approach is unlikely to work.