# Solving the Fresnel-type integral $\int_{0}^{\infty} \cos(x\sqrt{x^2+2}) \,\mathrm{d}x$ in an elementary way.

Here I suggest a 'simple' and exquisite integral to solve, namely to prove $$\int_{0}^{\infty} \cos(x\sqrt{x^2+2}) \,\mathrm{d}x = \frac1{e}\sqrt{\frac{\pi}{8}}$$ which is regarded as a kind of generalization of Fresnel-type integral, say $$\int_{0}^{\infty} \cos(x^2) \,\mathrm{d}x = \sqrt{\frac{\pi}{8}}$$ An usual method to crack this integral is using Laplace Transform, let $$y=x\sqrt{x^2+2}\, (y>0)$$, we have $$\int_{0}^{\infty} \cos(x\sqrt{x^2+2}) \,\mathrm{d}x = \frac1{2}\int_{0}^{\infty} \frac{\sqrt{\sqrt{y^2+1}+1}}{\sqrt{y^2+1}} \cos(y) \,\mathrm{d}y$$ where you may obviously have $$\mathcal{L}(\cos(y))=\frac{s}{s^2+1}$$, yet the inverse transform part $$\quad\mathcal{L}^{-1}\left(\frac{\sqrt{\sqrt{y^2+1}+1}}{\sqrt{y^2+1}}\right)$$ is not trivial. Of course, this integral is not a technically 'hard-to-solve' one, but the challenge is to solve it with elementary methods. I do not have any helpful insight yet.

1.Any elementary way to obtain that inverse transform? (I think it is a special case of Bessel function.)
2.Any elementary way to solve the integral without using Laplace Transform? (Of course, you can solve the problem with any elementary tools from complex analysis.)

Thanks for any help.

• So Complex analysis isn't allowed? May 5, 2023 at 15:28
• Beautiful integral, where did you find it?
– Zima
May 5, 2023 at 15:29
• @Zima It is from a notebook of advanced calculus in local language, an old one, including many 'only gives you the answer' question. Unfortunately, those notes are not systematically written into a publishable textbook. May 5, 2023 at 15:54
• I have found out that $$\int_0^{+\infty}\cos\left(x\sqrt{x^2+t^2}\right)\mathrm dx=e^{-\frac{t^2}2}\sqrt{\dfrac{\pi}8}\,.$$ Could someone give me a hint to prove it ? May 5, 2023 at 18:37
• @Angelo Put $x=t\sinh(y/2)$ to see via dlmf.nist.gov/10.32.E7 that it is basically a $K_{1/2}$ Bessel function. Then use dlmf.nist.gov/10.39.E2
– Gary
May 6, 2023 at 0:37

Here is a solution using Feynman's trick: Consider the function $$I : [0, \infty) \to \mathbb{R}$$ defined by the improper integral

$$I(t) = \int_{0}^{\infty} \cos(x\sqrt{x^2 + 4t}) \, \mathrm{d}x = \frac{1}{2} \int_{-\infty}^{\infty} \cos(x\sqrt{x^2 + 4t}) \, \mathrm{d}x.$$

We focus on the regime $$t > 0$$. Substituting $$x = u - t/u$$, the last integral reduces to

\begin{align*} I(t) = \frac{1}{2} \int_{0}^{\infty} \left(1 + \frac{t}{u^2}\right) \cos\left(u^2 - \frac{t^2}{u^2}\right) \, \mathrm{d}u. \end{align*}

To evaluate this, we note that substituting $$u \mapsto t/u$$ yields

\begin{align*} \int_{0}^{\infty} \frac{t}{u^2} \, \cos\left(u^2 - \frac{t^2}{u^2}\right) \, \mathrm{d}u &= \int_{0}^{\infty} \cos\left(u^2 - \frac{t^2}{u^2}\right) \, \mathrm{d}u, \\ \int_{0}^{\infty} \frac{t}{u^2} \, \sin\left(u^2 - \frac{t^2}{u^2}\right) \, \mathrm{d}u &= -\int_{0}^{\infty} \sin\left(u^2 - \frac{t^2}{u^2}\right) \, \mathrm{d}u. \end{align*}

