Show that $\int_a^b \sin\left(x+\frac{1}{x}\right) dx <3.$

Solution 1:

Claim. For any interval $I\subset\Bbb R$ we have $\int_I\sin(x+1/x)\,dx<3$.

Proof: Since $F(x)=\sin(x+1/x)$ is odd, the statement becomes $\int_a^bF(x)\,dx<3$ where $a,b>0$. By fixing $a$, we see by differentiation that the integral is optimised when $F(b)=0$. Similarly, we have $F(a)=0$, so $a,b$ are of the form $f_\pm(k)=(k\pi\pm\sqrt{(k\pi)^2-4})/2$ for $k\in\Bbb Z$.

When $a,b\in(0,f_-(1)]$, the sign of the integral alternates between consecutive roots, and the difference between these roots decreases as $k$ increases. Hence\begin{align}\int_{a=f_-(k)}^{b=f_-(\ell)_{\ell<k}}F(x)\,dx&<\sum_{n=2}^\infty(f_-(2n)-f_-(2n+1))\\&=\sum_{n=2}^\infty\frac{-\pi+\sqrt{(2n+1)^2\pi^2-4}-\sqrt{(2n)^2\pi^2-4}}2\\&<\sum_{n=2}^\infty\frac1{n^2}=\zeta(2)-1.\end{align} When $a,b\in[f_-(1),f_+(1)]$, we have $F(x)\le F(1)=\sin2$ so $$\int_{a=f_-(1)}^{b=f_+(1)}F(x)\,dx<(f_+(1)-f_-(1))\sin2=\sqrt{\pi^2-4}\sin2.$$ When $a,b\in[f_+(k),f_+(m)_{m>k}]$, letting $t=x+1/x$ yields $$\int_{a=f_+(k)}^{b=f_+(k+1)}F(x)\,dx=\int_{k\pi}^{(k+1)\pi}p(t)\sin t\,dt$$ where $p(t)=1/(1-f_+(t/\pi)^{-2})$. Since $p(t)$ is strictly decreasing, we have $$\left|\int_{k\pi}^{(k+1)\pi}p(t)\sin t\,dt\right|<\left|\int_{(k-1)\pi}^{k\pi}p(t)\sin t\,dt\right|$$ for all $k$, with limit $\left|\int_{k\pi}^{(k+1)\pi}\sin t\,dt\right|=2$ as $\lim\limits_{t\to\infty}p(t)=1$. Thus $\int_IF(x)\,dx$ is bounded above by any consecutive combination of terms in the sequence $$\{\zeta(2)-1,\sqrt{\pi^2-4}\sin2,-2p(2\pi),2p(2\pi),-2p(4\pi),2p(4\pi),\cdots\},$$ so $$\int_I\sin\left(x+\frac1x\right)\,dx<\max\left\{\zeta(2)-1+\sqrt{\pi^2-4}\sin2,2p(2\pi)\right\}<3.\tag*{$\square$}$$

Solution 2:

Problem with the Solution in the Question

In the answer presented in the question, there is the inequality $$ \begin{align} \int_a^b\sin\left(x+\frac1x\right)\,\mathrm{d}x &=\int_a^b\left[\sin(x)\cos\left(\frac1x\right)+\cos(x)\sin\left(\frac1x\right)\right]\mathrm{d}x\tag{1a}\\ &\le\int_a^b[\sin(x)+\cos(x)]\,\mathrm{d}x\tag{1b}\\ &=\sqrt2\int_a^b\sin\left(x+\frac\pi4\right)\,\mathrm{d}x\tag{1c} \end{align} $$ which, as suspected, is not true because cancellation can go on on the right side of the inequality, as wells as on the left side.

For example, consider the integral over $[\pi/2,\pi]$. Since $\sin(x)$ is decreasing for $x\in\left[\frac\pi2,\frac{3\pi}2\right]$ and since $x+\frac1x\le x+\frac2\pi\lt x+\frac\pi4$, we have that $\sin\left(x+\frac1x\right)\gt\sin\left(x+\frac\pi4\right)$. That is, $$ \begin{align} \int_{\pi/2}^\pi\sin\left(x+\frac1x\right)\,\mathrm{d}x &\gt\int_{\pi/2}^\pi\sin\left(x+\frac\pi4\right)\,\mathrm{d}x\tag{2a}\\ &=\sqrt2\int_{\pi/2}^\pi\sin\left(x+\frac\pi4\right)\,\mathrm{d}x\tag{2b} \end{align} $$ Explanation:
$\text{(2a)}$: $\sin\left(x+\frac1x\right)\gt\sin\left(x+\frac\pi4\right)$ on $[\pi/2,\pi]$
$\text{(2b)}$: $\int_{\pi/2}^\pi\sin\left(x+\frac\pi4\right)\,\mathrm{d}x=0$

