# A series about iterated cosine

I was swiping through my Twitter timeline and saw this tweet:

It is well known that repeatedly applying to any real number converges to the only real solution to This can be proven using the intermediate value theorem and the mean value theorem. Yet at first sight, it might come as a surprise that the series mentioned in the tweet uniformly converges to a differentiable function, because the remainder could be pathological without looking into the actual function being iterated. However, once you start using a scratch paper, it becomes ‘of course it’s like this’.

We want to bound uniformly. First, by some (not so numerical) computation, so for all Next, by Lagrange’s mean value theorem, we have for some between and Therefore, we know which implies for all

Now that by Weierstrass criterion, the series converges uniformly.

Next we want to show that the sum is differentiable. To this end, consider the term-by-term derivative where Since again by Weierstrass criterion, converges uniformly. Together with that each is continuous thus integrable, we know that is also continuous and that the integration of equals the sum of the term-by-term integration of By how we did the term-by-term derivative in the first place, which readily gives whence by the fundamental theorem of calculus.