Utilizing this, we get

\begin{align*} I(t) &= \int_{0}^{\infty} \cos\left(u^2 - \frac{t^2}{u^2}\right) \, \mathrm{d}u, \\ I'(t) &= \int_{0}^{\infty} \frac{2t}{u^2} \, \sin\left(u^2 - \frac{t^2}{u^2}\right) \, \mathrm{d}u = -2 \int_{0}^{\infty} \sin\left(u^2 - \frac{t^2}{u^2}\right) \, \mathrm{d}u, \\ I''(t) &= 4 \int_{0}^{\infty} \frac{t}{u^2} \, \cos\left(u^2 - \frac{t^2}{u^2}\right) \, \mathrm{d}u = 4I(t). \end{align*}

Solving this ODE, it follows that $$I(t)$$ is of the form

$$I(t) = A e^{2t} + B e^{-2t}.$$

However, it is not hard to show that $$I(t)$$ does not grow exponentially as $$t \to \infty$$. From this, we conclude that $$A = 0$$ and hence

$$I(t) = I(0) e^{-2t} = \sqrt{\frac{\pi}{8}} e^{-2t}.$$

• $I(0)=\sqrt{\frac{\pi}{8}},~~I'(0)=-\sqrt{\frac{\pi}{2}}$ to determine $A, B$ May 6, 2023 at 2:01
• @MathFail, Knowing $I(0)=\sqrt{\frac{\pi}{8}}$ and $I(\infty)=0$ also uniquely determines $A$ and $B$, which is essentially what I did in my solution. May 6, 2023 at 3:58

Using the approach Po1ynomial used here, we have \begin{align} I = \int_{0}^{\infty} \frac{\sqrt{\sqrt{y^2+1}+1}}{\sqrt{y^2+1}} \, \cos(y) \,\mathrm{d}y &= \sqrt{2} \, \Re\int_{0}^{\infty} \frac{\cos (y)}{\sqrt{1+iy}} \, \mathrm dy \\ &= \frac{\sqrt{2}}{2} \, \Re \, \left(\int_{0}^{\infty}\frac{e^{iy}}{\sqrt{1+iy}} \, \mathrm dy + \int_{0}^{\infty} \frac{e^{-iy}}{\sqrt{1+iy}} \, \mathrm dy\right) , \end{align} where the square root is the principal branch of the square root.

Integrating the integrand of the first integral around a quarter-circle contour in the first quadrant, while integrating the integrand of second integral around a quarter circle contour in the fourth quadrant, we get

\begin{align} I &= \frac{\sqrt{2}}{2} \, \Re \, \left(\int_{0}^{1} \frac{e^{-t}}{\sqrt{1-t}} \, \mathrm \, i \, dt + \int_{1}^{\infty} \frac{e^{-t}}{i \sqrt{t-1}} \, i \, \mathrm dt+ \int_{0}^{\infty} \frac{e^{-t}}{\sqrt{1+t}} \, (-i) \, \mathrm dt \right) \\ &= \frac{\sqrt{2}}{2} \, \Re \, \left(i\int_{0}^{1} \frac{e^{-t}}{\sqrt{1-t}} \, \mathrm dt + \frac{1}{e}\int_{0}^{\infty} \frac{e^{-u}}{\sqrt{u}} \, \mathrm du - i \int_{0}^{\infty} \frac{e^{-t}}{\sqrt{1+t}} \, \mathrm dt \right) \\ &= \frac{\sqrt{2}}{2} \, \Re \, \left(\color{red}{i}\int_{0}^{1} \frac{e^{-t}}{\sqrt{1-t}} \, \mathrm dt + \frac{2}{e} \int_{0}^{\infty} e^{-w^{2}} \, \mathrm dw -\color{red}{i} \int_{0}^{\infty} \frac{e^{-t}}{\sqrt{1+t}} \, \mathrm dt \right) \\ &= \frac{\sqrt{2}}{e} \int_{0}^{\infty} e^{-w^{2}} \, \mathrm dw \\ &= \frac{\sqrt{2 \pi }}{2e}. \end{align}