Numerically, $\int_{\pi/2}^\pi\sin\left(x+\frac1x\right)\,\mathrm{d}x=0.496435$.


A Possibly Better Approach

For $n\ge1$, let $\alpha_n=\frac{n\pi+\sqrt{n^2\pi^2-4}}2$ be the $n^\text{th}$ zero of $\sin\left(x+\frac1x\right)$ above $1$, and $\beta_n=\frac{n\pi-\sqrt{n^2\pi^2-4}}2$ be the $n^\text{th}$ zero of $\sin\left(x+\frac1x\right)$ below $1$. Let us now compute the integrals between the zeros.

Between $\boldsymbol{\beta_1}$ and $\boldsymbol{\alpha_1}$: For $x\in[2,\pi]$, $\frac{\sin(2)}{\pi-2}(\pi-x)\le\sin(x)\le\pi-x$. Therefore, $$ \begin{align} I(C) &=\int_{\beta_1}^{\alpha_1}\sin\left(x+\frac1x\right)\,\mathrm{d}x\tag{3a}\\ &=\int_{\beta_1}^{\alpha_1}\left(\pi-x-\frac1x\right)\left[\frac{\sin(2)}{\pi-2},1\right]_\#\mathrm{d}x\tag{3b}\\ &=\left(\frac\pi2\sqrt{\pi^2-4}-2\log\left(\frac{\pi+\sqrt{\pi^2-4}}2\right)\right)\left[\frac{\sin(2)}{\pi-2},1\right]_\#\tag{3c}\\[6pt] &=[1.401196175043,1.7591551592215]_\#\tag{3d} \end{align} $$ Explanation:
$\text{(3a)}$: definition
$\text{(3b)}$: on $[\beta_1,\alpha_1]$, $2\le x+\frac1x\le\pi$,
$\phantom{\text{(3b):}}$ so $\sin\left(x+\frac1x\right)=\left(\pi-x-\frac1x\right)\left[\frac{\sin(2)}{\pi-2},1\right]_\#$
$\phantom{\text{(3b):}}$ where $[a,b]_\#$ represents a real number in $[a,b]$
$\text{(3c)}$: integrate and apply the Mean Value Theorem for Integrals
$\text{(3d)}$: evaluate (Mathematica says the integral is $1.518576937887$)

