2

Why does $x_0 + \sin(x_0) \approx \pi$ when computing this multiple times on the calculator?

So for any value of up to $\approx 6.25$, doing the following operation ($x_0 + \sin(x_0)$, then the newly obtained value (let's call it $x_1$) is replaced instead of $x_0$: $x_1 + \sin(x_1)$) many times leads to a value, which is very close to $\pi$.

However, when going above that value, this will result in roughly $3\pi$, $5\pi$, etc.

Could anyone please try to explain why the simple first calculation works?

EDIT: Thank you so much for your answers guys - through a combination of the many, I believe to now understand why!

4 Answers4

2

Have a look at this related post where it is shown that the sequence $$ \begin{cases} x_{0} = c & \\ x_{n} = x_{n - 1} + \sin (x_{n - 1} ) & \end{cases} $$ graphically translates into the following picture sin@sin_2

Have a look there to see the conclusion about the attractor points being $\pi +2k \pi$

G Cab
  • 35,272
0

Observing that $\sin x$ is bounded from above by the line $\pi - x$ over $x\le\pi$ and, they eventually meet at the bound $x=\pi$ . Therefore,

$$x_n = x_{n-1} + \sin x_{n-1} \le x_{n-1} + (\pi - x_{n-1}) = \pi$$

i.e.

$$ x_n \le \pi$$

It is also true that,

$$x_n - x_{n-1} = \sin x_{n-1} > 0$$

i.e. $x_n$ already increases with every iteration.

Thus, starting with $x_0 < \pi$ and with each iteration, the successive $x_n$ keeps increasing by $\sin x_{n-1}$, until it reaches the its upper bound $\pi$.

Quanto
  • 97,352
  • Some lower bound on $x_0$ is also needed... – Ian Aug 15 '19 at 13:19
  • 1
    It does not prove that the limit is $\pi$, just that the limit exists and it's $\leqslant \pi$. In fact, let $x_n=\tanh(n)$. Then we have that $x_{n-1}<x_{n}<\pi$, but it does not go to $\pi$. – Botond Aug 15 '19 at 13:19
  • Unlike $\sin x$ and $x-\pi$, $\tanh (x)$ and $\pi$ never meet, which is irrelevant. – Quanto Aug 16 '19 at 17:26
0

Consider $u_n=x_n-\pi$, then as $\sin(u+k\pi)=(-1)^k\sin(u)$, $$ u_{n+1}=u_n-\sin(u_n)=\frac{u_n^3}{6}-\frac{u_n^5}{120}+... $$ This shows cubic convergence, this iteration will rapidly converge to $0$ after the iteration reaches a neighborhood of $0$. By the first term of the series expansion this is true for $|u_0|<\sqrt6$, $\pi-\sqrt6<x_0<\pi+\sqrt6$. By the higher degree terms this can be true for a larger interval, the "graphical" properties of the sine give the convergence for $|u_0|<\pi$.

Note that for a valid method to compute $\pi$ you can not use $\pi$ in the computation of $\sin(x_n)$. One can use the usual reduction tricks to accelerate convergence for exponential values, for instance $$ \cos(x_n)+i\sin(x_n)=(\cos(2^{-k}x_n)+i\sin(2^{-k}x_n))^{2^k} $$ for some moderately large $k$.

Lutz Lehmann
  • 126,666
0

You start with $x_0 \in \mathbb R$ and define recursively for $n \ge 0$ $$x_{n+1} = x_n + \sin x_n .$$ What can we say about the convergence of the sequence $(x_n)$?

If it converges to some $x \in \mathbb R$, then necessarily $$x = \lim x_{n+1} = \lim (x_n + \sin x_n) = \lim x_n + \lim \sin x_n = \lim x_n + \sin (\lim x_n) = x + \sin x .$$ This means $\sin x = 0$, i.e. $x = k\pi$ for some $k \in \mathbb Z$.

Case 1. $x_0 = k\pi$.

Then all $x_n = x_0$. Hence $(x_n)$ is a constant sequence which trivially converges to $k\pi$.

Case 2. $0 < x_0 < \pi$.

We claim that $(x_n)$ is strictly monotonically increasing such that all $x_n < \pi$. Hence it converges to some $x \in [x_0,\pi]$ and our above limit consideration shows $x = \pi$. The claim is easily proved by induction using the following facts:

  1. For $0 < \xi < \pi$ we have $\sin \xi > 0$ which implies $\xi < \xi + \sin \xi$.

  2. For $0 < \eta$ we have $\sin \eta < \eta$. For $\xi < \pi$ we therefore get $\xi + \sin \xi = \xi + \sin (\pi -\xi) < \xi + \pi - \xi = \pi$.

Case 3. $2r\pi < x_0 < (2r+1)\pi$.

Then $(x_n)$ is strictly monotonically increasing such that all $x_n < (2r+1)\pi$ and $\lim x_n = (2r+1)\pi$. This follows from Case 2 by considering the sequence $x'_n = x_n - 2r\pi$. Note that $$x'_{n+1} = x_{n+1} - 2r\pi = x_n + \sin x_n - 2r\pi = x_n - 2r\pi + \sin (x_n - 2r\pi) = x'_n + \sin x'_n .$$

Case 4. $(2r-1)\pi < x_0 < 2r\pi$.

Then $(x_n)$ is strictly monotonically decreasing such that all $x_n > (2r-1)\pi$ and $\lim x_n = (2r-1)\pi$. This follows from Case 3 by considering the sequence $x'_n = -x_n$. Note that that $2(-r)\pi = -2r\pi < x'_0 = -x_0 < -(2r-1)\pi = (2(-r)+1)\pi$ and $$x'_{n+1} = -x_{n+1} = -x_n - \sin x_n = -x_n +\sin(-x_n) = x'_n +\sin x'_n . $$

Paul Frost
  • 76,394
  • 12
  • 43
  • 125