Suppose a continuous ,differentiable and real valued function satisfies the relation $f(\frac{x+y}{3})=\frac{2+f(x)+f(y)}{3}$ For all real x and y. If $f’(2)=2$ Then find $f(x)$
This is how I attempted it:
We substitute $y=2x$ in the equation $f(\frac{x+y}{3})=\frac{2+f(x)+f(y)}{3}$ we get , $f(x)=\frac{2+f(x)+f(2x)}{3}$. Now , rearranging the equation gives us ,
$2f(x)=2+f(2x)$
Differentiating both sides ,
$2f’(x)=2f’(2x)$ or $f’(x)=f’(2x)$
Now if we substitute $x=1,2,3,$ etc., we will get $f’(x)=2$ for all $x$ . Therefore I concluded ,
$f’(x)=2$ for all $x$
Now integrating both sides ,
$f(x)=2x+c$ , where $c$ is the constant of integration. By substituting $x=0$ in the original functional equation , we get $f(0)=2$ this leads us to the conclusion that $f(x)=2x+2$
All was well till here and the answer is also right. However after sometime , I suddenly realized that I had only considered multiples of two. So I presume that this equation will work only for multiples of two. Then it means that this wouldn’t work for numbers like $3$ or $5$ . Does this mean that my method is wrong ? Or a rational explanation to my confusion would be that odd numbers like $3$ or $5$ can be written as $2(3/2)$ or $2(5/2)$ etc.? Do you think that the method I’ve used is correct ? Please suggest mistakes if any . Thanks !
From the functional equation
$$f\left(\frac{x+y}{3}\right)=\frac{2+f(x)+f(y)}{3}\tag1$$
it is trivial to see that
$$f(0)=2\tag2$$
Differentiating $(1)$ with respect to $y$ reveals
$$f'\left(\frac{x+y}{3}\right)=f'(y) \tag3$$
whereupon setting $y=2$, we find that for all $x$
$$f'\left(\frac13 x+\frac23\right)=2\tag4$$
Integrating $(4)$ and applying $(2)$ yields the coveted relationship
$$f(x)=2x+2$$