A Lagrange type intermediate theorem Let $f$ be continuously differentiable on $[a,b]$, and there exists a $c\in (a,b)$ such that $f'(c)=0$. Prove that there  exists $\eta\in (a,b)$ such that $$f'(\eta)=\frac{f(\eta)-f(a)}{b-a}.$$
I could only see that $f$ attains its minimum or maximum in $(a,b)$. 
 A: Let $g(x)=[f(x)-f(a)]e^{x/(a-b)}$, then\[g'(x)=e^{x/(a-b)}\left(f'(x)-\frac{f(x)-f(a)}{b-a}\right).\]If $g'(x)\ne 0$ for any $x\in (a,b)$, then $g'(x)>0$ for all $x\in(a,b)$ or $g'(x)<0$ for all $x\in(a,b)$ .
If $g'(x)>0$ for all $x\in(a,b)$, then $g(x)$ is increasing on $[a,b]$. Note that $g(a)=0$, we have $g(c)>g(a)=0$, i.e. $f(c)>f(a)$. However, since $f'(c)=0$, thus\[g'(c)=e^{c/(a-b)}\left(-\frac{f(c)-f(a)}{b-a}\right)<0.\]It contradicts the assumption $g'(x)>0$ for all $x\in(a,b)$.
The similar method can be used to solve the other condition that $g'(x)<0$ for all $x\in(a,b)$ .
A: Define $\displaystyle g(x) = f^\prime(x) - \frac{f(x)-f(a)}{b-a}$ and $\displaystyle h(x) = \frac{f(x)-f(a)}{b-a}$.  Without loss of generality $f(b)\geq f(a)$.
We have two cases:  $h$ is nonnegative and bounded above by $h(b)$ on the interval $(a,b)$, or $f$ achieves a maximum or minimum in the interval $(a, b)$.
In the first case, $\displaystyle g(c) = f^\prime(c) - h(c)  \leq 0$.  Let $d$ be such that $\displaystyle f^\prime(d) = \frac{f(b)-f(a)}{b-a} \geq \frac{f(d)-f(a)}{b-a}$, which exists by the mean value theorem.  Then $g(d) \geq 0$.  By the intermediate value theorem we have some $\eta$ between $c$ and $d$ (inclusive) with $g(\eta) = 0$ as required.
Now consider the second case.  Without loss of generality $f$ has a maximum at $c \in (a, b)$.  By the mean value theorem, there are $d\in (a,c)$ such that $\displaystyle f^\prime(d) = \frac{f(c)-f(a)}{c-a} > \frac{f(c)-f(a)}{b-a} > \frac{f(d)-f(a)}{b-a}$ while $\displaystyle f^\prime(c) = 0  < \frac{f(c)-f(a)}{b-a}$.  Hence $g(d) >0$ while $g(c) < 0$ and again by the intermediate value theorem, there is $\eta \in (d,c)$ with $g(\eta) = 0$.
