# Graph of Composite Sine and Cosine Function

I was playing around with a graphing calculator and I noticed that if you repeatedly apply sines and cosines in this manner:

$$\sin(\cos(...{\sin (\cos{(\sin(x)}))))}$$

its graph flattens out. Why is this so?

• $f(f(f(f(f(f(f(\ldots \sin(x))))))$ with $f(x) = \sin(\cos(x))$. what you get is related to the fixed point theorem. Commented Mar 21, 2016 at 2:30
• The same concept of fixed point, here you have two of them really, the solutions to $sin^{-1} a = b$ and $cos^{-1} b = a$. Here you may find that $a = 0.69482\ldots$ and $b = 0.768169\ldots$. So now applying more cosines and sines is just going to have the graph fluctuate between these two points. It really doesn't flatten out, it oscillates between these two points. Commented Mar 21, 2016 at 2:38

There is an important idea in functional analysis called a contraction map. A contraction map is a function $f$ such that there is a positive number $a<1$ such that for any two distinct points $x$ and $y$, $$\left|\frac{f(x)-f(y)}{x-y}\right|<a.$$ If $f$ is differentiable, then you can think of this as the slope of $f$ is always less than $a$, which is in turn less than $1$. The importance of contraction maps comes from the fact that we re guaranteed the existence of a unique fixed point $x$ such that $f(x)=x$. Moreover, starting from any point $y$, the sequence $\{f(y),f(f(y)),f(f(f(y))),...\}$ converges to $x$. So if $\cos(\sin(x))$ is a contraction map, then it makes sense that repeatedly applying this function would pull all points close to the unique fixed point, making the graph almost constant. To see that $\cos(\sin(x))$ is a contraction map, we take a derivative: $$\frac{d}{dx}\cos(\sin(x))=-\sin(sin(x))\cos(x).$$ Though it is hardly a proof, a quick graph of the derivative should be enough to convince you that the absolute value of the derivative is less than $.5$. The mean value theorem then gives us that your function is a contraction map.

• Analytically, $\sin(x)\in [-1,1]\subset (-\pi/3,\pi/3)$. Hence, $\sin(\sin(x))\in (-\sqrt 3/2,\sqrt 3/2)$. Therefore, $|\sin(\sin(x))\cos(x)| < \sqrt 3/2$ for all $x$. Commented Mar 21, 2016 at 3:41
• Good. Succinct, Commented Mar 21, 2016 at 3:42

If you choose a function $f(x)$ like: $$f(x)=\sin(\cos(x)))$$ Then the problem that you propose can be reduced to consider an iterative sequence of the form: $$a_n = f(a_{n-1})$$ And finally ask: $$\lim_{n\to\infty} a_n = L?$$ You can solve this, without loss of generality for any function, through the following equation: $$\dfrac{a_{n+1}}{a_n} = \ell$$

Where the value of $\ell$ can take 3 general cases:

1. $\ell > 1 \quad\Rightarrow\quad a_{n+1} > a_{n}$ (the "new" point $a_{n+1}$ "moves more positively" from $a_n$).
2. $\ell < 1 \quad\Rightarrow\quad a_{n+1} < a_{n}$ (the "new" point $a_{n+1}$ "moves more negatively" from $a_n$).
3. $\ell = 1 \quad\Rightarrow\quad a_{n+1} = a_{n}$ (the point "doesn't move anywhere").

Therefore, everything depends on the value that acquires $\ell$ and how is the behavior of each $a_{n+1}$ (behavior of $f(x)$ evaluated on $a_n$) from each $a_n$, respectively. So, you can calculate the "points that doesn't move anywhere" when $\ell$ satisfies the equation: $$\ell = 1 \quad \Rightarrow \quad \dfrac{a_{n+1}}{a_n} = \dfrac{f(a_n)}{a_n} = 1 \quad \Rightarrow \quad f(a_n) = a_n$$

Note that this is what others users named as fixed point. In the case of the problem you proposed the fixed point is $x = 0.69482...$

However, it's important to remember that the fact that $f(x)$ has a fixed point, doesn't mean necessarily that the iterative sequence $a_n = f(a_{n-1})$ should converge to the fixed point from any $a_{0}\in\mathbb{R}$ (which is what you can see on your graphing calculator).

One way to ensure that the iterative sequence converge to the fixed point from any value $a_0\in\mathbb{R}$, it's to ensure that the sequence $a_1,a_2,a_3,...$ takes ever closer to the fixed point. Note that no matter if the sequence is approaching from a more positive or more negative value, or even if you are "jumping" around the fixed point (like your case); What matters is approaching from any $a_0\in\mathbb{R}$.

This concept extended to complex numbers is intuitively what is known as "a contraction map". (see the image below).

Intuitive idea of a Contraction Map of T(x) over a value x

At this point, you can resume Alex's response.