How can I use the contraction mapping theorem to show there is a unique solution to $x=\cos x$ and get a reasonable estimation?
Im struggling to use the theorem in this particular case so any help will be great!
How can I use the contraction mapping theorem to show there is a unique solution to $x=\cos x$ and get a reasonable estimation?
Im struggling to use the theorem in this particular case so any help will be great!
Since $\cos(\mathbb{R}) = [-1,1]$, there is no fixed point outside $[-1,1]$, we can restrict to those $x \in [-1,1]$. Since $\cos([-1,1]) = [\cos 1,1]$, there is no fixed point outside $[\cos 1,1]$, we can restrict $x$ further. Let's just restrict $x$ to $[0,1]$.
For $x \ne y \in [0,1]$, we can apply mean value theorem to find a $\xi$ between $x$ and $y$ such that
$$|\cos x - \cos y| = |\sin \xi\cdot( x - y)| \le \sin 1| x - y|$$
Since $0 < \sin 1 < 1$, the map $x \mapsto \cos x$ is a contraction mapping when restricted to $[0,1]$. By contraction mapping theorem, the equation $x = \cos x$ has an unique fixed point in $[0,1]$ and hence over all $\mathbb{R}$.
Even contraction mapping theorem guarantee the existence of an unique fixed point. Direct iteration $x \mapsto \cos x$ will not be very efficient in locating the fixed point.
By brute force, one can check that $x = \cos x$ has a fixed point at $x_{f} \sim 0.73908513321516$.
Since the derivative of $\cos x$ at $x_{f}$ is $-\sin(x_f) \sim -0.67361202918321$ and
$\left|\log_{10}(x_f)\right|$ $\sim 0.17159016592461$. If you start with a number close to $x_f$ and attempt to improve it by iteration, you need about 6 iterations to gain one more digit of accuracy.
If you insists on using contraction mapping to get an estimate of the fixed point, you need to rewrite it to make the scaling constant in the contraction mapping smaller. For example, if you rewrite $$x = \cos x \quad\longleftrightarrow\quad x = f(x) \stackrel{def}{=} \frac{3 \cos x + 2 x}{5}$$ You can check $x \mapsto f(x)$ is again an contraction mapping on $[0,1]$ with same fixed point $x_f$. However, with only 3 iterations of $f$, you already get an estimate
$$x_f \sim f(f(f(1))) \sim 0.73908508052689$$
which is accurate to order $10^{-7}$.