Show that $\int_0^1 \left \lbrace (-1)^{\left \lceil \frac{1}{x} \right \rceil }\frac{1}{x} \right \rbrace \, {\rm d}x = \frac{\pi}{2}$

137 Views Asked by At

Show that $$\displaystyle{\int_0^1 \left \lbrace (-1)^{\left \lceil \frac{1}{x} \right \rceil }\frac{1}{x} \right \rbrace \, {\rm d}x = \frac{\pi}{2}}$$

My try

$$\displaystyle{\int\limits_0^1 {\left\{ {{{\left( { - 1} \right)}^{\left[ {1/x} \right]}}\frac{1}{x}} \right\}dx} = \mathop = \limits^{x \to 1/x} = \int\limits_1^\infty {\left\{ {{{\left( { - 1} \right)}^{\left[ x \right]}}x} \right\}\frac{1}{{{x^2}}}dx} = }$$ $$\displaystyle{\sum\limits_{n = 1}^\infty {\left( {\int\limits_{2n - 1}^{2n} {\left\{ {{{\left( { - 1} \right)}^{\left[ x \right]}}x} \right\}\frac{1}{{{x^2}}}dx} + \int\limits_{2n}^{2n + 1} {\left\{ {{{\left( { - 1} \right)}^{\left[ x \right]}}x} \right\}\frac{1}{{{x^2}}}dx} } \right)} = }$$

$$\displaystyle{ = \sum\limits_{n = 1}^\infty {\left( {\int\limits_{2n - 1}^{2n} {\left\{ { - x} \right\}\frac{1}{{{x^2}}}dx} + \int\limits_{2n}^{2n + 1} {\left\{ x \right\}\frac{1}{{{x^2}}}dx} } \right)} = }$$ $$\displaystyle{\sum\limits_{n = 1}^\infty {\left( {\int\limits_{2n - 1}^{2n} {\left( {1 - \left\{ x \right\}} \right)\frac{1}{{{x^2}}}dx} + \int\limits_{2n}^{2n + 1} {\left\{ x \right\}\frac{1}{{{x^2}}}dx} } \right)}}$$

I'm not sure about the closed form; my friends say it's either $\log\left(\frac{\pi}{2}\right)$, $1 - \log\left(\frac{\pi}{2}\right)$, or $\frac{\pi}{2}$.

3

There are 3 best solutions below

0
On

