Find degree of polynomial satisfying given condition Question: 

If $f(x)$ is a polynomial of degree $n$ such that $$1+f(x)=\frac{f(x-1)+f(x+1)}{2} \forall x\in R$$
  then find $n$.

My attempt:
I first started off by trying to prove $f(x)$ to be periodic, as I always do whenever I spot $f(x-a)+f(x+a)$ anywhere. It did not work anyway. Then
 I thought of assuming a standard function of degree = $1,2,3$. It failed for 1 and 3, and worked for 2, so I gave answer as 2. However, I feel that:


*

*I did not prove that there are no higher $n$ for which this equation holds.

*My method is not neat at all!


I guess there must be a much simpler method, can anyone please give some starting steps for that neat logic?
 A: Using the recurrence relation method: First, to simplify things (a bit), differentiate the equation to obtain: $$f'(x+1)=2f'(x)-f'(x-1)$$ for any $x\in \mathbb R$. Now, for $n\in\mathbb N$, define $a_n:=f'(n)$, so that $$a_{n+1}=2a_n-a_{n-1}$$ This is a homogeneous recurrence relation of order 2, and the characteristic polynomial is $$x^2-2x+1=0$$ with obvious root $x=1$ with multiplicity $2$. Hence, the solution of the recurrence relation is $$a_n=(k_1+k_2n)(1)^n \implies f'(n)=k_1+k_2n$$ for all $n\in \mathbb N$, where $k_1,k_2$ are constants. Actually, by substituting $n=0$ and $n=1$, you get that $$f'(n)=f'(0)+(f'(0)-f'(1))n$$ Since $f'(0)\neq f'(1)$ (why?), the first derivative of your polynomial is a linear function on the integers, hence on $\mathbb R$, hence your initial polynomial was of degree $2$. 
A: Consider a general polynomial $g$ of degree $m,$ $m>0.$ Let
$$
g(x) = a_m x^m + a_{m-1} x^{m-1} + \cdots + a_0,
$$
where $ a_m \neq 0.$
Then
\begin{align}
g(x + 1) &= a_m (x+1)^m + a_{m-1} (x+1)^{m-1} + \cdots + a_0 \\
&= a_m\left(x^m + mx^{m-1} + \cdots + 1\right) 
  + a_{m-1}\left(x^{m-1} + \cdots + 1\right) + \cdots + a_0 \\
