Given a function $f: [a,b] \to \mathbb{R}$, that is convex and continuous, prove that the following inequality:
$$\frac{2}{b-a}\int_a^b f(x) \,dx\le\frac{f(a)+f(b)}{2}+f\left(\frac{a+b}{2}\right).$$
I tried using the Hermite-Hadamard inequality because I thought it had a similar form, but nothing came out.
The picture says it all. Use the formula for the area of a trapezoid.
UPD: I have no idea why my hint got downvoted, so here is the full solution.
As we can see in the picture due to function convexity and continuity we have the following area inequality: $$\int_{a}^b f(t)dt \le S_{ABED} + S_{BCFE}$$ Both $ABED$ and $BCFE$ are trapeziods, so $$S_{ABED} = \frac{f(a)+f\left(\frac{a+b}{2}\right)}{2}\cdot\frac{b-a}{2}$$ $$S_{BCFE} = \frac{f\left(\frac{a+b}{2}\right) + f(b)}{2}\cdot\frac{b-a}{2}$$ Now we have: $$\int_a^b f(t)dt \le \frac{b-a}{2}\left(f\left(\frac{a+b}2\right) + \frac{f(a)+f(b)}{2}\right)$$ QED