Mean value theorem and differentiability Let $a,b\in \mathbb{R}$, $a<b$ and let $f$ be differentiable real-valued function on an open subset of $\mathbb{R}$ that contains $[a,b].$ Show that if $\lambda$ is any real number between $f'(a)$ and $f'(b)$ then there exists a number $c\in(a,b)$ such that $\lambda = f'(c)$.
I know I have to combine the mean value theorem with the intermediate value theorem for the function $\frac{f(x_1)-f(x_2)}{x_1-x_2}$ on the set $\{ (x_1,x_2)\in E^2:a\le x_1<x_2 \le b\}.$ How can I do that? 
 A: I think we should add the condition that $f'(a)\ne f'(b)$, otherwise $f(x)=\sin x$, $a=-\dfrac{\pi}{2}$ and $b=\dfrac{\pi}{2}$ would be a counterexample. Furthermore, $\lambda\ne f'(a)$ or $f'(b)$.
If we donote $g(x)=f(x)-\lambda x$, then the problem is equivalent to "If $f'(a)f'(b)<0$ then exists a $\nu\in(a,b)$, s.t. $f'(\nu)=0$".
Proof: Assume $f'(a)<0,f'(b)>0$, then $f(x)$ must reach its minimum value in $(a,b)$. This point $x=\nu$ has the property $f'(\nu)=0$. If $f'(a)>0,f'(b)<0$, then $f(x)$ must reach its maximum value in $(a,b)$. This point $x=\mu$ has the property $f'(\mu)=0$.
A: We will first reduce this to the case where $\lambda=0$ by considering the function $g(x)=f(x)-\lambda x$.  Then $g'(a)$ and $g'(b)$ have opposite signs.  Without loss of generality assume that $g'(a)<0$ and $g'(b)>0$.  If $g(a)=g(b)$ we are done by the mean value theorem.  If $g(a)<g(b)$ we can use the fact that $\displaystyle\lim_{y\rightarrow a}\frac{g(y)-g(a)}{y-a}<0$ to find a $y$ so that $a<y$ and $g(y)<g(a)$.  We can now find a $c$ such that $c\in (g(a),g(y))$ and $c\in (g(y),g(b))$.  Then apply the intermediate value theorem to get $a^{*},b^{*}\in (a,b)$ that satisfy $a^{*}<b^{*}$ and $g(a^{*})=g(b^{*})=c$.  Finally apply the mean value theorem on the closed interval $[a^{*},b^{*}]$.  A similar argument can be made for the case of $g(a)>g(b)$.