&= a_m x^m + \left(ma_m + a_{m-1}\right)x^{m-1} + \cdots + b_0,
\end{align}
where $b_0$ is a constant and all the terms not shown (the terms in the "$\cdots$") are terms of degree $m-2$ or less.
We see that $g(x+1)$ is also a polynomial of degree $m.$
A similar calculation shows that $g(x-1)$ is a polynomial of degree $m$;
by induction, so is $g(x+k)$ for any integer $k$, although that's
more than we need to know for this particular problem.
Taking the difference
\begin{align}
g(x + 1) - g(x)
&= a_m x^m + \left(ma_m + a_{m-1}\right)x^{m-1} + \cdots + b_0 \\
& \quad - a_m x^m + a_{m-1} x^{m-1} + \cdots +a_0 \\
&= ma_m x^{m-1} + \cdots + (b_0 - a_0), \\
\end{align}
which is a polynomial of degree $m-1,$ since $m >0$ and $a_m \neq 0.$
That is, in general, where $g$ is a polynomial of positive degree $m,$
the difference $g(x + 1) - g(x)$ is a polynomial of degree $m-1.$
Let $h(x) = g(x) - g(x-1).$
Since $g(x-1)$ is a polynomial of degree $m,$ 
$$h(x) = g((x+1) - 1) - g(x-1)$$ 
is a polynomial of degree $m-1.$
If $m=1$ then $h(x)$ is a constant, so $h(x+1) = h(x) = 0$;
but if $m > 1$ then
$$h(x+1) - h(x) = (g(x+1) - g(x)) - (g(x) - g(x-1))
= g(x+1) - 2g(x) + g(x-1)$$
is a polynomial of degree $m-2.$
I have written the facts above in terms of some arbitrary polynomial $g,$
rather than the less general polynomial $f$ in your problem,
to show that this method of differences is generally applicable.
Now let's apply it to your particular question.
Consider $f_2(x) = f(x+1) - 2f(x) + f(x-1),$ where $f$ is the polynomial of degree $n$ in the question. It is given that
$$1+f(x)=\frac{f(x-1)+f(x+1)}{2},$$
from which it follows that $f_2(x) = 2,$
that is, $f_2$ has degree $0.$
If $n = 0$ or $n = 1,$ we would have $f_2(x)=0,$
which is a contradiction;
therefore $n \geq 2$ and $f_2$ has degree $n-2.$
Combining the two statements about the degree of
$f_2,$ the degree of $f_2$ is $n - 2 = 0.$
Therefore $n=2.$
A: The sequence of polynomials $$p_n(x)=\prod_{k=0}^{n-1}(x+k)\qquad n=0,...$$ is a basis of the space of polynomials. Therefore any polynomial solution can be expressed as a linear combination of these $p_n(x)$.
If $\Delta f(x)=f(x+1)-f(x)$, then $$\Delta^2f(x)=\Delta(\Delta f(x-1))=\Delta(f(x)-f(x-1))=f(x+1)-2f(x)+f(x-1)$$
The equation we have can be written as $$\Delta^2 f(x-1)=2$$
Let's compute the action of $\Delta$ on $p_n$.
$$\Delta p_{0}(x)=1-1=0$$
$$\begin{align}\Delta p_n(x)&=p_n(x+1)-p_n(x)\\&=\prod_{k=0}^{n-1}(x+k+1)-\prod_{k=0}^{n-1}(x+k)\\&=n\prod_{k=1}^{n-2}(x+k)\\&=n p_{n-1}(x+1)\end{align}$$
Looks similar to the familiar $\frac{\partial x^n}{\partial x}=n x^{n-1}$
Therefore if $f(x)=\sum_n a_np_n(x)$ then we must have 
$$\sum_{n\geq 2} a_nn(n-1) p_{n-2}(x+1)=\Delta^2 f(x-1)=2=2p_0(x+1)$$
Since $p_n$ form a basis, all $a_n$ must be zero for $n>2$, and $a_2=1$. The coefficients $a_1$ and $a_0$ can take arbitrary values.
Therefore, your polynomial has the form $$f(x)=a_0p_0(x)+a_1p_1(x)+p_2(x)=x(x+1)+a_1x+a_0$$
A: Define $f_1(x):=f(x+1)-f(x)$, $f_{k+1}(x):=f_k(x+1)-f_k(x)$.
Since $f(x+1)−2f(x)+f(x−1)=2$, we know $f_2(x)=2$ is a constant, which suggests that $a_n:=f(n)$($n$ is an integer) is an arithmetic sequence of order two. It concludes that $f(x)$ is a polynomial of degree two.
A: Differentiating the given equation with respect to $x$ yields:
$$ f'(x) = \frac{f'(x+1)-f'(x-1)}{2} $$
In other words,
$$ f'(x+1) - f'(x) = f'(x) - f'(x-1) = m$$
where $m$ is some constant real value.
This implies that for all $x$, the points $f'(x+k)\;|\;k \in \mathbb{Z}$ lie on the line $f'(x)=mx+b$ for some $b$.
If $m=0$: Since $f'(x)$ is continuous, $f(x)=bx+c$ for some $c$, but substituting this function into the original relationship shows that there is no solution for $c$.
If $m\ne0$: Since $f'(x)$ is continuous, $f(x)=\frac{1}{2}mx^2+bx+c$ for some $c$, and substituting shows that this function satisfies the original relationship when $m=2$.
Thus, any function of the form $f(x)=x^2+bx+c$ satisfies the original relationship and $n=2$.
