"Mean value like" problem. Let $f:\mathbb{R} \longrightarrow \mathbb{R}$ be differentiable, take $a<a'<b<b'$. Prove that there exists $c<c'$ such that $$\frac{f(b)-f(a)}{b-a}=f'(c) \quad and \quad \frac{f(b')-f(a')}{b'-a'}=f'(c').$$ My first tries were connected with mean value because we can find such $c,c'$ but we don't konw if they satisfie required relation. We know though that they are in $(a',b)$. I ask for some hints.
 A: After subtracting a suitable linear function from $f$ we may assume $f(a')=f(b)=0$. We then can  find a point $\xi\in\ ]a',b[\ $ with $f'(\xi)=0$.
Assume $f(a)\leq 0$. Then we have
$$0\leq {f(b)-f(a)\over b-a}={\bigl|f(a)\bigr|\over b-a}\leq {\bigl|f(a)\bigr|\over a'-a}={f(a')-f(a)\over a'-a}=f'(\eta)$$
for some $\eta\in\ ]a,a'[\ $, and therefore
$$f'(\xi)\leq{f(b)-f(a)\over b-a}\leq f'(\eta)\ .$$
The intermediate value theorem for derivatives then guarantees a point $c\in\ ]\eta,\xi[\ $ with
$${f(b)-f(a)\over b-a}=f'(c)\ .$$
A similar argument works when $f(a)\geq0$, and similarly one finds a $c'\in\ ]\xi,\eta'[\ $ with
$${f(b')-f(a')\over b'-a'}=f'(c')\ .$$
A: Consider the function
$$
g(x)=f(x)-{f(b)-f(a)\over b-a}(x-b).
$$
It is easy to prove that $g(a)=g(b)$ and $g'( c)=0$. Moreover, if 
$\displaystyle{g(x_2)-g(x_1)\over x_2-x_1}=g'(\xi)$ then also
$\displaystyle{f(x_2)-f(x_1)\over x_2-x_1}=f'(\xi)$. So we can prove the theorem for $g$ and the result will hold for $f$ too.
We can take as $c$ any stationary point of $g$ in $(a,b)$.
If we can choose $c\le a'$ then $c<c'$ and we are done.
If not, suppose $g(a')>g(a)$ (the case $g(a')<g(a)$ can be handled in a similar way and the case $g(a')=g(a)$ is easy because then we can choose $c\in(a,a')$) and take $c$ as the absolute maximum point for $g$ on $(a,b)$. Then we have $g(a)<g(a')<g( c)$ and in addition there exists $a'_1\in(c,b)$ such that $g(a'_1)=g(a')$. Let $r$ be the line in the $(x,y)$ plane passing through $(a',g(a'))$ and $(b',g(b'))$. There are two possibilities:
1) if $g(b')<g(a')$, then the line parallel to $r$ and passing through $(c, g( c))$ intersects the graph of $g$ at a point $(b'', g(b''))$ with $b''>c$, and there exists $c'$ as required in $(c,b'')$;
2) if $g(b')\ge g(a')$, then the line parallel to $r$ and passing through $(a'_1, g(a'_1))$ intersects the graph of $g$ at a point $(b'_1, g(b'_1))$ with $b'_1>a'_1>c$, and there exists $c'$ as required in $(a'_1,b'_1)$.
