2. Let

$$
f(x)=\frac{\sqrt{2+\sqrt{2}} x+\sqrt{2-\sqrt{2}}}{-\sqrt{2-\sqrt{2}} x+\sqrt{2+\sqrt{2}}} .
$$

Determine

$$
\underbrace{f(f \ldots(f}_{1987}(x)) \ldots)
$$
Solution. For the function of the form $f(x)=\frac{a x+b}{-b x+a}$, where $a$ and $b$ are real numbers, we associate the complex number $z=a+i b$. Furthermore, if $f_{1}(x)=\frac{a_{1} x+b_{1}}{-b_{1} x+a_{1}}$ and $f_{2}(x)=\frac{a_{2} x+b_{2}}{-b_{2} x+a_{2}}$, then

$$
f_{1} \circ f_{2}(x)=f_{1}\left(f_{2}(x)\right)=\frac{\left(a_{1} a_{2}-b_{1} b_{2}\right) x+\left(a_{1} b_{2}+b_{1} a_{2}\right)}{-\left(a_{1} b_{2}+b_{1} a_{2}\right) x+\left(a_{1} a_{2}-b_{1} b_{2}\right)}
$$

According to this, if the functions $f_{1}$ and $f_{2}$ are associated with the complex numbers $z_{1}$ and $z_{2}$, then the function $f_{1} \circ f_{2}$ is associated with the complex number $z_{1} z_{2}$. Since

$$
\cos \frac{\pi}{8}=\sqrt{\frac{1}{2}\left(1+\cos \frac{\pi}{4}\right)}=\frac{1}{2} \sqrt{2+\sqrt{2}}, \sin \frac{\pi}{8}=\frac{1}{2} \sqrt{2-\sqrt{2}}
$$

we obtain that the given function is associated with the number $z=\cos \frac{\pi}{8}+i \sin \frac{\pi}{8}$. Therefore, the function

$$
\underbrace{f(f \ldots(f}_{1987}(x)) \ldots)=f_{1987}(x)
$$

is associated with the number $\left(\cos \frac{\pi}{8}+i \sin \frac{\pi}{8}\right)^{1987}=\cos \frac{3 \pi}{8}+i \sin \frac{3 \pi}{8}$. However,

$$
\cos \frac{3 \pi}{8}=\cos \left(\frac{\pi}{4}+\frac{\pi}{8}\right)=\frac{1}{2} \sqrt{2-\sqrt{2}}, \sin \frac{3 \pi}{8}=\frac{1}{2} \sqrt{2+\sqrt{2}}
$$

so

$$
f_{1987}(x)=\frac{\sqrt{2-\sqrt{2}} x+\sqrt{2+\sqrt{2}}}{-\sqrt{2+\sqrt{2}} x+\sqrt{2-\sqrt{2}}}
$$