Functions satisfying $(b-a)f'(\tfrac{a+b}{2}) = f(b)- f(a)$

Let $f$ be a differientable real function such that $$(b-a)f'(\tfrac{a+b}{2}) = f(b)- f(a)$$ for all reals $a,b$.

Is $f$ polynomial of degree $\leq 2$ ?


The answer is Yes.

The condition on $f$ is equivalent to

$$f(x+h)-f(x-h)=2f'(x)h\tag{1}$$ for all reals $x$ and $h$. Letting $h=1$ in $(1)$, we can conclude that $f$ is twice differentiable. Therefore, we can differentiate both sides of $(1)$ with respect to $h$ twice, which gives us

$$f''(x+h)-f''(x-h)=0. \tag{2}$$ Since $x$ and $h$ are arbitrary in $(2)$, $f''$ must be a constant function, i.e. $f$ is a polynomial of degree no more than $2$.