Therefore, using your substitution, we have $$\int_{0}^{\infty} \cos(x\sqrt{x^2+2}) \,\mathrm{d}x = \frac{I}{2} = \frac{\sqrt{2 \pi}}{4e} = \frac{1}{e} \sqrt{\frac{\pi}{8}}.$$

So, rather than work with $$\cos(x\sqrt{2+x^2})$$, we'll work with $$\exp(ix\sqrt{2+x^2})$$ and take the real part at the end. Now we're going to use a specific contour to simplify the form of the exponent. The contour's segments are the positive real axis, the interval $$[0,1]$$ on the imaginary axis, the contour $$\gamma(s) = \sqrt{-1+i s}$$ for $$u>0$$, and the segment at infinity whose integral should vanish. $$\exp(i x \sqrt{2+x^2})$$ is holomorphic inside the contour, so the integral around it will be zero. Thus we will have $$\int_0^\infty e^{ix\sqrt{2+x^2}}dx = i\int_0^1e^{-s\sqrt{2-s^2}}ds+\int_\gamma e^{iz\sqrt{2+z^2}}dz$$ The first integral on the RHS is purely imaginary and thus won't affect the real part. For the second integral, we have $$\int_\gamma e^{iz\sqrt{2+z^2}}dz =\int_0^\infty \frac{e^{i \sqrt{-1+i s}\sqrt{2-1+ is}}}{-2i\sqrt{-1+i s}}ds = \int_0^\infty \frac{\sqrt{1+is}}{2\sqrt{1+s^2}}e^{-\sqrt{1+s^2}}ds.$$ At this point, we trig substitute $$s\rightarrow \sinh(2u)$$ and use the fact that $$1+i\sinh 2u = (\cosh u + i \sinh u)^2$$ to get $$\int_\gamma e^{iz\sqrt{2+z^2}}dz =\int_0^\infty e^{-\cosh(2 u)}(\cosh u+i\sinh u)du.$$ Taking the real part and using $$\cosh(2u) = 1+2\sinh^2 u$$ then gives $$\int_0^\infty \cos(x\sqrt{2+x^2})dx = \int_0^\infty e^{-1-2\sinh^2 u}\cosh u\, du = \frac{1}{e}\int_0^\infty e^{-2v^2}dv = \frac{1}{e}\sqrt{\frac{\pi}{8}}.$$ So it was a Gaussian in disguise this whole time.

