TITLE: If $f:I\to \mathbb{R}$ is differentiable and $f'$ is monotone nondecreasing then $f$ is convex.
QUESTION [8 upvotes]: Let $I \subseteq \Bbb{R}$ be an open interval. If $f:I\to \mathbb{R}$ is differentiable and $f'$ is monotone nondecreasing then $f$ is convex.

I would like a hint to solve this exercise. I applied the mean value theorem but I failed to solve it.
Thanks.

REPLY [3 votes]: $(1)$ If $f'$ is nondecreasing monotone, then $f(x)\leq f(a)+f'(a)(x-a)$ for any $x,a\in I$.
Let $x,y \in I$ with $x<y$ and $\theta \in [0,1]$, take $a=(1-\theta)x+\theta y$ and show that $f(a)\leq (1-\theta)f(x)-\theta f(y)$.
Now, by $(1) $ :
$f(x)\leq f(a)+f'(a)(x-a)$ $(2) $
$f(y)\leq f(a)+f'(a)(y-a)$$(3) $
Of $(2)$ and $ (3) $ :             
$\frac{f(x)-f(a)}{x-a}\leq f'(a)\leq 
\frac{f(y)-f(a)}{y-a}$.
Then $(1-   \theta)f(x)+\theta f(y)$.