5. Let $p(x)$ be a polynomial with real coefficients such that for all real $x$,
$$
2(1+p(x))=p(x-1)+p(x+1)
$$
and $p(0)=8 \cdot p(2)=32$. Determine the value of $p(40)$.
5. Answer: 2008.
Let $p(x)=q(x)+x^{2}$. Substituting this into the given functional equation, we get $q(x)-q(x-1)=q(x+1)-q(x)$ for all real $x$. Since $q(x)$ is a polynomial, we must have $q(x)-q(x-1) \equiv b$, where $b$ is a real constant. (The polynomial $Q(x) \equiv q(x)-q(x-1)$ can't take the same value at an infinite number of distinct points as it is eventually monotonic, unless it is a constant polynomial.) Next let $q(x)=r(x)+b x$. Substituting this into $q(x)-q(x-1)=b$, we get $r(x)=r(x-1)$ so that $r(x) \equiv c$, where $c$ is a real constant. Therefore, $p(x)=x^{2}+b x+c$. It can be easily verified that any polynomial $p(x)=x^{2}+b x+c$ satisfies the given function equation. Using $p(0)=8$ and $p(2)=32$, we get $p(x)=x^{2}+10 x+8$. Thus $p(40)=2008$.