• Incredible choice of contour. How did you come up with it? I’ve never seen successful use of nonstandard contours before May 6, 2023 at 18:48
• @FShrike I figured the integral would be more tractable if I could get the exponential term to be purely decaying instead of oscillatory. I initially tried integrating down the branch cut, but that's still purely oscillatory. Starting at $z =i$ did seem to simplify the argument, though, so I looked for a contour that started at $z = i$ and kept the argument of the exponential real and negative the whole way. May 10, 2023 at 14:24
• Hi @eyeballfrog , is this contour accurate to what you had in mind when writing your solution? I got that $\Re\sqrt{-1+it}=\left(1+t^{2}\right)^{\frac{1}{4}}\cos\left(\frac{\pi}{2}-\frac{\arctan\left(t\right)}{2}\right)$ and $\Im\sqrt{-1+it}=\left(1+t^{2}\right)^{\frac{1}{4}}\sin\left(\frac{\pi}{2}-\frac{\arctan\left(t\right)}{2}\right)$ and the branch cuts to be $\pm i\sqrt{2}$ both pointing away from the contour by setting their arguments to be in the interval $(-\pi, \pi)$. May 12, 2023 at 22:51
• @Accelerator I had the branch cuts parallel to the imaginary axis (which shouldn't matter here), but otherwise I think that's about right. May 12, 2023 at 23:05

We are going to prove that

$$\displaystyle\int_0^{+\infty}\cos\left(x\sqrt{x^2+a^2}\right)\,\mathrm dx=\sqrt{\dfrac\pi8}\,e^{-\frac{a^2}2}\quad$$ for any $$\,a\in\Bbb R\,.$$

First case :$$\;\;a=0\,.$$

If $$\;a=0\;,\;$$ it results that

$$\displaystyle\int_0^{+\infty}\!\!\!\cos\left(x\sqrt{x^2+a^2}\right)\,\mathrm dx=\!\!\int_0^{+\infty}\!\!\!\cos\left(x^2\right)\mathrm dx=\!\sqrt{\dfrac\pi8}\,.$$
( see here )

Second case :$$\;\;a\neq0\,.$$

If $$\;a\neq0\;,\;$$ we will use the modified Bessel functions of the second kind $$\;K_\nu(x)\;$$ and the following formulas :

$$K_{\frac12}(x)=\sqrt{\dfrac\pi{2x}}\,e^{-x}\;\;,\qquad$$( see here )

$$\displaystyle K_\nu(x)=\sec\left(\!\dfrac{\nu\pi}2\!\right)\!\int_0^{+\infty}\!\!\!\!\cos(x\sinh t)\cosh(\nu t)\,\mathrm dt\,\,,\quad$$( see here )

for any $$\,\nu\in\Bbb C\,$$ such that $$\,|\Re(\nu)|<1\,$$ and for any $$\,x>0\,.$$

It results that

$$\displaystyle\int_0^{+\infty}\cos\left(x\sqrt{x^2+a^2}\right)\,\mathrm dx\underset{\overbrace{\text{ by letting }\,x=|a|\!\sinh\left(\!\frac t2\!\right)\;}}{=}$$

$$\displaystyle=\int_0^{+\infty}\!\!\cos\left[|a|\!\sinh\left(\!\frac t2\!\right)\sqrt{a^2\!\sinh^2\left(\!\frac t2\right)\!+\!a^2}\,\right]\dfrac{|a|}2\cosh\left(\!\dfrac t2\!\right)\,\mathrm dt=$$

$$\displaystyle=\dfrac{|a|}2\int_0^{+\infty}\!\!\cos\left[a^2\!\sinh\left(\!\frac t2\!\right)\sqrt{\sinh^2\left(\!\frac t2\right)\!+\!1}\,\right]\cosh\left(\!\dfrac t2\!\right)\,\mathrm dt=$$

$$\displaystyle=\dfrac{|a|}2\int_0^{+\infty}\!\!\cos\left[a^2\!\sinh\left(\!\frac t2\!\right)\cosh\left(\!\dfrac t2\!\right)\right]\cosh\left(\!\dfrac t2\!\right)\,\mathrm dt=$$

$$\displaystyle=\dfrac{|a|}2\int_0^{+\infty}\!\!\cos\left(\!\dfrac{a^2}2\sinh t\!\right)\cosh\left(\!\dfrac t2\!\right)\,\mathrm dt=$$

$$=\dfrac{|a|}2\cdot\dfrac{K_{\frac12}\!\left(\!\frac{a^2}2\!\right)}{\sec\left(\frac\pi4\right)}=$$

$$=\dfrac{|a|}{2\sqrt2}\cdot K_{\frac12}\!\left(\!\dfrac{a^2}2\!\right)=$$

$$=\dfrac{|a|}{2\sqrt2}\cdot\sqrt{\dfrac\pi{a^2}}\,e^{-\frac{a^2}2}=$$

$$=\sqrt{\dfrac\pi8}\,e^{-\frac{a^2}2}.$$