4. Let $f(x)=\cos (\cos (\cos (\cos (\cos (\cos (\cos (\cos x)))))))$, and suppose that the number $a$ satisfies the equation $a=\cos a$. Express $f^{\prime}(a)$ as a polynomial in $a$.
Solution: $\quad a^{8}-4 a^{6}+6 a^{4}-4 a^{2}+1$
This is an exercise using the chain rule. Define $f_{0}(x)=x$ and $f_{n}(x)=\cos f_{n-1}(x)$ for $n \geq 0$. We will show by induction that $f_{n}(a)=a$ and $f_{n}^{\prime}(a)=(-\sin a)^{n}$ for all $n$. The case $n=0$ is clear. Then $f_{n}(a)=\cos f_{n-1}(a)=\cos a=a$, and
$$
f_{n}^{\prime}(a)=f_{n-1}^{\prime}(a) \cdot\left(-\sin f_{n-1}(a)\right)=(-\sin a)^{n-1} \cdot(-\sin a)=(-\sin a)^{n}
$$
by induction. Now, $f(x)=f_{8}(x)$, so $f^{\prime}(a)=(-\sin a)^{8}=\sin ^{8} a$. But $\sin ^{2} a=1-$ $\cos ^{2} a=1-a^{2}$, so $f^{\prime}(a)=\left(1-a^{2}\right)^{4}=a^{8}-4 a^{6}+6 a^{4}-4 a^{2}+1$.