Show that $f\left(\frac{x_1+x_2}{2}\right)\leq\frac{f(x_1)+f(x_2)}{2}$ Let $f$ be twice differentiable in $(a,b)$ and $f''>0$ in the same interval. If $a<x_1<x_2<b,$ show that $$f\left(\frac{x_1+x_2}{2}\right)\leq\frac{f(x_1)+f(x_2)}{2}.$$
I'm not sure how to start. I know at least that $f'$ is strictly increasing in $(a,b).$ Should I check separately for the cases $x_1\neq x_2$ and $x=x_2$? I'm supposed to use the mean value theorem, but I don't know how. Any insight I need to make in order to start? 
 A: What you want here is the convexity of $f$. Since you know that $f'$ is monotonically increasing, I will outline a proof for you of how to show $f$ is convex.
Proof outline. Let $a< x < y < b$ and consider the slope $m$ of the line $L$ joining the points $(x,fx)$ and
$(y,fy)$. By the mean value theorem, there exists a point $c\in (x,y)$ such that
$f'(c) = m$. Suppose that there is a point $\theta\in(x,y)$ such that $f(\theta)>L(\theta)$. Consider separately the two cases where $\theta\in(x,c)$ and $\theta\in(c,y)$ and
derive contradictions. (Draw pictures.)
A: Rewrite this as 
$f(\frac{x_1+x_2}{2}) - f(x_{1}) \leq f(x_2) - f(\frac{x_1+x_2}{2}) $ and then apply the Mean Value Theorem, noting that $f'$ is increasing.
A: If $f''(x)>0$ you can show that the strictly inequality holds:

$$f\left(\frac{x_1+x_2}{2}\right)<\frac{f(x_1)+f(x_2)}{2}$$

For the proof one way is to show that:

$$f''(x)>0 \implies f'(x) \ \text{strictly increasing} \iff f(x) \ \text{is strictly convex}$$

To proof that $f'(x) \ \text{strictly increasing} \iff f(x) \ \text{is strictly convex}$ let's consider $a<c<b$, thus for the MVT:
$$\frac{f(c)-f(a)}{c-a}=f'(d)<f'(e)=\frac{f(b)-f(c)}{b-c}\quad d \in(a,c), \quad e\in(c,b)$$
Now consider $a<x_1<z<x_2<b$ and $\lambda\in[0,1]$, we want to show that:
$$f(z)=f(\lambda x_1+(1-\lambda) x_2)<\lambda f(x_1)+(1-\lambda) f(x_2)$$
For the previous result by MVT we have that:
$$\frac{f(z)-f(x_1)}{z-x_1}<\frac{f(x_2)-f(z)}{x_2-z}$$
$${f(z)-f(x_1)}<\frac{z-x_1}{x_2-z}(f(x_2)-f(z))$$
$${f(z)}\left(1+\frac{z-x_1}{x_2-z}\right)<f(x_1)+\frac{z-x_1}{x_2-z}f(x_2)$$
$${f(z)}(x_2-x_1)<f(x_1)(x_2-z)+f(x_2)(z-x_1)$$
$${f(z)}<f(x_1)\frac{(x_2-z)}{(x_2-x_1)}+f(x_2)\frac{(z-x_1)}{(x_2-x_1)}=\lambda f(x_1)+(1-\lambda) f(x_2) \quad \square$$
For the special case $\lambda=\frac12$ thus:

$$f\left(\frac{x_1+x_2}{2}\right)<\frac{f(x_1)+f(x_2)}{2}$$

NOTE
The inequality is a particular case of "Jensen's inequality" for convex functions.
https://en.wikipedia.org/wiki/Convex_function
https://artofproblemsolving.com/wiki/index.php?title=Jensen%27s_Inequality
A: See difference from $f(x_1)$ to $f({{x_1 + x_2}\over 2})$, which is at exactly a middle point need to be smaller as a difference between  $f({{x_1 + x_2}\over 2})$ and $f(x_2)$ because a second derivative is > 0. So middle value of this f(x) need to be higher as this :

A: Let $x_1$ be fixed. Let $g(x_2) = f\left(\frac{1}{2}(x_1 + x_2)\right)$ and $h(x_2) = \frac{1}{2}(f(x_1) + f(x_2))$ be defined as functions of $x_2$ on the interval $[x_1, b]$. We wish to show $g(x_2) \leq h(x_2)$ for all $x_2 \in [x_1, b]$. Since $g(x_1) = h(x_1)$, it suffices to show that $g'(x_2) \leq h'(x_2)$ on $[x_1, b]$.
Differentiate $g$ with respect to $x_2$ giving $\frac{1}{2}f'\left(\frac{1}{2}(x_1+x_2)\right)$. Do the same with $h$ yielding $\frac{1}{2}f'(x_2)$. 
Since $f''>0$, it follows that $f'$ is increasing. Since $x_2 = \frac{1}{2}(x_2 + x_2) \geq \frac{1}{2}(x_1+x_2)$, it follows that $g'(x_2) = \frac{1}{2}f'\left(\frac{1}{2}(x_1+x_2)\right) \leq \frac{1}{2}f'(x_2) = h'(x_2)$ as desired. 
