TITLE: If $f(b)-f(a)=(b-a)f'(\frac{a+b}{2})$ prove that any such function is a polynomial of degree $2$
QUESTION [6 upvotes]: Consider $f:\Bbb R \to \Bbb R$ to be differentiable function. $f(b)-f(a)=(b-a)f'(\frac{a+b}{2})$ for all $a,b \in \Bbb R$ prove that any such function is a polynomial of degree $2$.
I am trying using Taylor's expansion that any point $a$ we have 
$$f(x)=f(a)+(x-a)f'(a)+(x-a)^2/2f''(a)+\cdots$$.
then I observed that the function is not infinitely differentiable. So we can't use the Taylor Series. So, I don't think that proving that the higher order differentiation vanishes also won't help. We can use Lagrange mean value theorem, but how to proceed? Any hint!!

REPLY [7 votes]: You forgot to state $f$ is differentiable.
Prove that $f$ is infinitely differentiable (hint: use $f'(x)=\dfrac{f(x+y)-f(x-y)}{2y}$).  Differentiating twice with respect to $y$, the equation
$$
f(x+y)-f(x-y)=2yf'(x)\quad\forall x,y
$$
gives
$$
f''(x-y)=f''(x+y)\quad\forall x,y.
$$
Hence $f''$ is a constant, so $f$ is a polynomial of degree at most $2$.