<s>[INST] The quadratic polynomial $P(x)$ has a zero at $x=2$. The polynomial $P(P(x))$ has only one real zero at $x=5.$ Compute $P(0).$ 
The quadratic polynomial $P(x)$ has a zero at $x=2$. The polynomial $P(P(x))$ has only one real zero at $x=5.$ Compute $P(0).$

If we have that $P(x) = ax^2 +bx+ c$, we get from the first condition that $P(x) = (x-2)(bx+c).$
From here $P(P(x)) = (ax+bx+c -2)(b(ax+bx+c)+c)$, but this just looks very messy and doesn't seem to be helpful at all. Is there some other trick here I'm missing?
 [/INST] Write $$P(x)=a(x-2)(x-b)\implies P(P(x))=a(P(x)-2)(P(x)-b)=a(a(x-2)(x-b)-2)(a(x-2)(x-b)-b)=a^3(x-5)^2(x-u)(x-\bar{u})$$ since $\deg(P(P(x))=4$, which means it must have at least a double root of 5, while the other two roots are complex conjugates (not necessarily $\ne 5$). So we have $(3a(5-b)-2)(3a(5-b)-b)=0$.
Since 5 is a double root of $P(P(x))$, it is also a root of its derivative function. Hence $(2x-2-b)(a(x-2)(x-b)-b)+(a(x-2)(x-b)-2)(2x-2-b)=0$ when $x=5$, i.e. $(8-b)(3a(5-b)-b)+(3a(5-b)-2)(8-b)=0$. Clearly, $b=8$ solves this second equation. If we plug this value into the first equation, we get
$$(-9a-2)(-9a-8)=0\implies a=-\dfrac 29 \;\text{or}\;-\dfrac 89$$
However by plugging into the original equation we see that both cases doesn't produce the desired $P(x)$. Note that there's no need to solve the quartic equation, it suffices to check that 5 doesn't solve the equation we get here.
Thus, $6a(5-b)-b-2=0\implies 3a(5-b)=\dfrac{b+2}2$. This gives $(\dfrac{b+2}2-2)(\dfrac{b+2}2-b)=0\implies b=2\;\text{or}\; -1$, corresponding to $a=\dfrac 29$ and $a=\dfrac 1{36}$ respectively.
By checking in the same way as before, we see the only fitting solution is $a=\dfrac 29, b=2$, and therefore $$P(x)=\dfrac 29(x-2)^2$$
which means that $$P(0)=\dfrac 89$$.
</s>