7

Evaluating the Integral: $\int_0^\infty\left[\frac{1}{2} - \cos\left(x\right)\right]\,{\rm dx \over x}$

I came upon this limit: $\lim_{x\rightarrow\infty} -Ci(x) + Ci(1/x) +\ln(x)$, is it $\gamma$ ?

Here $ Ci(x) = \gamma + \ln x + \int_0^x \frac{\cos t -1}{t} dt $ is the cosine integral and $\gamma$ is the Euler constant. The Limit and the Integral appear to be equal.

Felix Marin
  • 89,464
Alan
  • 2,239
  • 13
  • 15
  • 11
    $$\frac{\frac12-\cos x}{x}$$ has a non-integrable singularity in $0$. – Daniel Fischer Nov 02 '13 at 23:45
  • 3
    How about if that 1/2 would be a 1? – imranfat Nov 02 '13 at 23:47
  • Well the limit gives me this: 0.57721566490153286060651209008240243104215933593992359880576723488486772677766467093694706329174674955186905961593475130... – Alan Nov 02 '13 at 23:51
  • @Alan Numerically, that is Euler's Constant, $\gamma$ – Argon Nov 02 '13 at 23:56
  • That looks like Euler's constant! – imranfat Nov 02 '13 at 23:56
  • @3.1416 : $$\lim_{n\to\infty}\int_{\frac1n}^n\frac{\frac12-\cos x}xdx=\gamma$$ – Lucian Nov 03 '13 at 15:55
  • @Alan: Considering the above limit is a completely different matter from "evaluating the integral". We cannot evaluate the integral over the positive real line since $\frac{1/2-\cos x}{x}$ is not Riemann-integrable (in a right neighbourhood of zero, it is bigger than $\frac{1}{3x}$). The same (existence of the above limit without Riemann-integrability) holds for the function $f(x)=\frac{\log x}{x}$, for istance. – Jack D'Aurizio Jan 21 '14 at 03:33
  • From Mathematica $\large\tt Integrate::idiv: "Integral of 1/(2\x)-Cos[x]/x does not converge on {0.1`,[Infinity]}"$ – Felix Marin Jan 21 '14 at 10:56
  • With @Lucian definition, Mathemathica yields $\large\gamma$. So, the OP question was not clearly stated. Every day we learn something new !!!. – Felix Marin Jan 21 '14 at 11:03
  • According to @Lucian the result, for a given $\large n$ is $\large {\rm ci}\left(1 \over n\right) - {\rm ci}(n) + \ln(n)$ and the limit $\large n \to \infty$ is $\large \gamma$. – Felix Marin Jan 21 '14 at 11:06
  • A similar identity would be $$\int_1^\infty\frac{\frac12-{x}}{x^2}dx=\gamma-\frac12$$ which is a special case of the more general identity $$\int_1^\infty\frac{\frac12-{x}}{x^{s+1}}dx=\frac{\zeta(s)-\frac1{s-1}-\frac{1}{2}}s$$ since it is known (don't ask me how or why) that $$\lim_{x\to1}\bigg[\zeta(x)-\frac1{x-1}\bigg]=\gamma.$$ – Lucian Jan 24 '14 at 17:42
  • So, a reference for this would be "Theory of the Riemann Zeta function" by Titchmarsh page 15-16. – Alan Jan 24 '14 at 20:06
  • It can be found here. – Lucian Jan 25 '14 at 05:10
  • @Lucian: Here is a quick derivation of the Laurent expansion for $\zeta(s)$ around $s=1$. – robjohn Jan 20 '22 at 17:29

3 Answers3

5

$$\int_0^{+\infty}\left(\frac 1 2 - \cos x\right)\frac {dx} x = \gamma$$

\begin{align*}\int_{1/n}^n \left(\frac 1 2 - \cos x\right)\frac {dx} x &= \int_{1/n}^1 \left(1 - \cos x\right)\frac {dx} x -\int_1^n \cos x\frac {dx} x+ \frac 1 2 \left(\int_1^n \frac {dx} x -\int_{1/n}^1 \frac {dx} x\right) \\ &=\int_{1/n}^1 (1-\cos x) \frac {dx} x - \int_1^n \cos x \frac {dx} x \end{align*} $$\bbox[0.2ex,border:0.5pt solid black]{\int_0^1 \frac {1-\cos(y)}y\,dy -\int_1^{+\infty} \frac {\cos(y)} y\,dy=\gamma}$$

Here is the proof of Gronwall, 1918. For $n$ a positive integer $$\begin{align} A(n) &= \int_0^{n\pi} \frac{1-\cos (y)}{y} dy - \ln ( n\pi ) \\ &= \int_0^1 \frac{1-\cos (y)}{y} dy + \int_1^{n\pi} \frac{1-\cos (y)}{y} dy - \ln ( n\pi ) \\ &= \int_0^1 \frac{1-\cos(y)}{t} dy - \int_1^{n\pi} \frac{\cos(y)}{y} dy \end{align}$$

With a change of variable $x = 2 \pi ny$:

$$\begin{align} \int_0^{n\pi} \frac{1-\cos(x)}{x} xy &= \int_0^{\frac{1}{2}} \frac{1 - \cos (2\pi ny)}{y} dy \\ &= \pi \int_0^{\frac{1}{2}} \frac{1 - \cos (2 \pi ny)}{\sin(\pi y)} dy + \int_0^{\frac{1}{2}} g(y) dy - \int_0^{\frac{1}{2}} g(y) \cos ( 2 \pi ny) dy \end{align}$$

$g(y) = \frac{1}{y} - \frac{\pi}{\sin (\pi y)}$ which is continuous on $[0,\frac{1}{2}]$ with $g(0) = 0$.

With Riemann-Lebesgue theorem $$\int_0^\frac{1}{2} g(y) \cos ( 2 \pi n y ) dy \rightarrow 0 \text{ for } n \rightarrow + \infty$$

$$\begin{align} \int_0^\frac12 g(y) dy &= \lim_{s \to 0^+} \int_s^\frac12 \left( \frac 1y - \frac \pi{\sin(\pi y)} \right) dy \\ &= \lim_{s \to 0^+} \left[ \ln \left( \frac{y}{\tan ( \pi/2\;y )} \right) \right]_s^{\frac{1}{2}} = \ln ( \pi ) - 2 \ln (2) \end{align}$$

On the other hand $$\begin{align} \pi \int_{0}^{\frac{1}{2}} \frac{1 - \cos ( 2 \pi n y)}{\sin ( \pi y )} dy &= 2\pi \int_{0}^{\frac{1}{2}} \sum_{k=1}^{n} \sin ( (2k-1) \pi y ) dy \\ &= \sum_{k=1}^{n} \frac{2}{2k-1} ={\ln (n) + 2 \ln (2) + \gamma + o(1)} \end{align}$$

Finally $$A(n) = \gamma + o(1)$$

Thanks very much to Sladjan Stankovik for providing insight into this problem for me.

Guy
  • 8,857
  • 1
  • 28
  • 57
Alan
  • 2,239
  • 13
  • 15
  • There is something suble here. Having $$\lim_{n\to +\infty}\int_{1/n}^{n} f(x),dx = C$$ does not imply that $f(x)$ is a Riemann-integrable function over $\mathbb{R}^+$ with $$\int_{0}^{+\infty}f(x),dx = C.$$ @Daniel Fischer is completely right. – Jack D'Aurizio Jan 21 '14 at 03:21
  • @JackD'Aurizio: No one said he wasn't... :-) Being able to compute $\displaystyle\lim_{n\to\infty}\sum_{k=-n}^nk=0$, for instance, is not the same thing as saying that $\displaystyle\sum_{k=-\infty}^\infty k$ makes any sense. (Obviously, changing either center of the sum's terms to anything other than $0$, and/or destroying the symmetry of its limits, will yield completely different results). – Lucian Jan 21 '14 at 12:04
  • 1
    @Lucian: we totally agree, I was simply pointing out that the very first line of this answer, strictly speaking, is wrong. – Jack D'Aurizio Jan 21 '14 at 13:16
  • Reference for the problem : "Euler’s constant with integrals" by Moubinool OMARJEE , Lycée Jean-Lurçat Paris , France -- Twenty-six different integrals that lead to Euler's Constant. (I have no problem with the problem being formulated in a more modern context.) The result of Gronwall is , of course, from 1918. – Alan Jan 22 '14 at 02:04
  • @Alan i edited your answer, by converting it to $\TeX$. Can you review it once? – Guy Mar 25 '14 at 12:21
  • I agree completely with @JackD'Aurizio last comment. The particular combination $n$ and ${1 \over n}$ cancels each other the logarithmic divergences. – Felix Marin Apr 20 '14 at 20:04
5

$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $\ds{\lim_{\epsilon \to 0^{+}}\,\int_{\epsilon}^{1/\epsilon} \bracks{\half - \cos\pars{x}}\,{\dd x \over x} = \gamma.\quad}$ $\ds{\quad\gamma}$ is the Euler-Mascheroni Constant.

\begin{align} &\color{#c00000}{ \lim_{\epsilon \to 0^{+}}\,\int_{\epsilon}^{1/\epsilon}\bracks{ \half - \cos\pars{x}}\,{\dd x \over x}} =\lim_{\epsilon \to 0^{+}}\,\bracks{-\int_{\epsilon}^{1/\epsilon}{ \cos\pars{x} - 1 \over x}\,\dd x - \half\int_{\epsilon}^{1/\epsilon} {\dd x \over x}} \\[3mm]&=\lim_{\epsilon \to 0^{+}}\,\braces{ -\bracks{{\rm Ci}\pars{1 \over \epsilon} - \ln\pars{1 \over \epsilon} - \gamma} + \bracks{{\rm Ci}\pars{\epsilon} - \ln\pars{\epsilon} - \gamma} -\half\ln\pars{1/\epsilon \over \epsilon}}\tag{1} \end{align} where $\ds{{\rm Ci}\pars{x}}$ is one of the Cosine Integral Functions.

Expression $\pars{1}$ can be rewritten as \begin{align} &\color{#c00000}{ \lim_{\epsilon \to 0^{+}}\,\int_{\epsilon}^{1/\epsilon}\bracks{ \half - \cos\pars{x}}\,{\dd x \over x}} =\gamma + \lim_{\epsilon \to 0^{+}}\, \braces{-{\rm Ci}\pars{1 \over \epsilon} + \bracks{{\rm Ci}\pars{\epsilon} - \ln\pars{\epsilon} - \gamma}}\tag{2} \end{align}

However $$ \lim_{\epsilon \to 0^{+}}\,{\rm Ci}\pars{1 \over \epsilon} = 0\,,\qquad \lim_{\epsilon \to 0^{+}}\,\,\bracks{ {\rm Ci}\pars{\epsilon} - \gamma - \ln\pars{\epsilon}} = 0 $$

such that $\pars{2}$ leads to $$\color{#00f}{\large \lim_{\epsilon \to 0^{+}}\int_{\epsilon}^{1/\epsilon}\bracks{ \half - \cos\pars{x}}\,{\dd x \over x} = \gamma} $$

Felix Marin
  • 89,464
3

$$ \begin{align} &\lim_{n\to\infty}\int_{1/n}^n\frac{\frac12-\cos(x)}x\,\mathrm{d}x\\ &=\lim_{n\to\infty}\left(\log(n)-\int_{1/n}^1\frac{\cos(x)}x\,\mathrm{d}x-\int_1^n\frac{\cos(x)}x\,\mathrm{d}x\right)\tag{1a}\\ &=\int_0^1\frac{1-\cos(x)}x\,\mathrm{d}x-\int_1^\infty\frac{\cos(x)}x\,\mathrm{d}x\tag{1b}\\ &=\int_0^1(1-\cos(x))\,\mathrm{d}\log(x)-\lim_{n\to\infty}\int_1^{(2n+1)\pi/2}\cos(x)\,\mathrm{d}\log(x)\tag{1c}\\ &=-\int_0^1\log(x)\sin(x)\,\mathrm{d}x-\lim_{n\to\infty}\int_1^{(2n+1)\pi/2}\log(x)\sin(x)\,\mathrm{d}x\tag{1d}\\ &=-\lim_{n\to\infty}\int_0^{(2n+1)\pi/2}\log(x)\sin(x)\,\mathrm{d}x\tag{1e}\\ &=-\frac1{2i}\lim_{n\to\infty}\left(\int_0^{(2n+1)\pi/2}\log(x)\,e^{ix}\,\mathrm{d}x-\int_0^{(2n+1)\pi/2}\log(x)\,e^{-ix}\,\mathrm{d}x\right)\tag{1f}\\ &=-\frac1{2i}\lim_{n\to\infty}\left(i\int_0^{\left(n+\frac12\right)\pi}\!\!\left(\log(x){+}\tfrac{i\pi}2\right)e^{-x}\,\mathrm{d}x+i\int_0^{\left(n+\frac12\right)\pi}\!\!\left(\log(x){-}\tfrac{i\pi}2\right)e^{-x}\,\mathrm{d}x\right)\tag{1g}\\ &=-\int_0^\infty\log(x)\,e^{-x}\,\mathrm{d}x\tag{1h}\\[6pt] &=\gamma\tag{1i} \end{align} $$ Explanation:
$\text{(1a)}$: break up the integral into pieces
$\text{(1b)}$: reassemble the pieces and evalate the limit
$\text{(1c)}$: write the right hand integral as a limit
$\phantom{\text{(1c):}}$ prepare to integrate by parts
$\text{(1d)}$: integrate by parts
$\text{(1e)}$: combine the integrals
$\text{(1f)}$: $\sin(x)=\frac{e^{ix}-e^{-ix}}{2i}$
$\text{(1g)}$: Cauchy's Integral Theorem
$\text{(1h)}$: evaluate the limits and combine the integrals
$\text{(1i)}$: apply this answer


Contour Integration for $\bf{(1g)}$

$\newcommand{\Re}{\operatorname{Re}}\newcommand{\Im}{\operatorname{Im}}$ Step $\text{(1g)}$ above looks like one that is often encountered in contour integration, where the integrand along the "arc at infinity" vanishes sufficiently in absolute value. However, the absolute value of the integrands along both of the arcs at infinity grows like $\log(\Re(z))e^{-|\!\Im(z)|}$. Fortunately, they have opposite signs and cancel to within an error of $O\!\left(\frac1n\right)$. This has the same effect as if the absolute value of the integrand had vanished sufficiently.

enter image description here

Integrating around the upper-right quadrant, we get the integral along the positive real axis by substituting $z=x$ and the integral along the positive imaginary axis by substituting $z=ix$.

The integral along the arc is a bit more complicated. As the integrand dies away like $e^{-y}$ as $y\to\infty$, we will compute the integral along $\left(n+\frac12\right)\pi+iy$, giving an error of $O\!\left(e^{-x}\right)$. $$ \begin{align} \frac1{2i}\int_{\left(n+\frac12\right)\pi}^{\left(n+\frac12\right)\pi+i\infty}\log(z)\,e^{iz}\,\mathrm{d}z &=\frac1{2}\int_0^\infty(\log(x)+\log(1+iy/x))\,e^{ix-y}\,\mathrm{d}y\tag{2a}\\ &=\frac{i}2(-1)^n\int_0^\infty\left(\log(x)+O(y/x)\right)e^{-y}\,\mathrm{d}y\tag{2b}\\[3pt] &=\frac{i}2(-1)^n\log\left(\left(n+\tfrac12\right)\pi\right)+O\!\left(\frac1n\right)\tag{2c} \end{align} $$ Explanation:
$\text{(2a)}$: use $z=x+iy$ where $x=\left(n+\frac12\right)\pi$
$\text{(2b)}$: $\log(1+iy/x)=O(y/x)$
$\text{(2c)}$: evaluate the integral

Integrating around the lower-right quadrant, we get the integral along the positive real axis by substituting $z=x$ and the integral along the negative imaginary axis by substituting $z=-ix$.

As the integrand dies away like $e^{-y}$ as $-y\to-\infty$, we will compute the integral along $\left(n+\frac12\right)\pi-iy$, giving an error of $O\!\left(e^{-x}\right)$. $$ \begin{align} -\frac1{2i}\int_{\left(n+\frac12\right)\pi}^{\left(n+\frac12\right)\pi-i\infty}\log(z)\,e^{-iz}\,\mathrm{d}z &=\frac1{2}\int_0^\infty(\log(x)+\log(1-iy/x))\,e^{-ix-y}\,\mathrm{d}y\tag{3a}\\ &=-\frac{i}2(-1)^n\int_0^\infty\left(\log(x)+O(y/x)\right)e^{-y}\,\mathrm{d}y\tag{3b}\\[3pt] &=-\frac{i}2(-1)^n\log\left(\left(n+\tfrac12\right)\pi\right)+O\!\left(\frac1n\right)\tag{3c} \end{align} $$ Explanation:
$\text{(3a)}$: use $z=x-iy$ where $x=\left(n+\frac12\right)\pi$
$\text{(3b)}$: $\log(1-iy/x)=O(y/x)$
$\text{(3c)}$: evaluate the integral

Thus, the sum of the integral along both arcs is $O\!\left(\frac1n\right)\to0$.

robjohn
  • 345,667