Between $\boldsymbol{\alpha_n}$ and $\boldsymbol{\alpha_{n+1}}$: For $x\in[\alpha_n,\alpha_{n+1}]$, $x+\frac1x\in[n\pi,(n+1)\pi]$, so $\sin\left(x+\frac1x\right)$ does not change sign. Furthermore, $\frac1{1-1/x^2}\in\left[\frac{\alpha_{n+1}^2}{\alpha_{n+1}^2-1},\frac{\alpha_n^2}{\alpha_n^2-1}\right]$. Therefore, $$ \begin{align} I(A_n) &=\int_{\alpha_n}^{\alpha_{n+1}}\sin\left(x+\frac1x\right)\,\mathrm{d}x\tag{4a}\\[3pt] &=\color{#C00}{\int_{\alpha_n}^{\alpha_{n+1}}\sin\left(x+\frac1x\right)\frac{1-\frac1{x^2}}{\color{#090}{1-\frac1{x^2}}}\,\mathrm{d}x}\tag{4b}\\ &=\color{#C00}{\int_{n\pi}^{(n+1)\pi}\sin(u)\color{#090}{\left[\frac{\alpha_{n+1}^2}{\alpha_{n+1}^2-1},\frac{\alpha_n^2}{\alpha_n^2-1}\right]_\#}\mathrm{d}u}\tag{4c}\\ &=\color{#C00}{(-1)^n}\color{#090}{\left[\frac{\color{#C00}{2}\alpha_{n+1}^2}{\alpha_{n+1}^2-1},\frac{\color{#C00}{2}\alpha_n^2}{\alpha_n^2-1}\right]_\#}\tag{4d} \end{align} $$ Explanation:
$\text{(4a)}$: definition
$\text{(4b)}$: multiply the integrand by $1$
$\text{(4c)}$: substitute $u=x+\frac1x$ and apply the bounds on $\frac1{1-1/x^2}$
$\text{(4d)}$: integrate and apply the Mean Value Theorem
$$ \begin{array}{c|c} n&\alpha_n&\frac{2\alpha_n^2}{\alpha_n^2-1}\\\hline 1&2.782160&2.296718\\ 2&6.119781&2.054867\\ 3&9.317452&2.023306\\ 4&12.48628&2.012911\\ 5&15.64404&2.008206 \end{array}\tag{4e} $$ enter image description here

$A_n$ lies between $\alpha_n$ and $\alpha_{n+1}$. $|I(A_n)|$ lies in $\left[\frac{2\alpha_n^2}{\alpha_n^2-1},\frac{2\alpha_{n+1}^2}{\alpha_{n+1}^2-1}\right]$.

Between $\boldsymbol{\beta_{n+1}}$ and $\boldsymbol{\beta_n}$: For $x\in[\beta_{n+1},\beta_n]$, $x+\frac1x\in[n\pi,(n+1)\pi]$, so $\sin\left(x+\frac1x\right)$ does not change sign. Furthermore, $\frac1{1-1/x^2}\in\left[-\frac{\beta_n^2}{1-\beta_n^2},-\frac{\beta_{n+1}^2}{1-\beta_{n+1}^2}\right]$. Therefore, $$ \begin{align} I(B_n) &=\int_{\beta_{n+1}}^{\beta_n}\sin\left(x+\frac1x\right)\,\mathrm{d}x\tag{5a}\\ &=\color{#C00}{\int_{\beta_{n+1}}^{\beta_n}\sin\left(x+\frac1x\right)\frac{1-\frac1{x^2}}{\color{#090}{1-\frac1{x^2}}}\,\mathrm{d}x}\tag{5b}\\ &=\color{#C00}{\int_{n\pi}^{(n+1)\pi}\sin(u)\color{#090}{\left[\frac{\beta_{n+1}^2}{1-\beta_{n+1}^2},\frac{\beta_n^2}{1-\beta_n^2}\right]_\#}\mathrm{d}u}\tag{5c}\\ &=\color{#C00}{(-1)^n}\color{#090}{\left[\frac{\color{#C00}{2}\beta_{n+1}^2}{1-\beta_{n+1}^2},\frac{\color{#C00}{2}\beta_n^2}{1-\beta_n^2}\right]_\#}\tag{5d}\\[3pt] \end{align} $$ Explanation:
$\text{(5a)}$: definition
$\text{(5b)}$: multiply the integrand by $1$
$\text{(5c)}$: substitute $u=x+\frac1x$ and apply the bounds on $\frac1{1-1/x^2}$
$\text{(5d)}$: integrate and apply the Mean Value Theorem
$$ \begin{array}{c|c} n&\beta_n&\frac{2\beta_n^2}{\beta_n^2-1}\\\hline 1&0.359433&0.296718\\ 2&0.163405&0.054867\\ 3&0.107325&0.023306\\ 4&0.080088&0.012911\\ 5&0.063922&0.008206 \end{array}\tag{5e} $$ enter image description here

$B_n$ lies between $\beta_{n+1}$ and $\beta_n$. $|I(B_n)|$ lies in $\left[\frac{2\beta_{n+1}^2}{1-\beta_{n+1}^2},\frac{2\beta_n^2}{1-\beta_n^2}\right]$.

Comparing the Areas

Comparing the results of $(3)$, $(4)$, and $(5)$, we see that $$ |I(B_n)|\le|I(C)|\le|I(A_n)|\tag6 $$ Furthermore, $|I(A_n)|$ and $|I(B_n)|$ are decreasing, and the signs of $I(A_n)$ and $I(B_n)$ are $(-1)^n$. Thus, the largest the integral can be on any interval is $I(A_2)\le2.054867$ and the least the integral can be on any interval is $I(A_1)\ge-2.296718$ (this is just the reasoning behind the Alternating Series Test applied to the left and to the right).