If $f(x_{0})=g(x_{0})$ and $f(x)\leq g(x)$, then $f'{(x_{0})}=g'{(x_{0})}$?

Hint: taking the difference $f(x) - g(x)$, it suffices to prove that if $f$ is a function for which $f(x) \geq 0$ and $f(x_0) = 0$, then also $f'(x_0) = 0$. This is obviously true if you draw a picture.


Since $f(x) \le g(x)$ for all $x \in (a,b)$ and $f(x_0) = g(x_0)$, we have $f(x)-f(x_0) \le g(x)-g(x_0)$ for all $x \in (a,b)$.

Then, since $x-x_0 > 0$ for all $x > x_0$, we have $$\dfrac{f(x)-f(x_0)}{x-x_0} \le \dfrac{g(x)-g(x_0)}{x-x_0} \quad \text{for all} \quad x \in (x_0,b).$$ Because $f$ and $g$ are differentiable, we can take the limit of both sides as $x \to x_0^+$ to get $$f'(x_0) = \lim_{x \to x_0^+}\dfrac{f(x)-f(x_0)}{x-x_0} \le \lim_{x \to x_0^+}\dfrac{g(x)-g(x_0)}{x-x_0} = g'(x_0).$$

Similarly, since $x-x_0 < 0$ for all $x < x_0$, we have $$\dfrac{f(x)-f(x_0)}{x-x_0} \ge \dfrac{g(x)-g(x_0)}{x-x_0} \quad \text{for all} \quad x \in (a,x_0).$$ Again, we can take the limit of both sides as $x \to x_0^-$ to get $$f'(x_0) = \lim_{x \to x_0^-}\dfrac{f(x)-f(x_0)}{x-x_0} \ge \lim_{x \to x_0^-}\dfrac{g(x)-g(x_0)}{x-x_0} = g'(x_0).$$

Since $f'(x_0) \le g'(x_0)$ and $f'(x_0) \ge g'(x_0)$, we have that $f'(x_0) = g'(x_0)$, as desired.


We will prove that $f'(x_0)<g'(x_0)$ is impossible, and then that $f'(x_0)>g'(x_0)$. By elimination, this will mean that $f'(x_0)=g'(x_0)$.

Case 1: $f'(x_0)>g'(x_0)$. By definition, this means that

$$\lim_{\epsilon\to 0}\frac{f(x_0+\epsilon)-g(x_0+\epsilon)}{\epsilon}=f'(x_0)-g'(x_0)>0.$$

Thus, we can find $\epsilon_0>0$ such that $\frac{f(x_0+\epsilon_0)-g(x_0+\epsilon_0)}{\epsilon_0}>0$, and hence $f(x_0+\epsilon)-g(x_0+\epsilon)>0$, and hence $f(x_0+\epsilon)>g(x_0+\epsilon)$. Since $f(x)\leq g(x)$ for all $x$ we have a contradiction, and hence this case impossible.

Case 2: $f'(x_0)<g'(x_0)$. Similarly, we have that

$$\lim_{\epsilon\to 0}\frac{f(x_0+\epsilon)-g(x_0+\epsilon)}{\epsilon}=f'(x_0)-g'(x_0)<0.$$

Thus, we can find $\epsilon_0>0$ such that $\frac{f(x_0-\epsilon_0)-g(x_0-\epsilon_0)}{-\epsilon_0}<0$, and hence $f(x_0-\epsilon_0)-g(x_0-\epsilon_0)>0$, and hence $f(x_0-\epsilon_0)>g(x_0-\epsilon_0)$. Again, we have contradicted the fact that $f(x)\leq g(x)$ for all $x$, so this case is impossible as well.

We thus conclude the result.