# Roots of polynomials combined with Trigonometric Functions

If $$f(x) = x^2 + ax + d \cos x$$, where $a$ is an integer and $d$ is a real number, what are all possible values of the tuple $(a,d)$ such that $f(x)$ and $f(f(x))$ have the same set of real roots?

Let $\alpha$ a root of $f$. Then $$f(f(\alpha ))=f(0)=d,$$
If $\beta$ is a root of $f(f(x))$, then $$f(f(\beta ))=f(\beta )^2+af(\beta )+d\cos(f(\beta ))=0.$$
• Why is the last term $d$ instead of $d \cos f(\beta)$? – Agnishom Chattopadhyay Jan 30 '16 at 16:27
• I corrected it, sorry. But actually, by the first part $d=0$, therefore this term is in fact null...@AgnishomChattopadhyay – Surb Jan 30 '16 at 16:34
• So, $a$ could be any integer and $d=0$. Is that it? – Agnishom Chattopadhyay Jan 30 '16 at 16:37
• No, $a$ must be null too. If $f(\beta)=-a\neq 0$, then $\beta$ is not a root of $f$ but it will be a root of $f(f(x))$. – Surb Jan 30 '16 at 16:40