Yugoslavia team selection for IMO 1987 (functions) $f(x)=\frac{\sqrt{2+\sqrt{2}}\;x\;+\;\sqrt{2-\sqrt2}}{-\sqrt{2-\sqrt{2}}\, x\;+\;\sqrt{2+\sqrt2}}$.
Find:
$\underbrace {f(f(\ldots(f(x))\ldots)}_{1987\;times}$

Edit:
To include some basic thoughts from $5$ months ago, I tried to find a few consecutive compositions, but back then, it seemed the expressions I got applying a composition a few times in a row, it got complicated and I wasn't proficient enough to notice a pattern.
 A: This is probably not the intended solution, but here's a way to look at that problem using complex numbers :
For $z=a+ib \in \mathbb{C}$, denote $h_z(x) = \frac{\ \ ax+b}{-bx+a}$. Notice that composition of such functions behave like product of complex numbers : for all $z_1, z_2 \in \mathbb{C}$, we have
$$h_{z_1} \circ h_{z_2} = h_{z_1 \times z_2}$$
Now denote
$$c = \frac{\sqrt{2+\sqrt{2}}}{2}, \qquad s = \frac{\sqrt{2-\sqrt{2}}}{2}, \qquad \omega = c+is$$
We can rewrite your function as $f(x)=\frac{\ \ cx+s}{-sx+c}$, so it means $f=h_{\omega}$. And because of the above relation, we get 
$$\underbrace{f \circ f \circ \ldots \circ f}_{1987 \text{ times}} = h_{\omega^{1987}}$$
So we need to compute $\omega^{1987}$. To do that, first compute that $\omega^2 = \frac{1+i}{\sqrt{2}} = e^{i\pi/4}$. This means that $\omega$ is a square root of $e^{i\pi/4}$, so either $\omega = e^{i\pi/8}$ or $\omega = -e^{i\pi/8}$. But since $c \ge 0$, we finally get $\omega = e^{i\pi/8}$. This enables us to compute the powers of $\omega$ really easily (because $\omega^{16} = e^{i\frac{16 \pi}{8}} = 1$ and $\omega^{-1} = e^{-i\pi/8} = \overline{\omega}$). By writing $1987 = 16 \times 124 + 3$, we finally get
$$\omega^{1987} = \omega^{3} = \omega^4 \times \frac{1}{\omega} = i \overline{\omega} = s+ic$$
And to conclude
$$\underbrace{f \circ f \circ \ldots \circ f}_{1987 \text{ times}}(x) = h_{s+ic}(x) = \frac{sx + c}{-cx + s} = \frac{\sqrt{2-\sqrt{2}}x + \sqrt{2+\sqrt{2}}}{-\sqrt{2+\sqrt{2}}x + \sqrt{2-\sqrt{2}}}$$
A: Note that $$\sqrt {2+\sqrt 2}\sqrt {2-\sqrt 2}=\sqrt 2$$
Which simplifies the function to $$f(x) = \frac {(1+\sqrt 2 )x+1}{-x+(1+\sqrt 2)}$$
$$f(f(x))= \frac {1+x}{1-x}$$
$$f^{(4)}(x) = \frac {-1}{x}$$ $$f^{(8)}(x)=x \implies f^{(1984)}(x)=x$$
Thus $$f^{(1987)} = f^3(x) = \frac {x+(1+\sqrt 2)}{-(1+\sqrt 2)x+1}$$