Whatever we do, the ceiling function is going to cause difficulties with the integration at some point (as it's discontinuous). So let's start by doing something about that. Let $N$ be a positive integer and $y=\frac{1}{x}$, and define $$I_N=\int_\frac{1}{2N+1}^1 \left \lbrace (-1)^{\left \lceil \frac{1}{x} \right \rceil }\frac{1}{x} \right \rbrace dx = \int_1^{2N+1} \frac{1}{y^2}\left \lbrace (-1)^{\left \lceil y \right \rceil }y \right \rbrace dy $$

Now we can get rid of the ceiling function and the power of $-1$ by considering cases when $2n-1< y \le 2n$ and when $2n< y\le 2n+1$:

$$\begin{align*}I_N&=\sum_{n=1}^N \left[ \int_{2n-1}^{2n} \frac{1}{y^2}\left \lbrace (-1)^{\left \lceil y \right \rceil }y \right \rbrace dy + \int_{2n}^{2n+1} \frac{1}{y^2}\left \lbrace (-1)^{\left \lceil y \right \rceil }y \right \rbrace dy \right] \\ &=\sum_{n=1}^N \left[ \int_{2n-1}^{2n} \frac{1}{y^2}\left \lbrace y \right \rbrace dy + \int_{2n}^{2n+1} \frac{1}{y^2}\left \lbrace -y \right \rbrace dy \right] \\ &=\sum_{n=1}^N \left[ \int_{2n-1}^{2n} \frac{1}{y^2}\left \lbrace y \right \rbrace dy + \int_{2n}^{2n+1} \frac{1}{y^2}\left \lbrace 1-y \right \rbrace dy \right] \end{align*}$$

Now, with the substitution $u=y-(2n-1)$, $$\int_{2n-1}^{2n} \frac{1}{y^2}\left \lbrace y \right \rbrace dy = \int_0^1 \frac{u}{(u+2n-1)^2} du=\log\frac{2n}{2n-1}-\frac{1}{2n}$$

and with $v=y-2n$, $$\int_{2n}^{2n+1} \frac{1}{y^2}\left \lbrace 1-y \right \rbrace dy =\int_0^1 \frac{1-v}{(v+2n)^2} dv=\log\frac{2n}{2n+1}+\frac{1}{2n}$$

so that $$\begin{align*} I_N&=\sum_{n=1}^N \left[\log\frac{2n}{2n-1}-\frac{1}{2n} + \log\frac{2n}{2n+1}+\frac{1}{2n}\right] \\ &=\sum_{n=1}^N \log\frac{4n^2}{4n^2-1} \end{align*}$$

Letting $N\to \infty$, this is the logarithm of the well-known Wallis product formula for $\frac{\pi}{2}$; so the value of the original integral is $\boxed{\log\frac{\pi}{2}}$.

0
On

I'd be careful about performing substitutions before converting the integrand into a sum. Let $$f(x) = \left\{\frac{(-1)^{\lceil 1/x \rceil}}{x}\right\},$$ where as usual $\{x\} = x - \lfloor x \rfloor$ denotes the fractional part of $x$. Then on each interval $x \in [\frac{1}{k+1}, \frac{1}{k})$ for $k \in \mathbb Z^+$, we have $k < \frac{1}{x} \le k+1$ hence $\lceil \frac{1}{x} \rceil = k+1$; thus when $k$ is odd, $f(x) = \frac{1}{x} - k$, and when $k$ is even, $f(x) = k+1 - \frac{1}{x}$. Consequently,

$$\begin{align} \int_{x=0}^1 f(x) \, dx &= \sum_{k=1}^\infty \int_{x=1/(k+1)}^{1/k} f(x) \, dx \\ &= \sum_{m=1}^\infty \left( \int_{x=1/(2m)}^{1/(2m-1)} \frac{1}{x} - (2m-1) \, dx + \int_{x=1/(2m+1)}^{1/(2m)} 2m + 1 - \frac{1}{x} \, dx \right) \\ &= \sum_{m=1}^\infty \left( \log \frac{2m}{2m-1} - \frac{1}{2m} + \frac{1}{2m} - \log \frac{2m+1}{2m}\right) \\ &= \sum_{m=1}^\infty \log \frac{4m^2}{4m^2-1} \\ &= \log \prod_{m=1}^\infty \frac{4m^2}{4m^2-1} \\ &= \log \frac{\pi}{2} \approx 0.451583 \ldots. \end{align}$$

where in the penultimate step we recognize the infinite product as the familiar Wallis product.

A straightforward argument as to why the value of the integral cannot be $\pi/2$ is that on $x \in (0,1]$, we clearly have $0 \le f \le 1$, thus its integral is bounded above by $1$.

0
On

\begin{align*} \int_{0}^{1}\left \{ (-1)^{\left \lfloor 1/x \right \rfloor} \frac{1}{x} \right \}\, {\rm d}x &\overset{u=1/x}{=\! =\! =\!} \int_{1}^{\infty} \left \{ (-1)^{\left \lfloor x \right \rfloor} x \right \} \frac{{\rm d}x}{x^2} \\ &=\sum_{n=1}^{\infty} \left[ \int_{2n-1}^{2n} \left \{ (-1)^{\left \lfloor x \right \rfloor} x \right \} \frac{{\rm d}x}{x^2} + \int_{2n}^{2n+1} \left \{ (-1)^{\left \lfloor x \right \rfloor} x \right \} \frac{{\rm d}x}{x^2} \right]\\ &= \sum_{n=1}^{\infty} \left [ \int_{2n-1}^{2n} \frac{\left \{ -x \right \}}{x^2}\, {\rm d}x + \int_{2n}^{2n+1} \frac{\left \{ x \right \}}{x^2} \, {\rm d}x \right ]\\ &= \sum_{n=1}^{\infty} \left [ \int_{2n-1}^{2n} \frac{1-\left \{ x \right \}}{x^2} \, {\rm d}x+ \int_{2n}^{2n+1} \frac{\left \{ x \right \}}{x^2} \, {\rm d}x \right ]\\ &= \sum_{n=1}^{\infty} \int_{2n-1}^{2n} \frac{{\rm d}x}{x^2} - \sum_{n=1}^{\infty} \left [ \int_{2n-1}^{2n} \left ( x-2n+1 \right )\frac{{\rm d}x}{x^2} - \int_{2n}^{2n+1} (x-2n) \frac{{\rm d}x}{x^2} \right ]\\ &= \sum_{n=1}^{\infty} \left [ \frac{1}{2n-1} - \frac{1}{2n} \right ] - \sum_{n=1}^{\infty} \left [ \int_{2n-1}^{2n}\frac{{\rm d}x}{x} - (2n-1) \int_{2n-1}^{2n}\frac{{\rm d}x}{x^2} - \int_{2n}^{2n+1} \frac{{\rm d}x}{x} +2n \int_{2n}^{2n+1} \frac{{\rm d}x}{x^2} \right ]\\ &= \sum_{n=1}^{\infty} \left [ \frac{1}{2n-1} - \frac{1}{2n} \right ] - \sum_{n=1}^{\infty} \left [ \log \frac{4n^2}{(2n-1)(2n+1)} - \frac{1}{2n} + \frac{1}{2n+1} \right ] \\ &=\sum_{n=1}^{\infty}\left [ \frac{1}{2n-1} - \frac{1}{2n} \right ] + \sum_{n=1}^{\infty} \left [ \frac{1}{2n} - \frac{1}{2n+1} \right ] - \log \prod_{n=1}^{\infty} \left ( 1+ \frac{1}{4n^2-1} \right ) \\ &=\cancel{\log 2- \log 2} +1- \log \frac{\pi}{2} \\ &=1- \log \frac{\pi}{2} \end{align*}

because

\begin{align*} \sum_{n=1}^{\infty} \left [ \frac{1}{2n-1} - \frac{1}{2n} \right ] &= \sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n}\\ &= \sum_{n=1}^{\infty} \frac{(-1)^{n-1} 1^n}{n}\\ &= \log (1+1) \\ &=\log 2 \end{align*}

and similarly the second sum. Now that product is actually very famous but if we want a proof we are using the Stirling approximation of

\begin{equation} n! \sim \sqrt{2\pi n} \left ( \frac{n}{e} \right )^n \end{equation}

thus:

\begin{align*} \log \prod_{n=1}^{\infty} \left ( 1+ \frac{1}{4n^2-1} \right ) &=\lim_{n \rightarrow +\infty} \log \frac{4^n (n!)^2 }{1\cdot 3^2 \cdot 5^2 \cdots (2n-1)^2\cdot (2n+1)} \\ &= \lim_{n \rightarrow +\infty} \log \frac{4^{2n} (n!)^4}{\left ( (2n)! \right)^2 \left ( 2n+1 \right )}\\ &\overset{(1)}{=} \lim_{n \rightarrow +\infty} \log \frac{4^{2n} (2\pi n)^2 \left ( \frac{n}{e} \right )^{4n}}{(4\pi n) \left ( \frac{2n}{e} \right )^{4n} (2n+1)}\\ &= \lim_{n \rightarrow +\infty} \log \frac{\left ( 2\pi n \right )^2}{(4\pi n) (2n+1)} \\ &=\log \frac{\pi}{2} \end{align*}